Marconkynf
Marconkynf

Reputation: 1

Suitescript 2.0 Create Discount Item with % rate

I'm tried to create a discount item with suitescript 2.0, but I get the following error:

"message": "You have entered an Invalid Field Value 70.0% for the following field: rate"

                    fieldId: 'rate',
                    value: (rate_discount.toFixed(1))+'%'
                });

On Netsuite UI, I can add % to Rate field, and I need it to item can be rate by percent.

How can I create this item type with % rate?

Thanks in advance.

Upvotes: 0

Views: 1566

Answers (1)

ehcanadian
ehcanadian

Reputation: 1784

You can use setText.

var discountItem = record.create({type: record.Type.DISCOUNT_ITEM, isDynamic:true});
discountItem.setValue({fieldId:'itemid', value:'testDiscountItem'});
discountItem.setText({fieldId:'rate',text:'8.5%'});
discountItem.save();

Upvotes: 6

Related Questions