BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
LOVE_SAA
Obsidian | Level 7
Hi,
Is there any system field which tells when any of
the field value is changed before saving the object. Or
Is there any way to capture this changes?
1 ACCEPTED SOLUTION

Accepted Solutions
BrendanW
SAS Moderator

Yes, you can use the <on-change> XML element within the field to determine if the value is changed before the object is changed. If it is changed, you can perform an action. Here is an example from the Administration and Customization Guide. 

 

<field name="x_option1" type="dropdown" values="getNamedListLabelValues('MyNamedList')">
  <label>Married</label>
  <on-change>
    <set-visible name="x_str1" test="x_option1 = 'Y'"/>
  </on-change>
</field>
  <field name="x_str1" type="string">
  <label>Name of Spouse</label>
</field>

In this example, if a person were to select the option 'Y' from a drop-down on the 'Married' field, <on-change> recognizes the update to the field, tests to see if the selection is Y, and makes the 'Name of Spouse' field visible in the user interface if the selected field meets that criteria.


Does this answer your question?

View solution in original post

3 REPLIES 3
BrendanW
SAS Moderator

Yes, you can use the <on-change> XML element within the field to determine if the value is changed before the object is changed. If it is changed, you can perform an action. Here is an example from the Administration and Customization Guide. 

 

<field name="x_option1" type="dropdown" values="getNamedListLabelValues('MyNamedList')">
  <label>Married</label>
  <on-change>
    <set-visible name="x_str1" test="x_option1 = 'Y'"/>
  </on-change>
</field>
  <field name="x_str1" type="string">
  <label>Name of Spouse</label>
</field>

In this example, if a person were to select the option 'Y' from a drop-down on the 'Married' field, <on-change> recognizes the update to the field, tests to see if the selection is Y, and makes the 'Name of Spouse' field visible in the user interface if the selected field meets that criteria.


Does this answer your question?

LOVE_SAA
Obsidian | Level 7
Hi Bwil,

Thanks for your reply. This option I know. I have too many fields in the screen, linking other objects and dimensions. So if we go with on change element, it would be more complicated. So, is there any other option? .
Thanks for your your valuable time.
BrendanW
SAS Moderator

Unfortunately on-change is the only way I know to dynamically change fields on the screen.