cereal_killer Posted March 10, 2012 Posted March 10, 2012 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.
LaRetta Posted March 10, 2012 Posted March 10, 2012 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)? :)
cereal_killer Posted March 10, 2012 Author Posted March 10, 2012 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.
comment Posted March 10, 2012 Posted March 10, 2012 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.
cereal_killer Posted March 10, 2012 Author Posted March 10, 2012 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
comment Posted March 10, 2012 Posted March 10, 2012 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.
cereal_killer Posted March 10, 2012 Author Posted March 10, 2012 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.
LaRetta Posted March 10, 2012 Posted March 10, 2012 (edited) 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, 2012 by LaRetta
cereal_killer Posted March 10, 2012 Author Posted March 10, 2012 Just to give an idea of what I´m talking about. This layout is showing 14 of 20 fields for each unit.
Vaughan Posted March 10, 2012 Posted March 10, 2012 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.
comment Posted March 10, 2012 Posted March 10, 2012 You could attach a script parameter to each button. That may solve your current problem but - as LaRetta said - there will be others.
cereal_killer Posted March 11, 2012 Author Posted March 11, 2012 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.
cereal_killer Posted March 11, 2012 Author Posted March 11, 2012 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.
Recommended Posts
This topic is 4698 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now