UI Action not updating State field to pending as expected.

AkashYen007
Tera Guru

Hi Team,

 

I have been working on this Request info custom script where I wanted update the state field when the Request Info button is clicked but I found the script was used to run previously as expected but suddenly after the vancouver release we found this is not working as expected. The script details are as below. Let me know if you required anymore details.

 

AkashYen007_0-1717485110190.png

AkashYen007_1-1717485240440.png

 

function pendingCase() {
    var flag = false;
    g_form.setValue('state', 18);
    if (g_form.getValue('u_additional_comments') == '') {
        g_tabs2Sections.markTabMandatoryByField('Notes');
        var tabIndex = g_tabs2Sections.findTabIndex('u_additional_comments');
        if (tabIndex > -1) {
            g_tabs2Sections.setActive(tabIndex);
            g_tabs2Sections.markTabMandatoryByField('u_additional_comments');
        }
        g_form.setMandatory('u_additional_comments', true);
        g_form.showFieldMsg('u_additional_comments', getMessage('Additional Comments Required.'), 'error', false);
        g_form.addErrorMessage("The following mandatory fields are not filled in: Additional Comments (Requester Visible) and Status Reason ");
        flag = true;
    }

    if (flag)
    return false
    gsftSubmit(null, g_form.getFormElement(), 'requestMoreInformation');
}

if (typeof window == 'undefined')
    caseReopen();

function caseReopen() {
    current.state = 18;
    current.update();
    action.setRedirectURL(current);
}
 
State is not updating it keeps in Open state even after multiple retries.
Any help is appriciated.
Thanks.
2 REPLIES 2

Jitendra Diwak1
Kilo Sage

Hi @AkashYen007,

 

you may try to put state backend value in qoutes current.state = '18';

 

Thanks

Jitendra

Please accept my solution if it works for and thumps up.

Hi @Jitendra Diwak1,

 

Yes our backend value for pending state is 18 and I tried with '18' also but same.

AkashYen007_0-1717495118274.png

 

Thanks.