Suite Deal
02/28/2020, 8:19 PM@NScriptType UserEventScript
var field = scriptContext.form.addField({
id: 'custpageinjectcode',
type: 'INLINEHTML',
label: 'Inject Code'
});
field.defaultValue = "<script> ...var desiredText = document.querySelector(...).innerText; alert(desiredText);'jQuery(function($){ require(['/SuiteScripts/clientSuiteScript.js'], function(mod){ mod.pageInit();});});'</script>"
@NScriptType ClientScript
function (currentRecord) {
function pageInit() {
window.addEventListener("message", browser_ReceiveMessage, false);
console.log('Added Listener...');
}
return {
pageInit: pageInit
}
function browser_ReceiveMessage(event) {
var curRec = currentRecord.get();
console.log('Current Record ID', curRec.id)
}//end function
}//end main function
);//end script
How would I go about passing the 'desiredText' variable result in UserEventScript (the scraped data) to the ClientScript so that I can place it into a normal text variable and use it on the form?battk
02/28/2020, 8:27 PMEric B
02/28/2020, 8:33 PMSuite Deal
02/28/2020, 8:42 PMbattk
02/28/2020, 8:44 PMSuite Deal
02/28/2020, 8:45 PMbattk
02/28/2020, 8:45 PMbattk
02/28/2020, 8:46 PM