Anyone bumpted into issues with commitLine in Chro...
# suitescript
s
Anyone bumpted into issues with commitLine in Chrome? I have a ClientScript modifying item lines which works in Firefox but struggles to change values if it needs to switch SKU and doesn't seem to actually commit the line ever.
d
I had an issue where script precedence seemed to be wrong and on changing, a native NS script was reverting the value immediately after the client script. I had lengthy discussion with support who confirmed custom scripts should always run after NS native scripting. A defect got raised and they said they had a fix - but I've never been told it got deployed and the case is still open from late last year.
That issue was specific to Chrome.
b
share the code
s
Relevant snippets:
Copy code
[...]
if (item != targetItem) {
    CURRENT_RECORD.selectLine({ sublistId: 'item', line: i });
    setLineItemValue('item', targetItem, i);
    setLineItemValue('price', price, i);
    setLineItemValue('rate', rate, i);
    CURRENT_RECORD.commitLine({ sublistId: 'item' });
}
[...]
Copy code
function setLineItemValue(field, value, line) {
    CURRENT_RECORD.setCurrentSublistValue({
        sublistId: 'item',
        fieldId: field,
        value: value,
        line: line,
    });
}
Expected outcome: User selects value in dropdown, item line updated and committed Actual outcome: User selects value in dropdown, SKU changed, other values as default, UI OK/Cancel prompt remains
b
s
Perfect, problem solved. Thanks @battk!
and also @Dominic B! Good to know that there's known issues out there 🙂
116 Views