This article will cover using the "Add Field" button to add the return code as a value for a parameter when you call a script from a Control Point in Infogix Assure. To learn how to call scripts and add parameters, please see these articles:
This method can only be done when calling a script in the Validation tab. Please see the above articles for more information.
Returning the return code is a special use case because in order to obtain the "return code", you need to set the return code value to a field during validation. First off, you need to add a field called "return code" that will store the return code. During validation, you then set it depending on whether validation passes or fails. If you created an action for that validation to run a script in the same control point that you set the value of the return code field, you'll find that you can add the "return code" field as a value, but it won't actually be added. In the logs, you'll see that the value comes up blank.
In order to actually pass the return code, you need to capture the control data that's generated after the Control Point runs. If you're using a Summary Control Entity, you can simply create another Balance control point that captures control data on the 0th run (basically, the run that just happened) and then in that control point's validation, create an action to run the script with the return code field as a value. If you're using a Detail Control Entity, you'll need to create a Scan Control Point to grab that control data.
While this article is primarily aimed at passing a return code to a script, this process can be used for any field that you want to pass to a script that is being set in validation instead of being captured.