CA Service Management

insert_object 

Dec 09, 2015 03:44 PM

SPEL API methods

insert_object

This method allows to create object and define multiple attributes. You should not use this method to create objects that contains reference numbers (cr,chg,iss) since this method will not generate them automaticaly.

 

Definition:

insert_object( uuid, string, object|nil, int, ... ) ;

uuid - user id

string - factory name

object|nil - NULL (do not know what kind of object should be passed and for what purpose it is used)

int - defines wich parameter from this parameter is first that defines attribute name, usualy 0 (zero means that next parameter contains first atribute name to populate)

... - name-value pairs for the attributes to update "atribute1", "value1","atribute2", "value2"

working example:

  uuid who;
  object newobject;
  send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");
  who=msg[0];
  send_wait(0, top_object(), "call_attr", "api", "insert_object", who, "zcustomobject1", NULL, 0, "description", description, "time_spent", time_spent, "alg", persistent_id, "request", call_req_id, "contact", analyst);
   if (!msg_error()) {
      newobject = msg[0];
      logf(SIGNIFICANT, "new object id %s", newobject.id); //log new object id
     }
                   

Statistics
0 Favorited
23 Views
0 Files
0 Shares
0 Downloads

Related Entries and Links

No Related Resource entered.