Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, February 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: Closing a form with VB rather than use an Ok/Close fucntion on the button.
Dave Cleary
Posts: 61
 
Closing a form with VB rather than use an Ok/Close fucntion on the button.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Nov 12 5:25 AM
fiogf49gjkf0d

Hi


Is there anyway of closing a form using code rather than the Ok/Close function on a button.


I have a button that validates on a few fields when clicked, if it passes the validation I want the form to close but if it fails I want the form to remain open and for the user to complete the missing field.


Can this be done?


Thanks in advance


Dave


 


 

[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Closing a form with VB rather than use an Ok/Close fucntion on the button.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Nov 12 5:41 AM
fiogf49gjkf0d

Yes, opn the form make sure the OnValidate event is set. Then you can use AXFormValidate = False (to stop it closing) or AXFormValidate = True (if OK to close). Open pretty much any other SLX form and you'll see this/how it works.

[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Closing a form with VB rather than use an Ok/Close fucntion on the button.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Nov 12 5:42 AM
fiogf49gjkf0d

Sorry, I should say - you'd be best to put your code (for Validation) in this routine rather than your own (you can use CloseQuery too). However, if you really want to do it - then you can just do btnOK.Click to emulate it.

[Reply][Quote]
Lane
Posts: 121
 
Re: Closing a form with VB rather than use an Ok/Close fucntion on the button.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Nov 12 8:20 AM
fiogf49gjkf0d

You can also force a close from any script at any time by;


application.basicfunctions.closecurrentview true ''' closes form same as cancel


application.basicfunctions.closecurrentview False ''' closes form same as save


 

[Reply][Quote]
Dave Cleary
Posts: 61
 
Re: Closing a form with VB rather than use an Ok/Close fucntion on the button.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Nov 12 3:56 AM
fiogf49gjkf0d

Hi, Thanks for the replies


The problem that I seem to be having is that if I set the button ModalResult to mrNone (so that it doesn't close the form which is why I need the close script) the validation doesn't see what has been entered in the field, so if there is nothing in the field when I enter the form and I click my button it validates and says you have missed the key field, however if I then enter something and then click the validate button it still shows the missed field message as though it hasn't seen whats in there. Obviously when I had the ModalResult set to mrOk it was saving the data in the field before validating.


How can I automatically save what has been entered so that when I click the validate button it sees what has been entered?


Thanks


Any advice on this would be appreciated.


Dave


 


 

[Reply][Quote]
Dave Cleary
Posts: 61
 
Re: Closing a form with VB rather than use an Ok/Close fucntion on the button.Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Nov 12 4:18 AM
fiogf49gjkf0d

Hi,


Sorry I've over thought this far too much and have now fixed it....!!


Thanks for the replies.


Dave

[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/23/2025 4:48:54 AM