October 29, 201411 yr 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!!!
October 29, 201411 yr Is this script not working? Possible problem, but could only be a typo...your Set Variable is $$Account, and your Set Field is $$Accounts.
October 29, 201411 yr I do not have time to review the script in depth but that was certainly a keen eye, Steve - nice catch!
October 29, 201411 yr 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?
October 30, 201411 yr Author 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? Ohh, i am working for Germans, I do not speak it yet.....
December 5, 201411 yr 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
December 8, 201411 yr Author 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.
Create an account or sign in to comment