Roc127
08/26/2020, 2:00 PMRoc127
08/26/2020, 9:59 PMSandii
08/26/2020, 10:02 PMRoc127
08/26/2020, 10:14 PMerictgrubaugh
08/27/2020, 1:04 AMN/currentRecord
module to retrieve the values currently selected in the form fields
2. If you are only trying to leverage the Client Script because it has existing logic in it that you need, then the existing logic should instead be moved to a common custom module; both your Client Script and your Suitelet can then pull in the custom module and leverage it separatelyRoc127
08/27/2020, 7:20 AMbattk
08/27/2020, 8:39 AMbattk
08/27/2020, 8:39 AMbattk
08/27/2020, 8:40 AMRoc127
08/27/2020, 9:31 AM// client script
var data = JSON.stringify(currentRecord);
data = window.btoa(data);
//Then send currentRecord to the suitelet via the client script
scCreateRecordURL = url.resolveScript({
scriptId: 'scriptidSuitelet',
deploymentId: 'deploymentIdSuitelet',
params: {
data: data
}
});
response = <http://https.post|https.post>({
url: scCreateRecordURL,
body: data
});
// Suitelet
if(scriptContext.request.method === 'POST') {
var params = scriptContext.request.parameters;
var response = scriptContext.response;
var data = params.data || '';
if(data !== '') {
data = encode.convert({
string: data,
inputEncoding: encode.Encoding.BASE_64,
outputEncoding: encode.Encoding.UTF_8
});
data = JSON.parse(data);
}
// and by here is when I try to do any operations with the current record, that I am getting errors
....
Roc127
08/27/2020, 9:33 AMbattk
08/27/2020, 10:13 AMJSON.stringify(currentRecord);
to workbattk
08/27/2020, 10:14 AMbattk
08/27/2020, 10:14 AMbattk
08/27/2020, 10:14 AMbattk
08/27/2020, 10:15 AMbattk
08/27/2020, 10:15 AMRoc127
08/27/2020, 10:22 AMbattk
08/27/2020, 10:28 AMbattk
08/27/2020, 10:29 AM