March 10, 201213 yr Hi! I´ve been trying to get the field name of a portal field, but the expression Get(ActiveFieldName) refers to the name of the field of main table in the layout. Any help would be highly appreciated. Thanks.
March 10, 201213 yr but the expression Get(ActiveFieldName) refers to the name of the field of main table Get ( ActiveFieldName ) returns the name of the field - whether parent or portal (child). Maybe you can explain what you are trying to do and describe your setup (the table names and their relationship)? :)
March 10, 201213 yr Author Get ( ActiveFieldName ) returns the name of the field - whether parent or portal (child) Ok, I have a Button setup... Perform Script option for that field; I disabled it and now it returns the name of the portal field. The question now would be how to do it while keeping button setup option.
March 10, 201213 yr The question now would be how to do it while keeping button setup option. The question now would be what is it you are trying to do. If a field is defined as a button, clicking it does NOT make it the active field.
March 10, 201213 yr Author It is a long way, but at this point I need to capture the active field name, but at the same time I need to perform a script when clicking on it, as the scripts assigns a value to variable $unit using this calculation: Case ( Get (ActiveFieldName) = "kilom_01"; preventive::unit_01_number; Get (ActiveFieldName) = "kilom_02"; preventive::unit_02_number; Get (ActiveFieldName) = "kilom_03"; preventive::unit_03_number; ... until 20 ... where Preventive is the parent table and kilom_01...20, belong to portal Lines
March 10, 201213 yr I am afraid I don't follow this to the end. It seems like you need to rethink your entire approach: having numbered fields is almost always a symptom of inadequate data structure.
March 10, 201213 yr Author Ok, yes, maybe you are right. That´s why I just wanted to see if you know any trick to capture the activefield name without removing de Button setup to perform the script. Everything else is working good, only that step is the problem.
March 10, 201213 yr Ok, yes, maybe you are right. Oh yes, Comment is right - it is "symptom of inadequate data structure." Everything else is working good, For now. But please keep in mind his suggestion that your structure is probably incorrect. And next time you hit a similar road-block, remember why ...If you have 20 fields - they should be records instead. Truly, you should consider at least having it reviewed before you invest your precious time only to have to remove most of it and start over. The base is the most important ... structure is EVERYTHING, just like in a house. You are potentially building your house on sand and we are suggesting you re-think it. We'll help you; but you will need to ask. Some folks like houses that tip sideways and sink in the sand. Who are we to say what you want? :laugh2: Edited March 10, 201213 yr by LaRetta
March 10, 201213 yr Author Just to give an idea of what I´m talking about. This layout is showing 14 of 20 fields for each unit.
March 10, 201213 yr Ok, yes, maybe you are right. That´s why I just wanted to see if you know any trick to capture the activefield name without removing de Button setup to perform the script. Everything else is working good, only that step is the problem. Comment already mentioned that clicking a field formatted as a button DOES NOT MAKE IT ACTIVE. A field is active when it contains the cursor.
March 10, 201213 yr You could attach a script parameter to each button. That may solve your current problem but - as LaRetta said - there will be others.
March 11, 201213 yr Author I have already assigned a script parameter from 1 to 20 to catch other info from the related records, in the same script. Yes, I´ll try your recommendation and let you know what happened.
March 11, 201213 yr Author Ok, it is working good now, it´s doing what I was looking for. Thank you all for your professional support. I´ll take all your advices into account.
Create an account or sign in to comment