OOB Save button hide in scoped app

Khalid9030
Tera Contributor

Hello All,

 

Need help for the below 

 

When a form is submitted, the out-of-box (OOB) save button/context menu save should not be visible if the user opens the same record again. Is it possible to achieve this requirement?
Additionally, we have a custom submit button. When the user clicks on it, the draft field is updated to true, and the form redirects to the list view. When the user reopens the same form, the submit button is hidden based on the condition in the submit button UI action: current.u_draft == true.
Is there a way to apply a similar condition to hide the OOB save button/context menu save?

Note : this is built in scoped application table

 

Thanks in advance:)

4 REPLIES 4

AnveshKumar M
Tera Sage
Tera Sage

Hi @Khalid9030 

 

Do you want the save button to be hidden for that user who saved it earlier or for the every user? And May I know the table name?

 

 

Thanks,
Anvesh

@AnveshKumar M 

Thanks for your reply.

its for every user. and the table is custom table which is created in scoped application 

Rajesh Chopade1
Mega Sage

Hi @Khalid9030 

 

You can create the 'OnLoad' client script and check the state of ticket (i.e. closed), then hide UI Action and context menu as bellow:

// Hide the save button and the save option in the context menu
        g_form.setSaveHidden(true);
        g_form.removeMenuOption('save');

I hope my answer helps you to resolve your issue if yes, mark my answer correct & helpful.

THANK YOU

rajesh chopade

@Rajesh Chopade1 

I have used this but its not working PFA. please correct my code if its wrong 

function onLoad() {
    //Type appropriate comment here, and begin script below

    var draft = g_form.getValue('u_draft');

    g_form.addInfoMessage('the draft' + draft);

    if (draft == 'false') {

        g_form.addInfoMessage('if block is working');

        g_form.setSaveHidden(true);
        g_form.removeMenuOption('save');

    }

}