Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, February 24, 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: Accessing controls Inside a Control Container
Dan Carvin
Posts: 227
 
Accessing controls Inside a Control ContainerYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Sep 08 4:26 PM
I'm trying to create a Business Rule to assign values to controls inside a Control Container. I'm finding that Intellisense does not show the controls inside the container. I get as far as
Sage.Form.Interfaces.IReturnDetails.hdPrintFields.Controls.

But then I don't see the controls within. Can I script values into a control container, or only controls placed directly on the main Qwickform?

(If you really want to make my day, you'll tell me I don't need to jump through these hoops to implement what is described in http://www.slxdeveloper.com/forum.aspx?forumid=4002&postid=17700)

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Accessing controls Inside a Control ContainerYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Sep 08 4:54 PM
Business rules do not know anything about the UI, and they are not meant to. A business rule does not have any reference to the form you might be using them on and that's a good thing.

What you should do is one of the following (depending on which best fits your specific scenario) - in order of the best case way to do it to the worst (not that any of these ways are "wrong" though):

1) Have the business rule set the values in the bound entity properties. For example, you would set myentity.Property = "some value" in the rule, then it will display just fine in the UI. If this is called in the load of the form in some way, or on a refresh event you'll see it in the controls.

2) Create a custom property (which is just code, like a calculated field) on the entity to do whatever is needed, then just bind that custom property to the control in question.

3) Make the business rule so it returns the appropriate value. Then create a LoadAction on your form to call the rule and set it's return value in the appropriate control (make sure you set the LoadAction's repaint event to true)

Does that make sense? BTW, even in a LoadAction, which is a part of the UI, you won't see the controls listed in the intellisense. Don't trust the intellisense in the AA, it doesn't always show what is available.

-Ryan
[Reply][Quote]
Dan Carvin
Posts: 227
 
Re: Accessing controls Inside a Control ContainerYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Sep 08 5:27 PM
#3 is what I was doing.

So is

Sage.Form.Interfaces.IReturnDetails.ControlContainerName.Controls.ControlName = function();

the correct syntax?
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Accessing controls Inside a Control ContainerYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Sep 08 5:30 PM
Quote:
Sage.Form.Interfaces.IReturnDetails.ControlContainerName.Controls.ControlName = "Value";


No. That is not right. The ControlContainer, or any controls, is not a member of the entity. The entity does not know anything about a form you are using it on, or the controls on a form.

First of all, where are you doing this code (where you are trying to reference the control)? In a LoadAction or a rule?
[Reply][Quote]
Dan Carvin
Posts: 227
 
Re: Accessing controls Inside a Control ContainerYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Sep 08 5:38 PM
I was creating it in a business rule which I could then run as a Load Action. Are you suggesting I should put the code into a C# snippet? Or just scrap it and go with #1?

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Accessing controls Inside a Control ContainerYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Sep 08 7:27 PM
Any code that references a control on the form must be in a LoadAction. The business rule can do whatever is needed and then return the value. Then in the LoadAction you'd do something like this:

Sage.Entity.Interfaces.IMyEntity myentity = this.BindingSource.Current as Sage.Entity.Interfaces.IMyEntity;
textControl.Text = myentity.GetSomeValue();


What is the specific scenario you're trying to do so I can help you pick the best route?
[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): 2/24/2025 2:24:02 AM