Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, August 18, 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: Question
NebSeb
Posts: 49
 
QuestionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Jan 08 3:50 PM
Having trouble with the following function, says there is a problem near my End With...
Any Ideas?

Thank You,


Sub PopulateEmp(Sender)
Dim strQ
Dim strC
Dim oShell
Dim tUserID
Dim tAccountID
Dim tCreateUser
Dim tModifyUser

tUserID = application.basicfunctions.CurrentUserID
tAccountID = frmAccountDetail.CurrentID
tCreateUser = application.basicfunctions.CurrentUserID
tModifyUser = application.basicfunctions.CurrentUserID

Set rs = CreateObject("ADODB.Recordset")
With rs
Set .ActiveConnection = Application.GetNewConnection
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Open "select * from EMPLOYEE where ACCOUNTID = '" & tAccountID & "'"

If .RecordCount = 1 Then
tbxEmployeeTotal.Text = .Fields("EMPLOYEETOTAL").Value
Else IF .RecordCount = 0 Then
tbxEmployeeTotal.Text = ""
End If

.Close
End With
Set rs = Nothing

End Sub
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: QuestionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Jan 08 4:00 PM
In VBScript, "Else If" is one word, as in "ElseIf". That is your problem.

Change this:

If .RecordCount = 1 Then
tbxEmployeeTotal.Text = .Fields("EMPLOYEETOTAL").Value
Else IF .RecordCount = 0 Then
tbxEmployeeTotal.Text = ""
End If


to this:

If .RecordCount = 1 Then
tbxEmployeeTotal.Text = .Fields("EMPLOYEETOTAL").Value
ElseIf .RecordCount = 0 Then
tbxEmployeeTotal.Text = ""
End If


-Ryan
[Reply][Quote]
NebSeb
Posts: 49
 
Re: QuestionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Jan 08 4:11 PM
DOH!!! Now I feel a little like a dull tool in a shed.

Thank you for the answer.
[Reply][Quote]
NebSeb
Posts: 49
 
Re: QuestionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Jan 08 4:14 PM
Here is another question, How would I lock down certain parts of a form so only certain people can change the values of those fields?
[Reply][Quote]
Matt Dockins
Posts: 159
 
Re: QuestionYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Jan 08 12:19 AM
Use field level security through the Admin tool.

If it is a form based on a one to many table or does not have field level security enabled on the base table you can build a permissions control panel (or simply place a flag of some kind in the custom user text fields in admin - these are stored in userprofile) and then set the control's enabled property to false if they don't have permission.

For appearance's sake, if you have the option of grouping the controls together, you can set them on a panel and set that panel's readonly property (IIRC - may be the enabled property) to true/false (depending on if it is readonly or enabled), which will then make any controls on the panel follow that model WITHOUT making the text of certain controls appear grayed out (like setting enabled=false on edit and picklist controls does)
[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/18/2025 10:57:04 AM