7/5/2025 2:29:27 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
|
|
|
|
Modifying control properties in a businessrule
Posted: 03 Aug 09 3:13 PM
|
Hi All,
I'm fairly new to development in the 7.5 web client and it seems to be the little things I have trouble with.
I'm simply trying to disable (or make readonly) a picklist field on the accountdetails view based on the results of a HQL query. My query is ok, but I'm just having trouble figuring out how to modify the enabled property of the control
I thought I could just do something like: "account.(controlName).Enabled = False", or somthing similar, but the control properties are not available in this way from what I see.
I'm sure I'm just being stupid... Can anyone help?
Thanks in advance
Don
|
|
|
| |
|
Re: Modifying control properties in a businessrule
Posted: 07 Aug 09 3:23 AM
|
Business rules affect entities, while you want to change a property of a control in a form.
You should use a code snippet action (or the "obsolete" c# snippet action) on your form.
E.g. change your business rule so it returns a boolean value, then add a onload code snippet action into the form. In the snippet, write something like the following:
IAccount account = (IAccount) this.BindingSource.Current;
this.ControlName.Enabled = account.yourBusinessRule();
Note that "this" inside a form's load action refers to the form itself. The control is a property of the form, not of the entity. This way, you keep the logic into the Entity layer using a business rule, but apply the criteria into the form.
|
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|