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: CheckBox OnClick event runs on refresh
Kevin Austin
Posts: 105
 
CheckBox OnClick event runs on refreshYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Jan 07 5:20 AM
fiogf49gjkf0d
Hi, I have a checkbox on the main account screen and basically when it's ticked I want it to write out to a table (similar to history) saying the current state of the checkbox with the time/date so I have a clear history of when the checkbox was ticked and unticked. This is all well and good but... when the account screen is refreshed it appears to be running the onclick event and in turn writing out information when the checkbox has not been ticked/unticked.

Is there any work around for this? A away of determining the difference between a click on the checkbox and a refresh etc?

All help appreciated, Kev
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: CheckBox OnClick event runs on refreshYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Jan 07 10:19 AM
fiogf49gjkf0d
In 6.2.3 there were some new form properties added for just this sort of thing that allowed you to see what "state" the form was in.

In 6.2.3 there were some new form properties added so you can now monitor what is happening at the time the event occurs.

IsReading - means the data binding system is currently "active"
IsValidating - validate event is currently being evaluated/run
IsWriting - data is being saved to the DB
Modified - an edit has been made to the value of a data bound control

So, if you want to be sure that the click event was triggered by the user clicking the checkbox, and not that the event is just being raised it being set by the binding engine, then you could just do this:

Sub checkbox1Click(Sender)
If Not IsReading
' do something here
MsgBox "The user clicked the checkbox. I can do whatever here"
Else
MsgBox "The checkbox was set via data binding. I won't do anything here"
End If
End Sub


This exact scenario is why these form properties were added in SP3.
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: CheckBox OnClick event runs on refreshYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Jan 07 12:53 AM
fiogf49gjkf0d
Even easier is to use the OnMouseUp event.....only fires on a mouse click release

Sub chkNotInterestedMouseUp(Sender, Button, X, Y)
IF chkNotInterested.Text = "T" THEN
dteNotInterested.DateTime = NOW()
END IF
End Sub

RJ Samp
[Reply][Quote]
Kevin Austin
Posts: 105
 
Re: CheckBox OnClick event runs on refreshYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Jan 07 4:12 AM
fiogf49gjkf0d
Thanks Ryan, Works a treat.. In response to the OnMouseUp event, I don't think there is one for checkboxes within SalesLogix forms or am I mistaken?
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: CheckBox OnClick event runs on refreshYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Jan 07 2:42 AM
fiogf49gjkf0d
Yes there is....
We use the MouseUp event exclusively for bound checkbox (user) events
--
rjl
[Reply][Quote]
Kevin Austin
Posts: 105
 
Re: CheckBox OnClick event runs on refreshYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Jan 07 8:44 AM
fiogf49gjkf0d
How on earth did I miss that event in properties... my eyes aren't what they used to be!
[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:53:04 AM