vgen

Resolved:Clear New Assignee and Group fields on launching Transfer Page in Requests

9 posts in this topic

Posted (edited)

Could anyone please suggest on how to set clearing the value in the New Group & Assignee fields automatically upon launching the transfer page (xfer_esc_cr.htmpl)?

At the moment, it auto-fills with same assignee name and group name as in current Assignee & Group fields when clicked on Activities -> Transfer option in requests.

Set_NewGroup_Assignee_Null_On_Transfer.png

Edited by vgen

Share this post


Link to post
Share on other sites

Perhaps you could explain why you need it to behave this way.

Share this post


Link to post
Share on other sites

Our Service Desk team are the first responders on all requests and more than 60% of those demands transferring to other teams for addressing the end user needs. The pain for our team is that they need to clear the value in New Group or New Assignee fields before making a selection. Hope it makes sense.

Share this post


Link to post
Share on other sites

hi,

this can be achieved using javascript:

function zEmptyAsgnGrp() {
	jq("[name=SET.assignee]").val("");
	jq("[name=assignee_combo_name]").val("");
	jq("[name=SET.group]").val("");
	jq("[name=group_combo_name]").val("");
}

then add zEmptyAsgnGrp(); to <body> onload area.

Regards, cdtj

Share this post


Link to post
Share on other sites

hi cdtj,

Hopefully I have added your code in the right places and it didn't worked for me, also there were no errors in stdlog file. Please see below and advise if this is not the correct location to add in xfer_esc_cr.htpml file.

function initApcForNewTicket()
{
    if ( "$args.type" == "I" || "$args.type" == "P" )
    {

.....................

..................

        if (pri_cal_enabled == 'true' || "$args.KEEP.auto_pri_cal_mt" == "true")
        {
            var priority = document.main_form.elements["SET.priority"];
            priority.disabled = "true";
            priority.style.backgroundColor = "gainsboro";
        }
    }
}
 

function zEmptyAsgnGrp() {
    jq("[name=SET.assignee]").val("");
    jq("[name=assignee_combo_name]").val("");
    jq("[name=SET.group]").val("");
    jq("[name=group_combo_name]").val("");
}

</script>
</head>
<body onload="load_from_scratchpad('0');initApcForNewTicket();setFieldsForCapReasonAsync();zEmptyAsgnGrp()" onunload="clearParentResumeAction();unload_check()" class=editform>
<PDM_INCLUDE FILE=std_body.htmpl>

Share this post


Link to post
Share on other sites

error could appear in browser's console, you can check it by pressing F12, also you can try to execute code manually from console, type:

ahdframe.zEmptyAsgnGrp();

or

ahdframe.jq("[name=SET.assignee]").val("");
ahdframe.jq("[name=assignee_combo_name]").val("");

and post results here.

Regards, cdtj

Share this post


Link to post
Share on other sites

On pressing F12, the error "Unrecognized expression" were related to below lines and removing these 2 lines, the functionality worked as intended.

ahdframe.jq("[name=SET.assignee]").val("");

ahdframe.jq("[name=SET.group]").val("");

Thank you so much sir, on this customization code assistance.

Have a great day!!

Share this post


Link to post
Share on other sites

Glad to help you but I want to warn that "SET.<attriubte>" is actual attribute that will be posted into DB.

KEY.<attr>, CBX.<attr> or <attr>_combo_name are affects only visible side. Have you tried to click Save button with empty fields? If error appear it's ok but if not you'll need to debug the code and find a way to nullify SET.<attr>s too.

Share this post


Link to post
Share on other sites

I tried saving transfer form with empty fields and it saves without error blanking out both fields.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Announcements

    • Gregg

      12/20/2015

      Until I can transfer the wiki content over to the new Articles, you can find the old content here: http://www.greggsmith.net/wiki.
    • Gregg

      01/06/2016

      A special thanks to brianshs for creating a new site logo!