19
Views
5
Comments
Solved
Possible Bug – Outputs from C# Extension Are Empty When Called in Reactive Modules

Hello, everyone!

I was trying to debug an extension in a reactive sandbox application when I noticed something odd.

For some reason, the outputs of the action were always empty. At first, I thought it was a problem with my code, but after a while I realized that was not the case.

So I decided to do a very simple test. I created a simple action:



And when I called it in a Reactive Module, the outputs came empty:


But when checking logs in Service Center, the variables were populated with the correct values:After a while, I realized that if I called the action through a Service Module, the results would come as expected:


So, in conclusion, when a C# extension action is called directly from a Reactive Web module, the output parameters are always empty.

However, when the same extension action is wrapped in a Service Module and then called from the Reactive module, the outputs are correctly returned.

This behavior suggests there may be an issue in how Reactive modules handle direct calls to extension actions.

Has anyone experienced similar behavior? Is this a known limitation or a potential platform bug?

Best Regards.

2021-10-09 07-57-44
Stefan Weber
 
MVP
Solution

Calling server actions and service actions from a client action have a different behaviour. Server action results are evaluted only when you use a result on the screen. See e.g. the post from Siya. The result gets evaluated here because he is using a feedback message right after the server action call and that is why the action is called. In your screenshot the server action is part of the client action flow, but it is never evaluated as you do not make use of any of the results.

 If you wrap the server action into a service action, than everything runs of the backend the action gets evaluated and the results are returned by the service action.

Stefan

2016-04-22 00-29-45
Nuno Reis
 
MVP

That seems very strange.

Because you mentioned sandbox, are you sure you used the outputs in your code? Wasn't the usual debug optimization ignoring all unused values?


2019-01-07 16-04-16
Siya
 
MVP

@Bernardo Batista : I have tested the same scenario and I don't see an issue.

The reason you see default values is due to the reason mentioned by @Nuno Reis - Its ignoring all unused values.  Here is another screenshot demonstrating this - Here the output of ActionS is not used anywhere and you can see the result.

I hope this clarifies. This behavior is intentional and not a bug.

2021-10-09 07-57-44
Stefan Weber
 
MVP
Solution

Calling server actions and service actions from a client action have a different behaviour. Server action results are evaluted only when you use a result on the screen. See e.g. the post from Siya. The result gets evaluated here because he is using a feedback message right after the server action call and that is why the action is called. In your screenshot the server action is part of the client action flow, but it is never evaluated as you do not make use of any of the results.

 If you wrap the server action into a service action, than everything runs of the backend the action gets evaluated and the results are returned by the service action.

Stefan

2024-07-12 05-57-50
Gourav Shrivastava
Champion

Hello @Bernardo Batista ,

I suggest you create a new console project and add refrence of your actual project, then call your action from the console application and run the console application (with debugging mode on). so that you can debug in real time and know what is happening behind.


2019-01-07 16-04-16
Siya
 
MVP

@Gourav Shrivastava : There is no issue at all. The reason @Bernardo Batista did not see the output is that the output from his action was not used and, as part of the optimization process, it was therefore not evaluated. Please refer to the comments from @Nuno Reis and @Stefan Weber .

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.