Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3637 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi there - Miss A! here, i need your help please.....

 

 

I wonder if this is possible - ok, i have a script in which i am using set field step to define a field on another layout, this field is set to use values from defined value list but i would like to set a value for it using script and without changing the fields data entry definition(that is without disabling use of value list) - see in script below for the lines with red font:

 

 

Approve Order
Set Variable [ $$Order; Value:Pack Safari Order::__ID_Order_PS_Number ]
Set Variable [ $$Token; Value:Pack Safari Order::lxt_Token_Company ]
Set Variable [ $$Account; Value:Pack Safari Order::lxt_LedgerAccount ]
Set Variable [ $$Description; Value:Pack Safari Order::lxt_Text_Order ]
Perform Find [ Specified Find Requests: Find Records; Criteria: Pack Safari Order::__ID_Order_PS_Number: “$$Order” ] [ Restore ]
Go to Layout [ “Order Pack Safari Print” (Pack Safari Order) ]
Set Variable [ $Signature; Value:Get ( AccountName ) ]
Set Field [ Pack Safari Order::lxt_Signature_Approved; $Signature ] Set Field [ Pack Safari Order::lxt_Approved_chk; 1 ]
Send Mail [ Send via E-mail Client; Subject: "Order Pack Safari ->" & Pack Safari Order::lxt_Token_Company; Message: "Dear Gloria," & ¶&¶&"Order Number " & Pack Safari Order::__ID_Order_PS_Number &" has been approved." & ¶&¶ & "Regards" &¶& Get(AccountName) ]
Go to Layout [ “Pack Safari Remittance New” (Pack Safari Remittance) ] // Set Error Capture [ On ]
// Enter Browse Mode
New Record/Request
// Set Variable [ $OrderRemittance; Value:Pack Safari Order::__ID_Order_PS_Number ] Set Field [ Pack Safari Remittance::__fkID_PS_Order_Number; $$Order ]
Set Field [ Pack Safari Remittance::Kürzel; $$Token ]
Set Field [ Pack Safari Remittance::Ledger_Accounts; $$Accounts ]
Set Field [ Pack Safari Remittance::Reference:; $$Description ]

Commit Records/Requests
[ Skip data entry validation; No dialog ]
Go to Layout [ “Order Pack Safari” (Pack Safari Order) ]

 

 

Evaluations to better this script also welcomed - thank you very much!!!

Posted

Is this script not working?  Possible problem, but could only be a typo...your Set Variable is $$Account, and your Set Field is $$Accounts.

  • Like 1
Posted

Evaluations to better this script also welcomed

 

Is there a reason to use global $$variables?

 

[…]

Set Field [ Pack Safari Remittance::Kürzel; $$Token ]

[…]

 

You don't happen to speak German?  :laugh:

Posted

Ohh really good eye Steve, thank you zoo much......

 

 

Is there a reason to use global $$variables?

Eos, i am not understanding myself well on the variable topic, i only switched my option for what is working - I began with local variables at first and it did not work, thetas when switched to global.......

 

 

You don't happen to speak German?  :laugh:

Ohh, i am working for Germans, I do not speak it yet.....

  • 1 month later...
Posted

Hi Miss A!,

 

Using global variables

$$example

means that they stay available in the background ready for use by another script. Which is great if you are about to call another script, but not so great if - you're not.

As then they will sit around in your database until you quit your current session - or you clear them at the end of your script.

 

Whereas, using local variables 

$example

will clear automatically at the end of the execution of the current script.

 

HTH

Posted

Thank you fm_toxy,

 

 

Using global variables

$$example

Which is great if you are about to call another script, but not so great if - you're not.

By calling another script you mean you have not yet exited that session in which global variables are declared(other words, you are referencing global variables from a subscript) or can i call them from a separate script which is outside of the context in which global variables have been declared?

-More help will help, Thanx a lot.

 

This topic is 3637 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.