CA Service Management

 View Only
  • 1.  Multiple detail_xxx.html form for same object

    Posted Nov 11, 2020 10:17 AM
    It is possible to use multiple forms in order to create, view or edit the same object at same form_group?

    Our use case is:
    - Analyst use the 'issue' object (iss with detail_iss.htmpl)
    - Using a menu bar option or button analyst create a new issue 'type 1' and detail_iss.htmpl is launched in order to create an issue using some form fields distribution and rules.
    - Using another menu bar option or button analyst create a new issue 'type 2' and detail_iss2.htmpl is launched in order to create an issue using another form fields distribution or rules.

    It is important to remember that this activity is execute by same analyst using the same rol (and same form_group obviously)

    Any suggestion?

    Thanks for your help.

    Regards, 
    John V.


  • 2.  RE: Multiple detail_xxx.html form for same object

    Broadcom Employee
    Posted Nov 12, 2020 02:55 AM
    You cannot use multiple form groups with the same role. This is a 1-to-1 mapping/relationship. However, you can use the same form group with multiple roles.

    An idea to address your requirement may be to you use the same form (detail_iss.htmpl) and use the PDM_IF to conditionally hide or display some fields based on issue type?

    ------------------------------
    Kind Regards,
    Brian
    ------------------------------



  • 3.  RE: Multiple detail_xxx.html form for same object

    Posted Nov 24, 2020 03:20 PM

    Thanks for your message.

    if any ever have a similar need, here is how we could achieve something like that.

    http://forum.servicedeskusers.com/forums/topic/901-change-form-that-opens-when-user-selects-new-change-order-from-file-menu/

    1. Copy the create_new function from the std_head.js file located in the bopcfg\www\wwwroot\scripts folder and save it in your new sitemods.js file

    2. Rename the function to zcreate_new.

    3. Add "+HTMPL=zdetail_chg.htmpl"+ to the function (or whaterer you named your custom htmpl) between this lines:"+OP=CREATE_NEW"+
      "+FACTORY="+factory+
      "+HTMPL=zdetail_chg.htmpl"+
      "+KEEP.IsPopUp=1";

    4. Change (or add) the entry on menubar_sd.htmpl to reference the zcreate_new function instead of the create_new function
      <PDM_MACRO name=menuItem label="New Change Order..." function="ahdtop.zcreate_new('chg',0)" hotkey=h>

    5. Run a pdm_webcache.

    Now we're looking for something similar but in order to edit this change order. When we click on change ref num in the change list view (list_chg.htmpl) the detail_chg.htmpl is always opens. How could we launch our custom form to open instead? Any ideas?

    Regards,

    John V.




  • 4.  RE: Multiple detail_xxx.html form for same object

    Posted Nov 25, 2020 02:59 AM
    Hi John.

    Thanks or providing this approach.
    Here is another one, for using different detail htmpl's based on a condition of the object itself:
    Looking at the ootb detail_cr.htmpl you will find an outer if-then-elif- block, using different htmpl's for the different type of cr's (incident, request,problem)
    Something like:

    <pdm_if "$args.type" == "I">
    <pdm_include FILE= "detail_in.htmpl">
    <pdm_elif "$args.type" == "P">
    <pdm_include  FILE="detail_pr.htmpl">
    <pdm_else>
    .. here comes the stuff for requests (type == "R")...
    </pdm_if>

    This approach might be more aligned to the standard and less invasive.

    Regards
    ...........Michael


    ------------------------------
    Principal Services Consultant
    HCL Enterprise Studio
    Germany
    ------------------------------