unable to see any changes on Incident table

neelamallik
Giga Contributor
function onSubmit() {

    var knowledgeFlag = g_form.getValue('knowledge');
    var knowledgeArticle = g_form.getValue('knowledge_article');

    if (knowledgeFlag === 'true' && knowledgeArticle.trim() === '') {
        alert('Please select a before submitting the form');
        return false;
    }

    return true;


}
2 REPLIES 2

vaishali231
Giga Guru

@neelamallik 
The issue is not with the Incident table.
Your script is a Client Script (onSubmit) so it only runs in the browser and does not update or modify any Incident table data.

What your script actually does
It only validates the form before submission.
If the condition fails, it blocks the submit.
If the condition passes, the record is saved normally.

function onSubmit() {
    var knowledgeFlag = g_form.getValue('knowledge');
    var knowledgeArticle = g_form.getValue('knowledge_article');
    if (knowledgeFlag == 'true' && !knowledgeArticle) {
        alert('Please select a knowledge article before submitting the form');
        return false;
    }
    return true;
}

 

*************************************************************************************************************
If this response helps, please mark it as Accept as Solution and Helpful.
Doing so helps others in the community and encourages me to keep contributing.

Regards
Vaishali Singh

Mohammed8
Giga Sage

Hi @neelamallik,

Can you please clarify the requirement here?

Also, confirm where this script is running. This is an onSubmit Client Script, so it must be configured on the Incident form to take effect. If it’s placed on another form it won’t reflect on Incident form

 

Regards,

Mohammed Zakir