Scripting UI Lib example

Hi guys


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


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 :)


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(

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(
    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 },


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 Mortensgaard 1. apr 2020

RE: Scripting UI Lib example

I'm still having this problem with the spinner sitting there forever - so does anybody have a clue?


Until now, the only thing i was able to do was to clear the batchtask table manually...

Av: Dennis Mortensgaard 30. nov 2020

RE: Scripting UI Lib example

Hi Dennis,

Have you set the RunTasksInProcess to True?

Best regards.

Av: Tony Yates 1. des 2020