Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Stuck-Set Variable from extenal file & next


cc4digital
 Share

Recommended Posts

This has me stumped. I have 1 database. Each one has 2 table.

Table A & Table B

 

Script is running from Table A

 

 

What I want is to Set Variable $Chuck from table B. Then I am going to compare Table A field to the variable $Chuck

 

Problem: Set Variable is not reading form Table B.

 

Why won't set variable read from another Table?

 

2nd Question is how do I advance Table B record so the variable will change?

 

Thanks for your help

chuck

 

ps. I did set $chuck to $$chuck and it did not make a difference.

I know my variable is not being filled because I can see it in the Script Debug Data Window.

Link to comment
Share on other sites

Why won't set variable read from another Table?

 

They just didn't do it that way. Variables are "per the file". In File B, a variable you set from within File A does not exist. You aren't doing something wrong procedurally, they just don't persist from file to file.

 

What one usually does is this:

 

in file B, a script named "My Subscript":

 

Do This

Do That

Do This Other Thing

Exit Script [with Result: "What you would have put in a variable"]

 

 

in file A, call it like so and get the answer back like so:

 

Do This

Do That

Perform Script [in File B, My Subscript]

Set Variable [$Variable; Get(ScriptResult)]

Link to comment
Share on other sites

Ah, I have one hair left. I couldn't figure that out for the life of me. Ok let me try calling a script from a different table and putting that in a variable.

I would guess I need to set the variable to global $$?

 

Chuck

Link to comment
Share on other sites

No, you aren't following.

 

You DO NOT SET A VARIABLE in the external file. In File B, no variable that you set can be "seen" from File A, not even if it is a global $$Variable. Those are only useful as long as you stay in File B. To transfer the value to File A, you must use another technique.

 

 

You exit the script in File B with a script result.

 

In File A, the file that actually need to USE that value, you obtain it from the external file by using Get(ScriptResult).

Link to comment
Share on other sites

 Share



×
×
  • Create New...

Important Information

Terms of Use