Forum Discussion

jh's avatar
jh
Ideator I
2 months ago

setAction and apply does not work

this is my code 

cjitem.setAction("delete");

cjitem.apply();

runing the code  it does not work,but I click Checking syntax button showing: Warning Number: IA1100, The output value of Item.apply() method is unused.

can anyone help me? thanks

1 Reply

  • cjitem.setAction("delete"); 

    sets the action on the object.

    cjitem.apply();

    does not mutate the state of the object, instead it returns a new object.

    You need to do:

    var newItem = cjitem.apply();

    the return value will be the result of your above action.

    You can then check the return value for errors or do some business logic.