
07-28-2010 10:20 AM
What is the best way to set the text property of a screen object at run-time?
Scenario:
SLX Web v7.5.2
Opportunity Detail Screen with:
Field A (Saleslogix Picklist control)
Field B (Saleslogix Date Time Picker control)
When a user changes the value in Field A, the value of Field B needs to be set to the current date.
I've tried various server-side methods (OnChange Action via Code Snippets). I believe they run successfully, but the updated value in Field B never displays. I've tried client-side via JS and haven't had much luck attaching JS to a Picklist web control.
Any help/code examples would be much appreciated. Thanks.
08-04-2010 12:28 PM
Mark,
Try changing the value of the Entity Property bound to the control instead of changing the value of the control directly.
If you're going to use a C# Code Snippet, you have to get the current entity. Below is an example of getting an account entity (on an account form).
Sage.Entity.Interfaces.IAccount account = this.BindingSource.Current as Sage.Entity.Interfaces.IAccount;
08-04-2010 02:30 PM
Thanks. That technique is something I had originally tried; it worked halfway. While that *does* reset the value correctly behind-the-scenes, there's no visible indication on the screen that the value has changed. If I were to save/reload the detail screen via the Save button in the UI, the updated value would then display as expected.
Is there a way to trigger a screen refresh after modifying the myentity.ThePropertyGettingUpdated value on the entity? I had tried getting the entity to rebind after updating the property (to show the updated value to the user) without success.
Thanks,
Mark
08-04-2010 03:10 PM
You shouldn't have to do anything to have the value refresh.
Can you post or email me your code snippet?