CA Service Management

  • 1.  Hiding Attach File button when copying change

    Posted Feb 24, 2016 02:45 PM

    In order to prevent orphaned files when someone attaches a file and then cancels a change order, we'd like to hide the Attach File button on change orders for a new or copied Change Order.  We've already successfully managed to hide the button on creating a new Change Order, but have not been able to hide it when copying a change order.  SDM treats this like an "update" instead of creating a new Change Order.  We've tried

    if ("$args.KEEP.MAKE_COPY" != "1")

    {

    <PDM_MACRO name=button Caption="Attach Document[!D]" Func="do_attach_doc()" hotkey_name="Attach Document[!D]" ID=btn201 NewRow=yes>

    }

     

    We've also tried

    <PDM_IF "$args.KEEP.MAKE_COPY" != "1">

    <PDM_MACRO name=button Caption="Attach Document[!D]" Func="do_attach_doc()" hotkey_name="Attach Document[!D]" ID=btn201 NewRow=yes>

    </PDM_IF>

     

    Neither work, it doesn't seem to recognize $args.KEEP.MAKE_COPY on the xx_attmnt_tab.htmpl form although this has worked in other areas like detail_in.htmpl where we hide the Incident number until after the Incident has been saved.

     

    Thanks,

    Andrea



  • 2.  Re: Hiding Attach File button when copying change
    Best Answer

    Posted Feb 25, 2016 04:16 AM

    Hi,

    This is mostly because the KEEP.MAKE_COPY variable is not set in your attachment tab (the KEEP is only passed to the next form) so you will need to pass it to your tab too if you want to use it there

    You can modify your detail_chg.htmpl with something like:

     

    <PDM_IF "$args.KEEP.MAKE_COPY" == "1">

    <PDM_MACRO name=tab title="Attachments" height=300 id=attmnt src="OP=SHOW_DETAIL+HTMPL=xx_attmnt_tab.htmpl+FACTORY=chg+PERSID=$args.persistent_id+NO_DP=yes+KEEP.MAKE_COPY=1"></pdm_tab>
    <PDM_ELSE>
    <PDM_MACRO name=tab title="Attachments" height=300 id=attmnt src="OP=SHOW_DETAIL+HTMPL=xx_attmnt_tab.htmpl+FACTORY=chg+PERSID=$args.persistent_id+NO_DP=yes"></pdm_tab>
    </PDM/IF>

     

    Give it a try.

    Hope this help.

    /J



  • 3.  Re: Hiding Attach File button when copying change

    Posted Feb 29, 2016 10:58 AM

    Hi   Andholmes,

    let us know if this fix your problem

    /J



  • 4.  Re: Hiding Attach File button when copying change

    Posted Feb 29, 2016 11:43 AM

    That did it, thanks so much!



  • 5.  Re: Hiding Attach File button when copying change

    Posted Mar 19, 2019 09:41 AM

    I need help in hiding or greying out the 'publish' button from all users (even belonging to the same group or role), except for one person. NOTE this is on the knowledge form, when creating knowledge. This is what I have, problem is that it greys out for everyone even though I said the person with this userid should still be able to use the button.

     

    if ("$args.KEEP.CAN_FORWARD" == "1" || "$args.userid" == "fnbjnb01\f5238161")
         {
    <PDM_MACRO name=button caption="Publish[P]" disabled="defer" func="OpenPublishWindow()" hotkey_name="Publish[P]" id="btnPublish">
         }
         else
         if ("$args.KEEP.CAN_FORWARD" == "1" || "$args.userid" != "fnbjnb01\f5238161")
         {
    <PDM_MACRO name=button caption="Publish[P]" disabled="yes" func="OpenPublishWindow()" hotkey_name="Publish[P]" id="btnPublish">
         }



  • 6.  Re: Hiding Attach File button when copying change

    Posted Mar 24, 2019 11:00 PM

    I think you want to reference "$cst.userid", not "$args.userid".



  • 7.  Re: Hiding Attach File button when copying change

    Posted Mar 25, 2019 09:18 AM

    Many thanks, that's what I needed.