ec
08/22/2024, 9:06 PMCeligo AI
08/22/2024, 9:06 PMAI generated answer (using internal Slack threads):Based on the conversations, it seems that when setting a rate as a percentage for discounts or markups via SuiteScript, you should avoid using the '%' symbol. Instead, you should only use the numeric value. For example, if you want to set a discount rate of 5%, you should only pass the number 5, not '5%'. Here is an example of how you can set the rate:
javascript
rec.setSublistValue({
sublistId: 'item',
fieldId: 'rate',
value: 5, // not '5%'
line: lineCount
});
If you want to set a negative percentage, you can do so by passing the negative number. For example, for a discount rate of -5%, you should pass -5.
javascript
rec.setSublistValue({
sublistId: 'item',
fieldId: 'rate',
value: -5, // not '-5%'
line: lineCount
});
However, if you want to set the rate as a string, you can use the setSublistText
method instead of setSublistValue
. Here is an example:
javascript
rec.setSublistText({
sublistId: 'item',
fieldId: 'rate',
text: '5', // not '5%'
line: lineCount
});
Please note that the rate field accepts number data, and the 'Invalid Field Value' error occurs when the value is not a number or a valid string representation of a number.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
08/22/2024, 9:07 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.877882421
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.863292
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.856646597
Celigo AI
08/22/2024, 9:07 PM