Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, November 27, 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: Event Order Question
Carla Tillman
Posts: 290
 
Event Order QuestionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Feb 07 8:09 AM
fiogf49gjkf0d
Hi guys!

I need some help with an onchange event and when it fires.

V7 no SP.

I have written a new module with MainView, etc. for display (Licensing)

On my Licensing Details main form I have places a combobox. The data for this box comes off a simple sql RS and loop.

However, when I begin to navigate records I run into issues. The sql statement requires a hidden text field (accountid) as part of the where clause. The behavior I am seeing is that the FormOnChange event fires Before the new record hidden value changes. Thus the records are pulled for the previous account.

And here it is, the big question: What order are the events firing when I navigate (previous, back, etc.) while inside a mainview? How do I get my accountid to pop before running my FormOnChange? ... I am sure it is obvious as heck, but I have burned too much time on what should be a simple logic issue. (oh, the shame)

Is there a better way to handle this?

Carla



[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: Event Order QuestionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Feb 07 11:40 AM
fiogf49gjkf0d
Are the text field and combobox on the same form? If so then the accountid will update immediately preceeding the OnChange event. I believe OnChange fires AFTER the form updates the underlying control binded properties with their database values. Immediately following that, bound control's OnChange event triggers. If the controls aren't on the same form and one happens to be on the mainview itself then you're most likely going to run into the symptom you're seeing: it "knowing" the last db value instead of what's current.

I believe the hidden text field trick is used by the Account Detail screen to update the address memo. There's also a hidden accountid field there as well (these are v6.2 forms, I believe v7 shouldn't be that different).
[Reply][Quote]
Carla Tillman
Posts: 290
 
Re: Event Order QuestionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Feb 07 11:44 AM
fiogf49gjkf0d
Yup. Same form.

I will go back look it one more time...
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Event Order QuestionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Feb 07 12:37 PM
fiogf49gjkf0d
You can change the order that the controls are created. Moving a control higher up on the creation list should make it's bindings fire before those that are lower on the list.

Right click on the form, there is a menu option there called something like "Control Creation Order". In the dialog that opens, select your hiddel label and then move it up on the list.

Give that a try and let me know if it doesn't work.
[Reply][Quote]
Carla Tillman
Posts: 290
 
Re: Event Order QuestionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Feb 07 1:14 PM
fiogf49gjkf0d
Spot On.

"Ryan: The One Click King"


I can't believe how much time I wasted trying to find this one... That will teach me not to ask sooner. Expect a blast of them - my deadline is coming up FAST!


c
[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/27/2024 2:35:40 AM