Coding support with Case Solution Proposed UI Action

zag
Tera Expert

Hi guys 

 

I have a Solution Proposed UI Action acting on the Case table. Basically I want to validate that the Analyst has put in External comments in the comments field before the state changes. I have the code but getting some weird results I cannot explain. I would appreciate any insight. 

 

Here is the UI Action details

zag_0-1711371994638.png

this is the custom script 

function validateSolution() {
    // Cache frequently accessed values
    var form = g_form;

    // Define required fields
    var requiredFields = ['comments'];

 
 

    // Validate 'comments' field
    if (!form.getValue('comments')) {
        form.addErrorMessage('Notes Tab: Please add solution comments for the customer.');
        form.setMandatory('comments', true);
        form.showFieldMsg('comments', 'Comments are mandatory while proposing a solution.', 'warning');
    }

    // Submit the form
    gsftSubmit(null, form.getFormElement(), 'proposeSolution');
}

// Execute propose_solution in the server context
if (typeof window === 'undefined') {
    propose_solution();
}

// Process state flow
function propose_solution() {
    new global.StateFlow().processFlow(currentRecord, '8db14a63c3123100d6d210c422d3ae7a', 'manual');
}
 
Here is where it becomes interesting 
zag_1-1711372097091.png
Normally this is what you see , the comment box followed by the Post button and the Internal Notes check box. 

When you click on Solution Proposed and trigger the above code you will see both the External Notes & Internal Notes at the same time AND the post/internal notes Actions gone. see pic below 

zag_2-1711372330176.png

any help would be greatly appreciated

 

 
0 REPLIES 0