CA Service Management

Expand all | Collapse all

send_wait - api - update_object

Jump to Best Answer
  • 1.  send_wait - api - update_object

    Posted 10-26-2017 09:42 AM

    Hello,

     

    I use this code as below. I want to see custom User Description in act_log. How can I do this?

     

    send_wait(0, top_object(), "call_attr", "api", "update_object", who, cr_persid, NULL, group_leader, 0, "status", 'CL' );

     

    Regards,

    Melis



  • 2.  Re: send_wait - api - update_object

    Posted 10-26-2017 10:50 AM

    Hi Melis,

    When you say "custom User Description" - are you referring to a custom column you added to the alg object?  And where is it that you want to see this field - which form?

    Jon



  • 3.  Re: send_wait - api - update_object

    Posted 10-27-2017 05:18 AM

    When I use "update_object" function, I can see, the system adds a log as Close. But Close activity description is default, I want to can write as "xxxx". 

    So, I don't have a custom field. I want to write on standart description field on alg object. 



  • 4.  Re: send_wait - api - update_object
    Best Answer

    Posted 10-26-2017 01:45 PM

    From where are you calling your spell? llok like you do from the cr object.

    you will need to start from the alg object and use the update_object to set your  status using dotted reference

    Have a look to this post and response from Giedrius Bekintis for more inside:

    https://communities.ca.com/message/241914780-re-set-cr-values-from-alg-spell?commentID=241914780#comment-241914780

    Hope this help

     

    /J



  • 5.  Re: send_wait - api - update_object

    Posted 10-26-2017 01:54 PM

    hi,

    regarding to your code, if you want to change ticket status you need to use generic_status_change then.

    ps: you can insert activity log using: insert_object 

    regards, cdtj



  • 6.  Re: send_wait - api - update_object

    Posted 11-01-2017 02:56 PM

    @melis.yazici  - do you still need assistance on this one?



  • 7.  Re: send_wait - api - update_object

    Posted 11-02-2017 07:31 AM

    Hİ Jon,

     

    We use code in below.

     

    cr::zCR_AutoDialerClose(...)
    {
    string cr_persid;
    cr_persid = argv[3];
    logf(SIGNIFICANT, "zCR_AutoDialerClose : , cr_persid : %s",cr_persid);

    uuid who;
    object group_leader;
    send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");
    who=msg[0];

    send_wait(0, top_object(), "get_co_group");
    if (msg_error())
    {
    printf("Error IF ACTION MACRO HATASI'%s'", msg[0]);
    }
    else
    {
    group_leader = msg[0];
    }

    send_wait(0, top_object(), "call_attr", "api", "update_object", who, cr_persid, NULL, group_leader, 0, "status", 'CL');
    if (!msg_error()) {
    send_wait(0, group_leader, "checkin");
    if (msg_error()) {
    printf("Error: '%s'", msg[0]);
    }
    }
    else{
    printf("Update failed %s",msg[0]);
    }
    }

     

    I want to see custom User Description in act_log.Can I use 

    send_wait(0, top_object(), "call_attr", "api", "update_object", who, cr_persid, NULL, group_leader, 0, "status", 'CL',"alg.description","Test");



  • 8.  Re: send_wait - api - update_object

    Posted 11-02-2017 02:34 PM

    Hi melis.yazici  - did the info that cdtj provided help resolve this for you?

    Unfortunately I dont have anything to add as I am not super well versed in Spelcode - being on the support side we dont have a ton of exposure to it as its outside of our scope.

    Jon