Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

adding a message to the top of the from

brown9394
Tera Expert

Hello Experts,

I have a client script that checks if the record is new and executes a message on top of the screen for users. How do I extend this client script to show the same message after submit (record is still in the same 'draft' state after submit) if it's not 'New'?

function onLoad() {

        if (g_form.isNewRecord()) {

                  g_form.addInfoMessage('User message here.');

        }

}

11 REPLIES 11

Abhinay Erra
Giga Sage

Use onSubmit client script and and put the same script in there


Hi Abhinay, I've tried that before, it did not work.



function onSubmit() {


    //Type appropriate comment here, and begin script below


              if (g_form.isNewRecord()) {


                  g_form.addInfoMessage('User message here.');


        }


}


fkhan
Kilo Guru

Try this:



function onSubmit() {


        if (!g_form.isNewRecord()) {


                  g_form.addInfoMessage('User message here.');


        }


}


Thanks,


Farukh


Hi Farukh,



I just gave that a try with "!" in front of g_form - not working.