ChristofferRexen_1

Parsing Parameters in WebDirect, different result

Discussion created by ChristofferRexen_1 on Jan 19, 2017

Hello everyone,

 

So parsing parameters into WebDirect, but getting a somewhat dull result.

 

Setup

Accounts Table managing all WebDirect clients, with Username, Password and UUID.

 

URL

http://Server_IP_Address/fmi/webd#DatabaseName?script=ScriptName (OnFirstWindowOpen) &Parameter=XYZ (UUID)

 

Script

 

Set Error Capture [On]

Allow User Abort [Off]

 

Variable [$error ; Get ( Lasterror ) ]

Variable [$$UUID ; GetValue ( Get ( ScriptParameter ) ; 1 ) ]

Go to Layout [ "_Accounts" ]

Enter Find Mode

Set Field [ _Accounts::UUID ; $$UUID ]

Perform Find

 

If [ Get ( FoundCount ) ]

Set Field [ Global::AccountName ; _Accounts::UserAccountName ]

Set Field [ Global::AccountPassword ; _Accounts::UserPassword ]

Re-Login [ AccName = Global::AccountName ; Password = Global::AccountPassword ; With Dialog: Off ]

 

Go to Layout [ Certificate ]

Enter Find Mode

Set Field [ Certificate::UUID ; $$UUID ]

Perform Find

Go to Record [ Last ]

 

Exit Script

Else

 

//Error nothing found

Exit Script

End If

 

Exit Script

 

Now for starters, I know this isn't the most secure solution, although the customer did not bother.

 

Now with the script, I can try parse a different $$UUID, but be getting the same result - like landing on the same Certificate, even tho I have parsed another $$UUID.

 

Furthermore when trying to Re-Login, this does happen - but FM always seem to be getting the first record ever created in the "_Accounts" table.

 

I seems like WebDirect isn't collecting the Parameter in the URL...

 

What am I doing wrong?

Please let me know, if you need further from me.

 

Regards

Outcomes