execute script include from action script on flow designer

Dana Israeli
Giga Guru

hey there,

i have a Flow and on that flow i am running an action.

the action as inputs, script, outputs.

on the script i want to call script include and get answer

my code is - it looks like the script include not getting like this: global.TranzillaUtil(); and because of that i am thinking its not executing. help??

(function execute(inputs, outputs) {
          //call scriptinclude
        var SI = new global.TranzillaUtil();
        var result = SI.CreditChargeByInvoice(inputs.card_id,inputs.account_id,inputs.invoice_total_amount);
 
  outputs.responsecode = result;
 
})(inputs, outputs);

6 REPLIES 6

MrMuhammad
Giga Sage

If the Script include include and Flow designer are in different scopes then it should have worked this way. If the scope is same then call SI with global

var SI = new TranzillaUtil();
var result = SI.CreditChargeByInvoice(inputs.card_id,inputs.account_id,inputs.invoice_total_amount);

 

Also, try placing some logs in the beginning of SI so that we can make sure whether or not SI is being called. 

 

Thanks & Regards,

Sharjeel

Regards,
Muhammad

they are on the same scopes and it is not working with or without global

Try placing some logs in the SI method "CreditChargeByInvoice()" as

gs.info("@@ - Inside SI");

 

As they have same scope so remove global keyword as well. Try now and go to System Logs > System Log > All and in the message field check if "@@ - Inside SI " is printed or not.

Regards,
Muhammad

David Wilhelm
Kilo Contributor

I can't get this to work either. My script include is global and my action is global. Just to see if this would work I'm setting the variables in the code. This works in background script, but not from my flow designer action script. The log does display the variables so I know it is running the flow action. No errors in the log.

var user = 'fbf84f09db244418543280c74b961943';
var group = '91a8b755db357e0002be7749af961953';
var action = 'Add';
var setDefault = 'true';

gs.info('floopy: ' + user + ', ' + group + ', ' + action + ', ' + setDefault);
  
var snAccess = new SNAccessRequestUtil();
var updateGroupMembership = snAccess.updateGroup(user, action, group, setDefault);