Scripting UI Lib example

Hi guys

 

I have made a couple of projects using the example provided by tony here:

https://community.superoffice.com/en/content/resources/web-client-resources/interactive-netserver-scripts/

 

And it works great

 

However, one of the customers running the solution on 8.5 R5 is experiencing that the Popup message pops up at another user instead of the user triggering the action.

 

I would expect that the task added to the batch task manager queue are for the specicific associate that triggered the action only, and not a "global" queue that just executes for the first associate in the right context. Is that something you have experienced before?

 

I don't really know if there's any better way of explaining it, but let me know if something is not explained clear enough :)

thanks

RE: Scripting UI Lib example

HI Dennis, 

Here's an interesting example that showcase samples are not production ready...

In the ScriptUIDataHandler, the code to get batch tasks is doesn't take into account an associateID.

BatchTaskInfo[] btis = ba.GetBatchTaskInfosByNameAndState(
    ScriptingUILib.BatchTasks.ScriptsBatchTaskPlugin.Name,
    SuperOffice.Data.BatchTaskState.Unknown);

You have a couple options....

Change that to use GetBatchTaskInfosByNameAndAssociates, but then you will need to check the BatchTaskState and only add ones that are Unknown.

BatchTaskInfo[] btis = ba.GetBatchTaskInfosByNameAndAssociates(
    ScriptingUILib.BatchTasks.ScriptsBatchTaskPlugin.Name,
    new int[] { SuperOffice.SoContext.CurrentPrincipal.AssociateId });

Alternatively, use the GetBatchTaskInfosByAssociatesAndState and only add the ones where the name equals the ScriptsBatchTaskPlugin.Name.

BatchTaskInfo[] btis = ba.GetBatchTaskInfosByAssociatesAndState(
    new int[] { SuperOffice.SoContext.CurrentPrincipal.AssociateId },
    SuperOffice.Data.BatchTaskState.Unknown);

 

Hope this helps!

Av: Tony Yates 14. nov 2019

RE: Scripting UI Lib example

Hi Tony, that really helped me out, there's a nother strange thing though that i experience, and that is the background task spinner not disappearing after the task is over:

It does not seem to have impact on performance, or the job it actually performed - it just takes a looooong time to disappear. 

Any ideas?

Av: Dennis Aagaard Mortensgaard 1. apr 2020