https://netsuiteprofessionals.com logo
#suitescript
Title
# suitescript
d

dansteg

04/07/2022, 1:18 PM
Am I missing something when adding a script to an address form? I've stripped this down completely and it still doesn't work. When I click Save on the address form, it just sits there. I see my console.log output, but the form never submits. If I click save again, it says that I've already submitted the form.
Copy code
...
    function saveRecord(scriptContext) {
        console.log('----about to return TRUE');
        return true;
    }
    return {
        saveRecord: saveRecord
    };
...
d

dansteg

04/07/2022, 5:24 PM
I was really hoping that removing the N/currentRecord module would do the trick, but still not having any success. I even copied the exact code from that article:
Copy code
/**
 * @NApiVersion 2.x
 * @NScriptType ClientScript
 * @NModuleScope SameAccount
 */
define([],function(){
    function saveRecord(context){
        console.log('--- ABOUT TO RETURN TRUE');
        return true;
    }
    return {
        saveRecord: saveRecord
    }
});
b

battk

04/07/2022, 5:32 PM
you missed the first block of code
address client script runs serverside
👍 1
where there isnt a console
d

dansteg

04/07/2022, 6:47 PM
Ahhh. Brilliant. Thank you so much. Eliminating the console.log resolved the issue. I appreciate your time/help with this!