- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Customizer - Code works in 7.3 but not 7.2
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
06-16-2010 07:22 AM
I am trying to get the following customizer script in Maintain GL Accounts that works in 7.3 to work in 7.2, but it is not. The message pops up, but the field is not properly enabled and the focus is not set. An alternative would be for the entire form to be cleared after the popup message.
Sub Form_New
dim seg1val, seg2val
msg = Form.Controls("glaGLAcct").text
seg1val = Form.Controls("glaGLAcct").text
seg2val = mid(Form.Controls("glaGLAcct").text,6,4)
Set MyDatabase = Session.AppDatabase
if left(seg1val,1) < 5 and seg2val <> "0000" then
msgbox "GL account is invalid! Department must be '0000'."
Mydatabase.Cancel
Form.Controls("glaglacct").enabled=true
Form.Controls("glaGLAcct").setfocus '**** NOT WORKING
elseif seg1val > 4 and seg2val = "0000" then
msgbox "GL account is invalid! Deparment can't be '0000'."
Mydatabase.Cancel
Form.Controls("glaglacct").enabled=true
Form.Controls("glaGLAcct").setfocus '**** NOT WORKING
end if
end sub
ISM - Director, MAS 500
jeb@goism.com
Re: Customizer - Code works in 7.3 but not 7.2
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-16-2010 04:14 PM
The "Mydatabase.Cancel" calls concern me. What prompted you to use that method? That's a pretty low-level operation, and I'll bet it wasn't intended for use in Customizer.
I assume you want to cancel the creation of the new GL account when the account number is not valid. Why not programmatically click the "Cancel" toolbar button instead of manipulating the ODBC operation:
Form.Controls(0).Parent.HandleToolbarClick "K7"
You shouldn't need to enable the lookup or set the focus if you do this. The cancel button will do that for you.
Technology Consultant
SGS Technology Group
http://www.sgstech.com


