I am trying to pass an argument from process workflow to Set Transaction Status.
Here, out_so_num is my argument which I am assigning to variable so_num.
In set Transaction status ,
I am assigning this so_num variable to argument in_so_num. However, in Set Transaction status its throwing Null. Where is the error happening? Because the so_num variable is not Null in Process Transaction .also the argument out_so_num in Process Transaction is not Null. However, when assigning in Set Transaction value its showing Null
Process Transaction:
You passed the arguments correctly, but you may encounter issues when trying to pass the value of So_Num. It’s not possible to carry this value using arguments to the Set Transaction Status if an exception occurs in the Process Transaction. The value can only be passed from Process Transaction to Set Transaction Status if no exception occurs.
Check if you passed the arguments correctly and there is no other variable with the same name already exist in the Set Transaction. If there is a variable with same name as the argument, variable gets the priority and it would be empty.
Got it. In case I want to pass the value whenever there is exception, how can we do it? Is that possible to capture that value in Set Transaction Status?
Use try catch in Process.xaml
Declare a out argument for exception along with your other arguments
Any exception in Process just assign that to the out exception variable in Catch section.
This way Process will not throw that exception and will finish the execution peacefully.
Now in Process transaction state from where Process.xaml was invoked, below that use one assign activity and get your out_so_num loaded into desired variable to be passed to set transaction status.
After this assignment, check if there was any exception and if there was in Process, use throw activity to throw that exception else let it flow.
But I want it should throw exception if there is any . For example , if there is already SalesOrder created ,it should throw business exception that SalesOrder is already created. I need to capture those exceptions also