CA Service Management

  • 1.  spel on attachdoc

    Posted Jan 09, 2017 11:53 AM

    Hi,

     

    I am tring to write a spel code on activity log of cr so that when particular user (ex:system_ahd_user_gereated) attach doc need to set a cr custom field 'zattach' (which is integer type field ) to 1.

    I tried following code but getting attempt to modify non_co value.

    can any one help in detail how we can remove checkout so that it works properly.

     

    alg::zattachdoc(...)

    {

    if analyst==(uuid)'812345810230102010010')

    call_req_id.zattach=1;

    }

    }



  • 2.  Re: spel on attachdoc
    Best Answer

    Posted Jan 09, 2017 12:13 PM

    Hi,

    you can use update_object_super 

     

    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, call_req_id.persistent_id, 0, "zattach", 1);

     

    Also you can do the same without spel, create condition like this on form and call activity as OP=UPDATE, FACTORY=CR:

    <PDM_IF "$cst.id" == "<UUID>">
    docWrite("<input type='hidden' name='SET.zattach' value='1'>");
    </PDM_IF>

     

    Regards,

    cdtj



  • 3.  Re: spel on attachdoc

    Posted Jan 10, 2017 07:32 AM

    Hi cdtj,

     

    thank you very much update_object_super help a lot for spel.

     

    As you mentioned we can also do it from htmpl can you let me know where and how we can create and achieve this. It would be helpful if you provide step by step to achieve.



  • 4.  Re: spel on attachdoc

    Posted Jan 10, 2017 08:50 AM

    Hi,

     

    seems I have missed the method used to generate Activity Log, I thought it was generated by user, so you can implement this code into child form used to save activity (like detail_alg) form but if this code being generated by File attaching action, this willn't work..

    Regards,

    cdtj