add_change_order

Document created by Gutis Champion on Dec 9, 2015Last modified by Gutis Champion on Feb 27, 2016
Version 2Show Document
  • View in full screen mode

SPEL API methods

add_change_order

 

This method allows to create new change order by using template or from the scratch. It also allows to populate properties if they are defined for the category

 

Definition:

add_change_order( uuid, string, string, int, ... ) ;

uuid - user id

string - id of the change template (optional)

string - created_via persistent_id defines creation interface.

int - number of properties values that will be passed to method (0 - no properties values)

... - if number of properties values >0, values of the properties shall be passed first and then name-value pairs for the attributes to update "atribute1", "value1","atribute2", "value2"

 

working examples"

1. Without properties

uuid who;
send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");
who=msg[0];
send_wait(0, top_object(), "call_attr", "api", "add_change_order", who, "3274", "intfc:3553", 0, "requestor", who, "category","chgcat:6100");
if (msg_error()) {
  logf(ERROR, "get_failed %s",msg[0]);
}
   

2. With properties, but this time without template

uuid who;
send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");
who=msg[0];
send_wait(0, top_object(), "call_attr", "api", "add_change_order", who, "", "intfc:3553", 1, "change property", "requestor", who, "category","chgcat:6100");
if (msg_error()) {
  logf(ERROR, "get_failed %s",msg[0]);
}
   
1 person found this helpful

Attachments

    Outcomes