Hello,
Hope someone can help me, as I am not sure what is going wrong on what is a simple thing.
I have a form (PR) that has a Boolean tick box (trl_on_hold) that is set as disabled on the form (so it can be seen but not changed by the users)
I am trying to create a method to tick the box when the method runs. It will run as part of a workflow task (i.e. on vote it will tick the box). I have it created as a server-side method
I have tried all the below but all give me errors . I'm new to development on ARAS. Can anyone see what I have done wrong, or point me in the right direction. I know in regular c# you can change the value with onhold = !onhold.
Try 1
bool holder = true;
this.getProperty("trl_on_hold", "");
this.setProperty("trl_on_hold", holder);
return this;
Try 2
Item pr = this.newItem("PR","edit");
pr.setProperty("trl_on_hold","1");
pr = pr.apply();
return pr;
Try 3
Item pr = this.newItem("PR","edit");
pr.setPropertyAttribute("trl_on_hold","is_null","1");
pr = pr.apply();
return pr;
Thanks in advance
Try 1 : won't work because what you actually want to do is just change the boolean value ("0" or "1")
Try 2 : you need to provide the PR id to edit it.
Item pr = this.newItem(“PR”,”edit”);
pr.setID("0830480384038403804");
pr.setProperty(“trl_on_hold”,”1″);
pr = pr.apply();
Try 3: not sure what you try to do, but doesn't seem like the way to go.
regarding the return, it depends the context you are running in.
Try 1 : won't work because what you actually want to do is just change the boolean value ("0" or "1")
Try 2 : you need to provide the PR id to edit it.
Item pr = this.newItem(“PR”,”edit”);
pr.setID("0830480384038403804");
pr.setProperty(“trl_on_hold”,”1″);
pr = pr.apply();
Try 3: not sure what you try to do, but doesn't seem like the way to go.
regarding the return, it depends the context you are running in.