CA Service Management

Expand all | Collapse all

Create child change order button

Joaquin Adrian Chumillas del Pino

Joaquin Adrian Chumillas del PinoApr 05, 2016 06:36 AM

Giedrius Bekintis

Giedrius BekintisApr 05, 2016 06:40 AM

Joaquin Adrian Chumillas del Pino

Joaquin Adrian Chumillas del PinoApr 05, 2016 07:35 AM

  • 1.  Create child change order button

    Posted Mar 31, 2016 04:24 AM

    Hi,

     

    I've updated to CA SDM R14.1 version. In my old environment, R12.5 I had a button in my detail_chg.htmpl that I created change order child since my change order parent with the code 'ImgBtnCreate("makechild", "Crear child change order", "create_new('chg',0,0,0,'PRESET=type:$args.type','INITFROM=make_child')", true, 0,"Create a Child");'. This code in R14.1 works but it doesn't save the datas parent change order in the child change order and neither to assign automatically the parent change order to child changer order. In the R12.5 works ok.

     

    someone can tell me how I can create a button for the creation of childs orders changes capturing data from the parents change orders?

     

    Thanks,



  • 2.  Re: Create child change order button

    Posted Apr 01, 2016 08:19 AM

    Hi, you can try the to change creation script in the following way:

    'ImgBtnCreate("makechild", "Crear child change order", "create_new('chg',0,0,0,'PRESET=type:$args.type','PRESET=parent:$args.id','INITFROM=make_child')", true, 0,"Create a Child");'

     

    You can also try to change make_child form since it also should contain initial values for child change order



  • 3.  Re: Create child change order button

    Posted Apr 05, 2016 04:31 AM

    Hi Gutis,

     

    Your code links the child change order number in the parent changer order but it doesn't capture the data parent changer order in the child change order (summary, description, 'create since change order number',...)

     

    How can I change make_child form to contain initial values for child change order?. Sorry, I'm not developer.

     

    Regards.



  • 4.  Re: Create child change order button

    Posted Apr 05, 2016 06:11 AM

    Could you attach your detail_chg.htmpl i will make changes for you



  • 5.  Re: Create child change order button

    Posted Apr 05, 2016 06:36 AM

    How can I attach a file here?



  • 6.  Re: Create child change order button

    Posted Apr 05, 2016 06:40 AM

    you need to use advanced editor



  • 7.  Re: Create child change order button

    Posted Apr 05, 2016 07:35 AM
      |   view attached

    Thank Guti,

     

    I've attached the form. The form is in spanish language .

     

    Regards.

    Attachment(s)

    zip
    detail_chg.htmpl.zip   8 KB 1 version


  • 8.  Re: Create child change order button

    Posted Apr 05, 2016 07:54 AM

    I don't see

    'ImgBtnCreate("makechild", "Crear child change order", "create_new('chg',0,0,0,'PRESET=type:$args.type','INITFROM=make_child')", true, 0,"Create a Child");'

    on you chg form where you have defined your button?



  • 9.  Re: Create child change order button

    Posted Apr 05, 2016 08:06 AM
      |   view attached

    Here is modified form, in order to customize attributes that are copied from parent you need to modify make_child form:

     

    <form name="make_child">

    <input type="hidden" name=SET.requestor_by value="$args.requestor">

    <input type="hidden" name=requestor_combo_name value="$args.requestor.combo_name">

    <input type="hidden" name=SET.summary value=<PDM_FMT ESC_STYLE=JS2>"$args.summary"</PDM_FMT>>

    <input type="hidden" name=SET.description value=<PDM_FMT ESC_STYLE=JS2>"$args.description

    (se ha creado a partir de la orden de cambio $args.chg_ref_num)"</PDM_FMT>>

    </form>

    Attachment(s)

    zip
    detail_chg.htmpl.zip   8 KB 1 version


  • 10.  Re: Create child change order button

    Posted Apr 05, 2016 08:51 AM

    Sorry Guti,

     

    The button is in chg_relchg_tab.htmpl form. Tomorrow I'll test your solution and I'll report the result.

     

    Best Regards.



  • 11.  Re: Create child change order button

    Posted Apr 07, 2016 05:34 AM
      |   view attached

    Hi Gutis,

     

    Where is the make_child form?. I don't find. I've uploaded the form where I have the button.

     

    Regards

    Attachment(s)

    zip
    chg_relchg_tab.htmpl.zip   1 KB 1 version


  • 12.  Re: Create child change order button

    Posted Apr 07, 2016 05:43 AM

    Hi you have defined, that create_new function should use make child form ('INITFROM=make_child' ) but you did not created it. Try to place the following lines after <PDM_INCLUDE FILE=std_body.htmpl filename="">

     

     

    <form name="make_child">

    <input type="hidden" name=SET.requestor_by value="$args.requestor">

    <input type="hidden" name=requestor_combo_name value="$args.requestor.combo_name">

    <input type="hidden" name=SET.summary value=<PDM_FMT ESC_STYLE=JS2>"$args.summary"</PDM_FMT>>

    <input type="hidden" name=SET.description value=<PDM_FMT ESC_STYLE=JS2>"$args.description

    (se ha creado a partir de la orden de cambio $args.chg_ref_num)"</PDM_FMT>>

    </form>



  • 13.  Re: Create child change order button

    Posted Apr 07, 2016 05:51 AM

    Hi, I did it but don't work. The attibutes aren't copied from parent.

     

    <PDM_INCLUDE FILE=std_body.htmpl filename="">

    <form name="make_child">

    <input type="hidden" name=SET.requestor_by value="$args.requestor">

    <input type="hidden" name=requestor_combo_name value="$args.requestor.combo_name">

    <input type="hidden" name=SET.summary value=<PDM_FMT ESC_STYLE=JS2>"$args.summary"</PDM_FMT>>

    <input type="hidden" name=SET.description value=<PDM_FMT ESC_STYLE=JS2>"$args.description

    (se ha creado a partir de la orden de cambio $args.chg_ref_num)"</PDM_FMT>>

    </form>

    <PDM_FORM NAME="frmDTLRO">

    <script language="JavaScript">

    <PDM_OBJECT>

    function add_button_to_tab_banner(){

       <PDM_IF "$args.id" != "0" && "$args.category.children_ok" == 1 && $UserAuth \> 1>

    <PDM_MACRO name=button caption="Actualizar Peticiones hijas [*Q]" endrow=yes func="update_child('chg', '$args.persistent_id', 'children', 'chg', 'parent', 'Órdenes de cambio', 'Orden de cambio $args.chg_ref_num<BR>Hijos')" hotkey_name="Update Child Change Orders[*Q]" id=UPDATE_CHILD newrow=no>

    ImgBtnCreate("makechild", "Crear child change order", "create_new('chg',0,0,0,'PRESET=type:$args.type','PRESET=parent:$args.id','INITFROM=make_child')", true, 0,"Create a Child");

    </PDM_IF>

    }

    </PDM_OBJECT>

     

    Regards.



  • 14.  Re: Create child change order button

    Posted Apr 11, 2016 02:09 AM

    Hi Gutis,

     

    Any idea?

     

    Regards.



  • 15.  Re: Create child change order button

    Posted Apr 11, 2016 04:23 AM

    Hi, i have attached modified forms, both of them are needed for functionality to work .



  • 16.  Re: Create child change order button

    Posted Apr 11, 2016 04:26 AM

    Sorry wrong forms use these forms instead:

    Attachment(s)

    zip
    chg_relchg_tab.htmpl.zip   1 KB 1 version
    zip
    detail_chg.htmpl.zip   8 KB 1 version


  • 17.  Re: Create child change order button

    Posted Apr 12, 2016 07:35 AM

    Hi Gutis,

     

    Now it works ok. Only I've detected one problem. When the child change order capture the requestor parent, I don't know why but it puts a 'space' in the end, then when I save the change order I get a error, because the requestor is not valid.

     

    Do you know how I can resolve this problem?

     

    Do you know how I can capture the category parent in the child?

     

    Thank very much,

     

    Best Regards.



  • 18.  Re: Create child change order button
    Best Answer

    Posted Apr 12, 2016 07:49 AM

    Hi, change make_child form in detail_chg.htmpl to the following

     

    <form name="make_child">

    <input type="hidden" name=SET.requestor value="$args.requestor">

    <input type="hidden" name=requestor_combo_name value="$args.requestor.combo_name">

    <input type="hidden" name=SET.affected_contact value="$args.affected_contact">

    <input type="hidden" name=affected_contact_combo_name value="$args.affected_contact.combo_name">

    <input type="hidden" name=SET.category value="$args.category">

    <input type="hidden" name=SET.summary value=<PDM_FMT ESC_STYLE=JS2>"$args.summary"</PDM_FMT>>

    <input type="hidden" name=SET.description value=<PDM_FMT ESC_STYLE=JS2>"$args.description

    (se ha creado a partir de la orden de cambio $args.chg_ref_num)"</PDM_FMT>>

    </form>



  • 19.  Re: Create child change order button

    Posted Apr 12, 2016 08:11 AM

    Hi Gutis,

     

    Now the requestor and affected contact is ok. The category is not captured but no matter.

     

    thank you so much.

     

    Regards.



  • 20.  Re: Create child change order button

    Posted Apr 12, 2016 08:24 AM

    You're welcome. This will capture category as well (changes in bold);

     

    <form name="make_child">

    <input type="hidden" name=SET.requestor value="$args.requestor">

    <input type="hidden" name=requestor_combo_name value="$args.requestor.combo_name">

    <input type="hidden" name=SET.affected_contact value="$args.affected_contact">

    <input type="hidden" name=affected_contact_combo_name value="$args.affected_contact.combo_name">

    <input type="hidden" name=SET.category value="$args.category">

    <input type="hidden" name=KEY.category value="$args.category.sym">

    <input type="hidden" name=SET.summary value=<PDM_FMT ESC_STYLE=JS2>"$args.summary"</PDM_FMT>>

    <input type="hidden" name=SET.description value=<PDM_FMT ESC_STYLE=JS2>"$args.description

    (se ha creado a partir de la orden de cambio $args.chg_ref_num)"</PDM_FMT>>

    </form>



  • 21.  Re: Create child change order button

    Posted Apr 18, 2016 02:01 AM

    Hi Gutis,

     

    Yes it's ok. Now I capture the category.

     

    Best Regards.