Clarity Service Management

Expand all | Collapse all

Setting a default value on a lookup

Jump to Best Answer
  • 1.  Setting a default value on a lookup

    Posted 07-16-2018 11:44 AM

    Does anyone know how to apply a default value for a lookup on a form? I do not want to set the default value in the schema for the overall column. This value simply pertains to one form.

     

    This is for Service Desk 14.1.



  • 2.  Re: Setting a default value on a lookup

    Posted 07-16-2018 01:59 PM

    Alexander, dtlLookup macro does not have default parameter. And extraURL is for when you do the lookup it will add this extra url to the lookup search. Maybe consider DP with custom form group? Thanks _Chi



  • 3.  Re: Setting a default value on a lookup
    Best Answer

    Posted 07-17-2018 02:15 AM

    Hi,


    I can remember at least 3 ways to define default value:

    - using role based data partition with "Default" type;

    - PRESET=attr:value as URL part while populating new form: Supported Server Operations - CA Service Management - 14.1 - CA Technologies Documentation 

    - using JavaScript:

    <body ... onload="onloadActions();zFillDefaults();">

    function zFillDefaults() {
         // REL_ATTR is factory's foreigen key, like id, persid or code
         // you can check it by bop_sinfo -f <factory>
         document.main_form.elements["SET.<attr_name>"].value = "<REL_ATTR>";
         // COMMON_NAME is visible part, also can be checked by
         // bop_sinfo -f <factory>
         document.main_form.elements["KEY.<attr_name>"].value = "<COMMON_NAME>";
    }

     

    Regards,

    Timur



  • 4.  Re: Setting a default value on a lookup

    Posted 07-19-2018 04:29 PM

    I like the idea of using the data partition. I am able to get this to work when running against a string field and the category fields, but I am unable to get it work running against the group field and the secondary group field I created. Any thoughts on why this won't work against those attributes?



  • 5.  Re: Setting a default value on a lookup

    Posted 07-20-2018 09:15 AM

    How did you specify the value?

     

    You need to pass it as a uuid : 



  • 6.  Re: Setting a default value on a lookup

    Posted 07-20-2018 10:55 AM

    This worked perfectly. Thanks. Since the CA help documentation mentioned that persistent ids can be found using 

    "bop_odump domsrvr pcat "" sym", I ran this against grp. This displayed cnt:<UUID>. 
    So I was using it that way in the Data Partition. I forgot about the way UUIDs are defined in the UI. Thanks again.


  • 7.  Re: Setting a default value on a lookup

    Posted 07-20-2018 11:01 AM

    Pleasure