CA Service Management

Expand all | Collapse all

Modification on list_cr/list_in

  • 1.  Modification on list_cr/list_in

    Posted 05-24-2018 04:23 PM

    Hello,

     

    Does anyone can show some light on how can i do this to a form in SDM 14.1. To have two values on the same field.

     

     

    Regards,

     

    Jason.



  • 2.  Re: Modification on list_cr/list_in

    Posted 05-25-2018 10:55 AM

    Jason, I think you can try a local DERIVED attribute in a custom mod file for the cr object like asg-enduser.mod:

    OBJECT cr {
               ATTRIBUTES Call_Req {
             

               assignee_enduser     LOCAL STRING(0) DERIVED( "Assignee:"||assignee||"End User:"||customer);


                };
     };

    then use assignee_enduser attribute in the list_cr/in.htmpl file

    Thanks _Chi



  • 3.  Re: Modification on list_cr/list_in

    Posted 05-29-2018 08:53 PM

    Hello Chi,

     

    I followed your suggestions and after a recycle of services the UI of SDM wasn't loading. I found these on the logs:

     

    mods/majic/asgenduser.mod:4 syntax error, unexpected '(', expecting ';' at "("
    05/29 20:44:47.08 MDTXSDM17      domsrvr:sa           3960 FATAL        domsrvr.c              738 Could not parse files in C:/PROGRA~2/CA/SERVIC~1/site/mods/majic
    05/29 20:44:47.09 MDTXSDM17      domsrvr:wsp          3972 ERROR        majic.y               4622 mods/majic/asgenduser.mod:4 syntax error, unexpected '(', expecting ';' at "("

     

     

     

    What could be wrong in the code?



  • 4.  Re: Modification on list_cr/list_in

    Posted 05-30-2018 12:23 PM

    Jason, sorry there is some syntax error...please try

    OBJECT cr {
               ATTRIBUTES Call_Req {
          
               assignee_enduser DERIVED( "Assignee:" assignee  "End User:" customer );

     

                };
     };

    Thanks _Chi



  • 5.  Re: Modification on list_cr/list_in

    Posted 05-30-2018 02:46 PM

    Hello Chi,

     

    Thanks it works and brings the UUID of the customer and the assignee, one question, do you know if it's possible to bring the combo name of the assignee and customer?

     

    I tried with that same code and putting assignee.combo_name  customer.combo_name but it doesn't work. 

     

    I also tried assignee.combo.name customer.combo.name but it doesn't work either.

     

     

    Regards.



  • 6.  Re: Modification on list_cr/list_in

    Posted 05-30-2018 05:32 PM

    Jason, we can't list uuids(lol). The DERIVED macro does not like the dotted attribute so let us use aliases...

    --in Administration->Service Desk->Application Data->attribute alias, create two new aliases:

      cr assigneename assignee.combo_name

      cr customername customer.combo_name

    --change

    assignee_enduser DERIVED( "Assignee:" assignee  "End User:" customer );

    to

    assignee_enduser DERIVED( "Assignee:" assigneename  "End User:" customername );

    and recycle SDM and then modify the htmpl file accordingly

    Thanks _Chi



  • 7.  Re: Modification on list_cr/list_in

    Posted 06-04-2018 09:14 AM

    Hello Chi,

     

    After i made those changes the field is in blank

     

     

     

     

     

    Anything you suggest to check?

     

     

    Regards.



  • 8.  Re: Modification on list_cr/list_in

    Posted 05-29-2018 03:23 AM

    Hi,

    as an idea, may you don't want to modify your object, another approach can be to manipulate the output directly in your list form by using the fmtfunc parameter and a small js function

    The value send to the function is the common_name of the referenced attributes.

    Just written on the fly as an example (not tested)

     

    function myFunction(value){

    var ***= value;

    var aeu= rs.customer;

    var myhtml = 'assignee: ' + *** + ' Affected End User' + aeu;

    rs.data(myhtml);

    }

     

    <PDM_MACRO name=lsCol hdr="contact" attr=assignee fmtfunc=myFunction justify=left startrow="no" sort=yes>

     

    My 2 cents

    /J