Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, August 18, 2025 
 
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!
 Web Forums - SalesLogix Web Platform & Application Architect
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.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: How do I bind a form field to the return of a business rule? How do I use a form field as a parameter to the business rule?
NixDev
Posts: 98
 
How do I bind a form field to the return of a business rule? How do I use a form field as a parameter to the business rule?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Apr 09 11:02 AM
Hi,

My apologies if this is a dumb question. It's been just a few days since I started working with application architect.

I have a business rule for Account entity, its signature is something like getSomethingStep1(IAccount account, String parameter, out String value).

Let's suppose I need to display the output in a textbox in Account detail form. I can see that it's easy to add an attribute to the form or add a textbox and bind it to an attribute in my entity, but what if I need to display the return of the business rule? How do I pass the value of a GUI field as a parameter to the business rule? How do I bind the return of the rule to a field in the form?

Thanks a lot!
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: How do I bind a form field to the return of a business rule? How do I use a form field as a parameter to the business rule?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Apr 09 11:30 AM
Hi,

To populate an unbound form element, in a c# snippet (something similar to at least!):

//formid.Text = acc.getSomething("myparameter"); OR

//formid.Text = acc.getSomething(MYFORMPARAMETERTEXTBOX.Text);

If you are doing in a Code Snippet and want to set the value to an unbound form item, then use the form interface (the "form" interface is passed into the code snippet dialog).

I dont really use the form interface method but I think you have to cast the interface member as the appropriate type, like:

//((TextBox)form.CONTROLID).Text = account.getSomething("myparameter");

Someone correct me here if im wrong please

If as you say the "myparameter" needs to come from a form element, use ((TextBox)form.MYOTHERCONTROLIDASPARAMETER).Text instead, so a bit like:

//((TextBox)form.CONTROLID).Text = account.getSomething(((TextBox)form.MYOTHERCONTROLIDASPARAMETER).Text);

Ive not had to do it before, but that works in my head

You may need to call this firstly in a quickformload and an onchange in your MYOTHERCONTROLIDASPARAMETER form element (textbox), depending on required results.

Thanks,
Nick
[Reply][Quote]
Mike LaSpina
Posts: 116
 
Re: How do I bind a form field to the return of a business rule? How do I use a form field as a parameter to the business rule?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Apr 09 5:50 PM
I'd use a code snippet property rather than a business rule if you're only getting a value. These act just like ordinary fields when it comes to binding. To add one, right click on the 'Properties' node in your entity and choose 'New Code Snippet property'.
[Reply][Quote]
NixDev
Posts: 98
 
Re: How do I bind a form field to the return of a business rule? How do I use a form field as a parameter to the business rule?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Apr 09 9:35 PM
Yes, but take into account that I need to pass parameters. I think a property won't allow them...
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: How do I bind a form field to the return of a business rule? How do I use a form field as a parameter to the business rule?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Apr 09 1:33 AM
Quote:
Originally posted by NixDev

Yes, but take into account that I need to pass parameters. I think a property won't allow them...


Correct. If you need to pass params then you'll have to use a rule (which means you code it up to the control, not bind.
[Reply][Quote]
NixDev
Posts: 98
 
Re: How do I bind a form field to the return of a business rule? How do I use a form field as a parameter to the business rule?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Apr 09 9:48 AM
Exactly, that's how I solved it, thanks.
[Reply][Quote]
Mike LaSpina
Posts: 116
 
Re: How do I bind a form field to the return of a business rule? How do I use a form field as a parameter to the business rule?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Apr 09 10:24 AM
Somehow, I didn't see that you were needing a parameter - guess I should read more thoroughly! Anyway, you'll have to maintain the binding yourself in that case. In the OnFormBound (or the quickformload0) event of your form, call the business rule and populate your control. Be sure to add code to clear the field if there is no data to return as the form will contain the state info and data from the last time it was opened.
[Reply][Quote]
 Page 1 of 1 
  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!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 8/18/2025 2:23:20 AM