insert_object

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

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
     }
                   
1 person found this helpful

Attachments

    Outcomes