Is it possible to set the price level on a transac...
# suitescript
j
Is it possible to set the price level on a transaction item so the calling code does not need to know the item rate? We have been trying the following...
Copy code
salesOrder.setCurrentSublistValue({
    sublistId: 'item',
    fieldId: 'price',
    value: priceLevel, // 11 - valid price level id
    forceSyncSourcing: true
});
Which results in the following error:
You have entered an Invalid Field Value 11 for the following field: price
I have seen examples of people setting the price level to -1 (custom), so it seems like this should work, but it seems like we are missing something. If anyone has tried this we would appreciate any tips you can provide. Thanks.
r
How you are retrieving priceLevel? If hard coded, try another type. String?
b
set the item first
👍🏻 1
j
We are pulling the price level from the customer record. We have tried the value (the ID) as a number and as a string. We have also tried the text version of the price level. The item is the first value we are setting in the sublist line. We have also tried it in standard and dynamic mode.
b
what does the code look like
j
I believe we just figured it out, one of the items we were trying to add did not have a price set on the price level the customer was set to. So the error message was accurate we just misinterpreted it. Thanks for trying to help.