- 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
12-11-2019 12:24 AM
Hi All,
I thought below mentioned approach might be helpful to anyone who is looking to get the value in celledit client script.
Instead of g_scratchpad, we used gs.getSession().putClientData()) in BR to store the value and we accessed the value in celledit CS using g_user.getClientData().
It worked for us!
Regards,
Rishi
PS - Please mark Helpful, Like, or Correct Answer if applicable