Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, August 23, 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!
 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: Validation on a manage form
Bill
Posts: 71
 
Validation on a manage formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 May 08 10:28 AM
I have a manage form that has several required fields on it. The form validate wasn't working correctly so I changed the Button Kind to bkCustom and set the modal result to mrNone. On the button click event I added the line Appliaction.BasicFunctions.CloseCurrentView False as the last line of code. That code fires after the values are written to the database. What I need to do is stop the program from writing changes to the database after the user clicks OK on the message box that displays if there is a blank field that is required.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Validation on a manage formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 May 08 11:03 AM
IIRC validation doesn't fire the same for non-bound forms. What I usually do is script it. Check the required controls (which you can do generically as well if needed by flagging the required ones and looping through the controls) and then stop execution if the form does not validate.
[Reply][Quote]
Bill
Posts: 71
 
Re: Validation on a manage formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 May 08 11:22 AM
Thanks Ryan....

This is the validation code that is firing on the button click event:
If dteStartDate.Text = "" Then
msgbox("You must enter a Start Date."), 64, "Add/Edit Class"
dteStartDate.SetFocus
End If
Exit Sub

If dteEndDate.Text = "" Then
msgbox("You must enter an End Date."), 64, "Add/Edit Class"
dteEndDate.SetFocus
End If
Exit Sub

This in now stopping when clicking the Ok button on the message box, but after entering data in the fields and clicking the Ok button the program does not continue on to add or update the database.

Any suggestions?
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Validation on a manage formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 May 08 11:36 AM
That is because your "Exit Sub" statements are *outside* of your IF blocks. Move them inside the IF blocks and all will be fine (you only want to exit the sub if validation fails).
[Reply][Quote]
Bill
Posts: 71
 
Re: Validation on a manage formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 May 08 11:44 AM
My bad, I didn't even pay any attention to that. After making the chages it is working just like it is firing on a data form.

Thanks Ryan!!!
[Reply][Quote]
Matt Dockins
Posts: 159
 
Re: Validation on a manage formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 May 08 4:24 PM
For future reference, I don't know if you used this or not, AXFormCloseQuery (OnCloseQuery on the form events tab) is the event you want to use for manage form validation. This is the event that allows you to prevent the form from closing and still allows you to use the default and cancel buttons for modalresults.
[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/23/2025 5:54:12 PM