Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, June 20, 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: Using "X" doesn't invoke AXFormCloseQuery(Sender)
Michael Fortier
Posts: 12
 
Using "X" doesn't invoke AXFormCloseQuery(Sender)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Oct 07 8:32 AM
I have a form with required fields that I use AXFormCloseQuery(Sender) to prevent the user from closing the form without them.

The problem is they can click the close form "X" in the upper right hand corner and this bypasses the AXFormCloseQuery(Sender) code. I've tried

Sub AXFormClose(Sender)
AXFormCloseQuery(Sender)
End Sub

But the form still closes. Is there a way to hide the Window "X" button or another way to fix this problem?

This is SLX 6.2. Thanks.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Using "X" doesn't invoke AXFormCloseQuery(Sender)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Oct 07 8:49 AM
Maybe this is a bug? I just tried this last week in version 7.0.1 and it worked fine. The form's OnCloseQuery event did fire when the form was attempted to be closed by clicking the X on the title bar.

I'll see if I can reproduce on a 6.2 system...
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Using "X" doesn't invoke AXFormCloseQuery(Sender)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Oct 07 8:59 AM
OK, just tested on v6.2.6 and it worked fine for me. What does the code look like in your AXFormCloseQuery event look like?
[Reply][Quote]
Michael Fortier
Posts: 12
 
Re: Using "X" doesn't invoke AXFormCloseQuery(Sender)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Oct 07 10:22 AM
Thanks for the quick response.

'code below works fine when hitting "OK" but not when clicking on the "X" Included msgbox "TEST" just to see if it would show when hitting "X" and it doesn't.

Function AXFormCloseQuery(Sender)

msgbox "TEST"

If (txtAddress1.text="" OR pklCity.text="" OR pklState.text="" OR txtDestSQFT.text="" OR _
cboComQuarter.text="" OR txtComYear.text="") AND pklReason.text="Signed Lease" Then

MsgBox "Address 1, City, State, Destination SQFT, Committment Date and Reason are ALL required fields."

AXFormCloseQuery = False
ElseIf pklReason.text="" Then
MsgBox "Reason is a required field."
AXFormCloseQuery = False
Else
If txtMode.Text="Account" Then
If pklReason.text="Signed Lease" Then
SaveLeaseSigned
Else
SaveOther
End IF
End If

InsertNote
AXFormCloseQuery = True
Application.BasicFunctions.RefreshMainView
End If
End Function

[Reply][Quote]
Michael Fortier
Posts: 12
 
Re: Using "X" doesn't invoke AXFormCloseQuery(Sender)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Oct 07 10:25 AM
I'm trying this on a DATA form, as opposed to a MANAGE form
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Using "X" doesn't invoke AXFormCloseQuery(Sender)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Oct 07 11:37 AM
Hi Michael,

I tested with both a data form and a manage form and both worked for me. Are you saying that when you click the X you don't even get the Test MsgBox?

I tested with v6.2.6 - what version of 6.2 are you on?
[Reply][Quote]
Michael Fortier
Posts: 12
 
Re: Using "X" doesn't invoke AXFormCloseQuery(Sender)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Oct 07 1:04 PM
Yeah, I'm on 6.2.6 as well.

Yes, I don't even get the Test MsgBox when I click the X.

How are you creating the form? Maybe that's the difference.

I'm using:

Set objMainView = Application.MainViews.Add("System:JUNKTEST", 0, False)
objMainView.ShowModal
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Using "X" doesn't invoke AXFormCloseQuery(Sender)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Oct 07 9:31 PM
Well, that would have to be the difference. In my tests I was launching the form using DoInvoke, not launching it as a MainView. My guess is that yours will work as well if you are able to load it using DoInvoke.
[Reply][Quote]
Michael Fortier
Posts: 12
 
Re: Using "X" doesn't invoke AXFormCloseQuery(Sender)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Oct 07 7:39 AM
Ryan, thanks again for helping me out.

Launching the form as a MainView does indeed disable the OnCloseQuery functionality. I changed the code to use ShowViewForRecordEx and the problem is solved.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Using "X" doesn't invoke AXFormCloseQuery(Sender)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Oct 07 9:10 AM
Glad it got solved!

-Ryan
[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): 6/20/2025 11:12:12 PM