Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Unchecking keep result filed in a workflow through javascript

mohammada451459
Level 2
Level 2

Hi ,

I am trying to create a workflow which will be requiring to uncheck the "keep interim result" check box. I can always go to the workflow and can do it because surely that is not the best practice.

But what I am trying to achive is to uncheck that box by changing the value of @keepresult  in xtk:workflow schema from YES to NO , how exaclt I can achive that through javascript ?

Thanks

Arif

3 Replies
Amit_Kumar
Community Advisor
Community Advisor

Hi Arif,

Write something like this.

var keepResultIn = 0;

var iWorkflowId = instance.id; // update this is to get all ids if you want to do a bulk, this code will work for current workflow

if(instance.keepResult) {

xtk.session.Write(<workflow xtkschema="xtk:workflow" _operation="update" id={iWorkflowId} keepResult={keepResultIn}/>);

}

Regards,

Amit

mohammada451459
Level 2
Level 2

Hi Amit,

Thanks! for the help, it's quite useful . You are a superhero .    : )

drissd66472167
Level 1
Level 1

Hi Amit,

I replace

var keepResultIn = 0; by var keepResultIn = '';

And all objetcs of my workflow were disappear

How to correct the problem.

Thanks