Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, November 26, 2024 
 
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!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Populating controls after LOAD with default values
Richard
Posts: 33
 
Populating controls after LOAD with default valuesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Aug 06 6:04 PM
fiogf49gjkf0d
Is there a way to programatically populate some controls on a form? I'd like to populate some controls with default values when the record is new.

SLX doesn't seem to be giving us the equivalent of VB's form LOAD and ACTIVATE events so when I try to put something into a bound control, I come up with.. well... whatever is in the record, which in the case of a new record is nothing.

I've also tried to use a SQL "SELECT ... INTO" command to try to copy a (default) record into a temp table then insert back into the one I'm using but I just get a "unable to parse" error.
[Reply][Quote]
Jeff Crawford
Posts: 52
 
Re: Populating controls after LOAD with default valuesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Aug 06 6:11 PM
fiogf49gjkf0d
Try setting your properties in the form's OnOpen Event.

~JC
[Reply][Quote]
Richard
Posts: 33
 
Re: Populating controls after LOAD with default valuesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Aug 06 6:27 PM
fiogf49gjkf0d
I did, Jeff.

But that doesn't work (for me) if that control is bound to a table field. If it's unbound, I don't have a problem.
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Populating controls after LOAD with default valuesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Aug 06 7:24 PM
fiogf49gjkf0d
How is the form that contains the controls launched?

I have created forms that auto fill some fields if a new record is being added. If the form is called from a grid I use the OnAdding event to set a global variable that I look at in the when open event of the form.

Another approach is to put a object containing the primaryid of the table the form goes after on the form. It the primaryid field is empty I know I am in add mode. If the primaryid is not empty I know I am in edit mode.
[Reply][Quote]
Richard
Posts: 33
 
Re: Populating controls after LOAD with default valuesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Aug 06 8:51 PM
fiogf49gjkf0d
This is a data form called as Add/Edit from a grid. All is well if it's edit because SLX very nicely fills in the bound controls.

I have no problem getting the data over to the form (I pass a recordset through a global), but can't fill in the controls, even though I try to do it in the OnLoad event. If this were VB I'd be looking for the Activate event which would happend after the bound controls have been populated with table data. Here, there is no such event. I can unbind all of the controls and populate them manually, but I'm trying to do as little work as possible (I'm sure you know how it is).

It sounds like you're doing what I want to do, Frank. And you're using the method that I've tried. Maybe I'm missing something.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Populating controls after LOAD with default valuesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Aug 06 10:18 PM
fiogf49gjkf0d
If this is a data view, then you should be using the OnChange event to initialize whatever for the form.
[Reply][Quote]
Richard
Posts: 33
 
Re: Populating controls after LOAD with default valuesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 31 Aug 06 2:10 AM
fiogf49gjkf0d
Thank you, Ryan. The OnChange event works very well. I just didn't recognize it from the description given to it.
[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 © 2024 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): 11/26/2024 12:26:17 PM