CA Service Management

 View Only
Expand all | Collapse all

show dropdown field on detail_cr.htmpl from detail_cr_wf.htmpl

  • 1.  show dropdown field on detail_cr.htmpl from detail_cr_wf.htmpl

    Posted Jun 14, 2019 03:11 AM
    Edited by Aamir Khan Jun 14, 2019 07:56 AM
    Hi Team

    I have some custom dropdown fields on detail_cr_wf.htmpl form page which i also need to show on detail_cr.htmpl form as read only. so that what ever field that field populate by wf task assignee will be visible on detail_cr page also.

    below field is on detail_cr_wf.htmpl page , 
    <PDM_MACRO name=dtlDropdown hdr="Laptop S.no" attr="zlaptop" lookup="no">

    this field should also be visible on detail_cr.htmpl page. i change it to readonly and modify the attribute as cr.zlaptop but its not working.
    <PDM_MACRO name=dtlReadonly hdr="Laptop S.no" attr="cr.zlaptop" lookup="no">

    wt would be correct attribute in this case? as i know cr.atribute_name works when we call CR objet to cr_wf object...what would be vice versa?

    @ca service desk ​


  • 2.  RE: show dropdown field on detail_cr.htmpl from detail_cr_wf.htmpl

    Posted Jun 14, 2019 08:13 AM
    @Lindsay Estabrooks can you pls advise ​


  • 3.  RE: show dropdown field on detail_cr.htmpl from detail_cr_wf.htmpl

    Posted Jun 14, 2019 09:38 AM
    Edited by Aamir Khan Jun 19, 2019 11:59 AM
    hi,

    you can use something like this instead of the dtlReadonly on detail_cr:

    <PDM_LIST prefix=laptop factory=cr_wf where="cr='$args.persistent_id' and status='PEND'">
    <PDM_SET args.laptop="$laptop.zlaptop">
    </PDM_LIST>
    detailRowHdr("my label");
    detailSetRowData("$args.laptop");

    it will show the zlaptop value from the actual pending workflow attached to the specific cr

    regards,
    marc


  • 4.  RE: show dropdown field on detail_cr.htmpl from detail_cr_wf.htmpl

    Posted Jun 19, 2019 05:12 AM
    @Marc Horlomus Many thanks for your reply , i followed your code ​but it didnt work... can you pls help if i explain little bit more.


    on detail_cr_wf.htmpl page i have following code (Pls note we have different fields on each workflow task so we put it pdm_if)

    <PDM_IF "$args.task.sym" == 'Advances'> //for advances
    <PDM_MACRO name=dtlDropdown hdr="House Building" attr="z_advance_HB">
    <PDM_MACRO name=dtlDropdown hdr="Motor Car" attr="z_advance_car">
    <PDM_MACRO name=dtlDropdown hdr="Motor Cycle" attr="z_advance_bike">
    </PDM_IF>

    once these fields populated by the assigned members and approved the task, These fields should be visible as readonly on detail_cr.htmpl page also ... so the last workflow task (last approver) can have the visiblity of all the workflow task fields on detail_cr.htmpl page despite of click each workflow task and see the fields information.




  • 5.  RE: show dropdown field on detail_cr.htmpl from detail_cr_wf.htmpl

    Posted Jun 19, 2019 08:15 AM
    Edited by Aamir Khan Aug 19, 2020 04:26 AM
    then something like this should work in detail_cr:

    var adv_f = false, adv_hb = "", adv_car = "", adv_bike = "";
    <PDM_LIST prefix=adv factory=cr_wf where="cr='$args.persistent_id' and status='COMP' and task.sym='Advances'">
    	adv_f = true;
    	adv_hb = "$adv.z_advance_HB";
    	adv_car ="$adv.z_advance_car";
    	adv_bike ="$adv.z_advance_bike";
    </PDM_LIST>
    if(adv_f) {
    	detailRowHdr("House Building");
    	detailSetRowData(adv_hb);
    	detailRowHdr("Motor Car");
    	detailSetRowData(adv_car);
    	detailRowHdr("Motor Cycle");
    	detailSetRowData(adv_bike);
    }
    
    
    
    
    var xyz_f = false, xyz_zfield1 = "", xyz_zfield2 = "", xyz_zfield3 = "";
    <PDM_LIST prefix=xyz factory=cr_wf where="cr='$args.persistent_id' and status='COMP' and task.sym='xyz'">
    	xyz_f = false;
    	xyz_zfield1 = "$xyz.zfield1";
    	xyz_zfield2 = "$xyz.zfield2";
    	xyz_zfield3 = "$xyz.zfield3";
    </PDM_LIST>
    if(xyz_f) {
    	detailRowHdr("zfield1 label");
    	detailSetRowData(xyz_zfield1);
    	detailRowHdr("zfield2 label");
    	detailSetRowData(xyz_zfield2);
    	detailRowHdr("zfield3 label");
    	detailSetRowData(xyz_zfield3);
    }

    you can copy and multiply the second block for your additional types of wf's


  • 6.  RE: show dropdown field on detail_cr.htmpl from detail_cr_wf.htmpl

    Posted Jun 19, 2019 08:59 AM
    @Marc Horlomus Great  , this code worked but getting little issue. its showing record ID against selected item​. pls how can we fix this.

    below screenshot detail_cr_wf.htmpl


    below screenshot detail_cr.htmpl




  • 7.  RE: show dropdown field on detail_cr.htmpl from detail_cr_wf.htmpl

    Posted Jun 19, 2019 09:49 AM
    ah ok, z_advance_HB is a relation to an other table/object, sry i didn't recognize that.

    now you have to find out, in which field your value "Cleared" is saved. let's assume is the field "name", so you have to change to:

    ...
    adv_hb = "$adv.z_advance_HB.name";
    ...


  • 8.  RE: show dropdown field on detail_cr.htmpl from detail_cr_wf.htmpl

    Posted Jun 19, 2019 12:13 PM
    Hi Marc

    Many Thanks for your HELP. it worked for me. in my case field name is sym.

    Thanks :)


  • 9.  RE: show dropdown field on detail_cr.htmpl from detail_cr_wf.htmpl

    Posted Jun 20, 2019 07:21 AM
    ur welcome :)


  • 10.  RE: show dropdown field on detail_cr.htmpl from detail_cr_wf.htmpl

    Posted Jul 08, 2019 10:28 AM
    Hi @Marc Horlomus

    since the code is working perfect for Request workflows. I have the same requirement for change workflows also and i did change in below code w.r.t to change order workflow but its not working. can you pls advise.

    detail_chg.htmpl

    var adv_f = false, adv_uat = "";
    <PDM_LIST prefix=adv factory=chg where="chg='$args.persistent_id' and status='APP'">
    adv_f = true;
    adv_uat = "$adv.zuat";

    </PDM_LIST>
    if(adv_f) {
    detailRowHdr("UAT Manager");
    detailSetRowData(adv_uat);

    }


    i have below custom field on detail_wf.htmpl
    <PDM_MACRO name=dtlDropdown hdr="UAT Manager" attr="zuat">


  • 11.  RE: show dropdown field on detail_cr.htmpl from detail_cr_wf.htmpl

    Posted Jul 09, 2019 09:47 AM
    hi Aamir,

    if you want the same behaviour like above, the factory in pdm_list should be "wf", not "chg".

    because zuat is a relational attribut, you also have to add $adv.zuat.Name (or, whatever your naming attribute is).

    regards,
    pacy


    ------------------------------
    Senoir Consultant
    Fujitsu
    ------------------------------



  • 12.  RE: show dropdown field on detail_cr.htmpl from detail_cr_wf.htmpl

    Posted Aug 18, 2020 07:46 AM
    Dear @Marc Horlomus

    For change order page (detail_chg) i change the factory name but it is not working and in logs i see below error. Can you please advise​​. (Below code works fine for cr_wf factory but not for 'wf')


    var adv_f = false, adv_time = "";
    <PDM_LIST prefix=adv factory=wf where="chg='$args.persistent_id' and status='APP'  and task='chgmt'">
    adv_f = true;
    adv_time = "$adv.z_time";

    </PDM_LIST>
    if(adv_f) {
    detailRowHdr("Start Time");
    detailSetRowData(adv_time);



    LOGS Error


    08/18 13:44:43.71  domsrvr 11360 ERROR where.y 908 Parse error at : "chg='chg:3439930' and status='APP' and task='chgmt'" (Bad where clause)
    08/18 13:44:43.72  web:local 18140 ERROR parse.c 8154 Unable to receive record for PDM_LIST at detail_chg.htmpl[510]: AHD03053:Bad where clause: Parse error at : "chg='chg:3439930' and status='APP' and task='chgmt'" (Bad where clause)




  • 13.  RE: show dropdown field on detail_cr.htmpl from detail_cr_wf.htmpl

    Posted Aug 18, 2020 08:45 AM
    Edited by Marc Horlomus Aug 18, 2020 08:46 AM
    hi Aamir,

    a bop_sinfo -d wf shows you
    ...
    chg SREL -> chg.id REQUIRED
    ...
    so, the chg field in wf object points to a chg id

    whercelause: chg='$args.id' and status='APP' and task='chgmt'

    regards,
    pacy



    ------------------------------
    Senoir Consultant
    Fujitsu
    ------------------------------



  • 14.  RE: show dropdown field on detail_cr.htmpl from detail_cr_wf.htmpl

    Posted Aug 18, 2020 10:16 AM
    Dear @Marc Horlomus

    Thanks for your reply,
    i changed​ the whereclause <PDM_LIST prefix=adv factory=wf where="chg='$args.id' and status='APP'  and task='chgmt'"> but still not work. Below is the error in logs. 

    the bold one is difference as compare to old logs

    08/18 16:53:24.81 domsrvr 11360 ERROR where.y 908 Parse error at : "chg='3439932' and status='APP' and task='chgmt'" (Bad where clause)
    08/18 16:53:24.83  web:local 18140 ERROR parse.c 8154 Unable to receive record for PDM_LIST at detail_chg.htmpl[510]: AHD03053:Bad where clause: Parse error at : "chg='3439932' and status='APP' and task='chgmt'" (Bad where clause)




  • 15.  RE: show dropdown field on detail_cr.htmpl from detail_cr_wf.htmpl
    Best Answer

    Posted Aug 18, 2020 12:02 PM
    ...sry, man...

    chg=$args.id and status='APP' and task='chgmt'

    remove single quotes (id's not a string)

    ------------------------------
    Senoir Consultant
    Fujitsu
    ------------------------------



  • 16.  RE: show dropdown field on detail_cr.htmpl from detail_cr_wf.htmpl

    Posted Aug 19, 2020 04:25 AM
    Thankyou @Marc Horlomus


  • 17.  RE: show dropdown field on detail_cr.htmpl from detail_cr_wf.htmpl

    Posted Aug 19, 2020 04:26 AM
    Thankyou @Marc Horlomus