- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2017 11:49 AM
I am trying to perform some validation check in list layout using Display BR with g_scratchpad & onCellEdit CS. But it is giving me error as:
'g_scratchpad is not defined' --I am getting this error in console of all 3 broswers i.e. (Chrome, Moz & IE)
Here is my code:
****************BR***************
(function executeRule(current, previous /*null when async*/) {
// Add your code here
g_scratchpad.tpid = current.u_trading_partner_cert_id;
})(current, previous);
********onCellEdit CS*********
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
//Type appropriate comment here, and begin script below
if(g_scratchpad.tpid != ''){
alert('This is an integration record & cannot be updated from list layout...');
}
callback(saveAndClose);
}
If its not possible to call g_scratchpad from onCellEdit CS, please suggest me some alternatives (preference is to perform this validation at client side only)
TIA.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2017 11:56 AM
Hello Ajit,
Display business rule is executed when you open the form. Hence in this case, Display BR is not executed and so is the error i.e "g_scratchpad not defined".
You will have to create a BEFORE business rule and then perform validations.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2017 11:56 AM
Hello Ajit,
Display business rule is executed when you open the form. Hence in this case, Display BR is not executed and so is the error i.e "g_scratchpad not defined".
You will have to create a BEFORE business rule and then perform validations.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2017 02:49 PM
Let me know if that answered your question. If so, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list. Thank you
How To Mark Answers Correct From Community Inbox
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2017 02:55 PM
Done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2018 07:45 AM
Sorry to ressurect this,
Would the business Rule be a Before Query business rule?