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!
|
|
legacy globals?
Posted: 07 Feb 08 9:08 AM
|
I am converting a lagacy form (basic) to an active form(VBScript). There are sevral cases where there is a referance to an object that I dont see as defined. For example here is the Open event. I see no definition of btnCommit. The lagacy is commented out above the VBScript.
Sub AXFormOpen(Sender) 'Application.BasicFunctions.DoInvoke "Basic", "Personal:IsManager" 'sub main ' 'SelectStatement = "Select ISMANAGER from USERSECURITY where USERID = " & "'" & CurrentUserID & "'" ' 'Hand = DBOpenSQL(SelectStatement,True) 'IsManager = DBGetValue(Hand,"ISMANAGER") ' 'If IsManager <> "T" then ' SetPropertyOf "btnCommit","Enabled", "False" 'Else ' SetPropertyOf "btnCommit","Enabled", "True" 'End if ' 'end sub
Dim slxCN Dim slxRS Dim IsManager
Set slxCN = Application.GetNewConnection
Set slxRS = slxCN.Execute("Select ISMANAGER from USERSECURITY where USERID = " & "'" & Application.BasicFunctions.CurrentUserID & "'")
IsManager = slxRS.Fields("ISMANAGER").Value
slxRS.Close
If IsManager <> "T" then btnCommit.Enabled = False '??? Else btnCommit.Enabled = False End if
End Sub -------------------------------------------
I have DevLogix7 and am currently half way through the book. Thanks in advance. |
|
|
|
Re: legacy globals?
Posted: 07 Feb 08 9:20 AM
|
"btnCommit" will be the name of a control on the legacy form that this script is launched from. Is this what you're looking for or an I misunderstanding the question? |
|
|
|
Re: legacy globals?
Posted: 07 Feb 08 1:21 PM
|
I cant find anythig named that on the lagacy form. There are several controlls on the lagacy form but none of them have that name and the lagacy form works with no errors in the slx5 environment. Another instance of this on the same form looks like this.
Original_Percent=cdbl(GetPropertyOf("OriginalCloseProbability","Text")) OriginalColseProbability does not exist on the lagacy form.
I am wondering if in the lagacy code you did not have to fully qualify the path to other forms that are open but now you have to use the full path. ex Parent.form.control ?
Even if that is the case I dont see these names anywhere. |
|
|
|
Re: legacy globals?
Posted: 07 Feb 08 11:30 PM
|
If you are dealing with a custom form, check behind other controls on the form for the controls that you believe are missing. Some business partners I've dealt with in the past like to hide their controls that a user never actually touches behind other controls or in a panel - which is then shrunk to approximately a 2x2 pixel size. You might look for something like pnlHidden.
you could also put a msgbox in the code (no debugging on the legacy stuff unfortunately) and see if the variable Original_Percent actually is getting initialized - it may be something that was deprecated from an earlier design or something.
You did not have to fully qualify the control path in legacy stuff, but I'm fairly certain that the code only "knows" the controls of the form it was called from. |
|
|
|
Re: legacy globals?
Posted: 08 Feb 08 9:02 AM
|
I checked all the items on the form with the properties dropdown and did not see this. This event is triggered by a picklist. Is it possable these are properites of a picklist that would now be accessed by sender.xxx? I will research how to cast and access the sender properties. Thanks for the input. |
|
|
|