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: Code worked under 6.2.6 but not 7.2
Marc Johnson
Posts: 252
 
Code worked under 6.2.6 but not 7.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 May 08 3:15 PM
Not sure why this isn't working:

sub FormSecurity
dim formNotePad
dim formTasks
dim strUSER, bolADMIN

strUSER = application.BasicFunctions.CurrentUserID
If strUSER = "ADMIN" or strUSER = "U6UJ9A00002H" or strUSER = lveImpRep.LookupID then
bolADMIN = TRUE
else
bolADMIN = FALSE
End IF

Set formTasks = Application.Forms.Item("Implementation:Tasks")
Set formNotePad = Application.Forms.Item("Implementation:NotePad")

if bolADMIN = FALSE then
LockFields
pklStatus.ReadOnly = TRUE
formTasks.grdImpProcess.ENABLED = FALSE
formNotePad.btnAddNote.Enabled = FALSE
formNotePad.mmoEnterNotes.ReadOnly = TRUE
else
UnlockFields
pklStatus.ReadOnly = FALSE
formTasks.grdImpProcess.ENABLED = TRUE
formNotePad.btnAddNote.Enabled = TRUE
formNotePad.mmoEnterNotes.ReadOnly = FALSE
end if

Set formTasks = Nothing
Set formNotePad = Nothing
End Sub

================

The form fails at: formNotePad.btnAddNote.Enabled = FALSE/TRUE (fails the same if ADMIN or not)
I've confirmed that the button is indeed named this. The error is: "Object required".
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Code worked under 6.2.6 but not 7.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 May 08 3:34 PM
Sounds like it isn't finding the form, so you're ending up with a null reference (which causes the error when you try to use it). Could that be the case, that the form isn't loaded yet?
[Reply][Quote]
Marc Johnson
Posts: 252
 
Re: Code worked under 6.2.6 but not 7.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 May 08 3:45 PM
The subroutine is called on the detail form OnChange event. I could recreate the code for each tab form but it seems like that would be a bit backwards after being able to do this in 6.2.x

You can see the forms in the tab view, so it's not like they aren't released and I've checked and double checked the form names.
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: Code worked under 6.2.6 but not 7.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 May 08 6:16 PM
Suggest that you go into debug and verify that the object is there. Should help you trace the problems.

Phil
[Reply][Quote]
Marc Johnson
Posts: 252
 
Re: Code worked under 6.2.6 but not 7.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 May 08 11:03 AM
Ahhh...and there is the rub. I don't have a debugger with a watch window.
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: Code worked under 6.2.6 but not 7.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 May 08 6:46 PM
So not running SQL Server 2005 or Visual Studio? I probably don't need to tell you how much easier your life would become if you could get hold of one of these.

MS Script debugger does not have a watch window as such, but you can still use it to inspect the contents of single-valued variables (I haven't managed to inspect objects with it) using the Command window.

Phil
[Reply][Quote]
Marc Johnson
Posts: 252
 
Re: Code worked under 6.2.6 but not 7.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 May 08 7:21 AM
Phil,

Nope, no SQL 2005. We are running our database on Oracle. I've requested Visual Studio, but that might take awhile.

What command would you use in the MS Script Debugger?
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: Code worked under 6.2.6 but not 7.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 May 08 7:25 AM
If your variable is called x, type

?x in the command window

hit [return] and the value in x will be echoed back to you.
[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 6:03:15 PM