A string value is needed to be passed/set in SuiteScript and it contains single quotes/double quotes. In programming, string values are usually enclosed in single/double quotes and single/double quotes within the value will cause syntax errors.
- For a string value with double quotes in the string, enclose the string value with double quotes in a single quotes, i.e:
- For single quotes within the string, use a 'backslash' character to escape the single quote, i.e:
- An example of combination of single and double quotes, i.e:
- An example of using Unicode values for the special characters:
nlapiSubmitField('salesorder', '820', 'custbody11', '"Test Value"', true);
nlapiSubmitField('salesorder', '820', 'custbody11', '\'Test Value\'', true);
nlapiSubmitField('salesorder', '820', 'custbody11', '\'Test Value\', "I am a continuation of the string"', true);
nlapiSubmitField('salesorder', '820', 'custbodysubscriptiontype', '\u0027Test Value\u0027, \u0022I am a continuation of the string\u0022', true);
No comments:
Post a Comment