CA Service Management

 View Only

update_object_super 

Dec 09, 2015 03:41 PM

SPEL API methods

update_object_super

 

This method allows to update multiple attributes for the object

 

Definition:

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

uuid - user id

string - persistent_id of the object to update

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 update)

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

 

working example:

  uuid who;
  send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");
  who=msg[0];
  send_wait(0, top_object(), "call_attr", "api", "update_object_super", who, persistent_id, 0, "description", description, "time_spent", time_spent);
                   

Statistics
0 Favorited
27 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

May 12, 2016 01:51 PM

Thank you Gutis for sharing your knowledge!

 

Today I put together my first SPL script from scratch.  It automatically sets the I/P/R status to Cancelled, sets rootcause to NULL and sets resolution_code to NULL only when the template_name is populated.  I'll share it below so people have another example of this method.

 

SPL File:

cr::zSetTemplateStatus(...)

{

string Method;

Method ="zSetTemplateStatus";

if (!is_empty(template_name))

{

  uuid who; 

  send_wait(0,top_object(), "call_attr", "cnt", "current_user_id"); 

  who=msg[0]; 

  send_wait(0, top_object(), "call_attr", "api", "update_object_super", who, persistent_id, 0, "status", "crs:5214", "resolution_code", NULL, "rootcause", NULL);

}

}

 

MOD file:

////////////////////////////////////////////////////////////////////////

// Factory:   cr

////////////////////////////////////////////////////////////////////////

 

 

OBJECT cr {

  TRIGGERS {

  POST_VALIDATE zSetTemplateStatus() 4001 FILTER( template_name{});

  };

};

Related Entries and Links

No Related Resource entered.