How do I set the customer priceLevel in NetSuite to blank/null?

Viewed 111

I've been trying to set a customer object's priceLevel in NetSuite via c# to null/blank/empty value, but NetSuite seems to ignore it when I set the priceLevel to null, or to a new RecordRef with nothing further set.

enter image description here

When I manually set a priceLevel in the NetSuite web app to "blank" it appears as priceLevel = null when I read the customer object back in c#. But I am unable to manually set the priceLevel to null/empty/blank in code.

customer.priceLevel = new RecordRef();

or

customer.priceLevel = null;

Don't seem to work. NetSuite maintains the current non-null setting of priceLevel.

enter image description here

1 Answers

I am not expert in NetSuite, but read the documentation and here is my answer.

customer.priceLevel

priceLevel must be PriceLevel type. Therefore you need to do something like:

customer.priceLevel = new PriceLevel();

or with more details something with out testing it or knowing which price you want to offer:

customer.priceLevel = new PriceLevel()
{
    name = String.Format(“{0:0.0}% Multiplier”, discountPercent), externalId = externalid, discountpct = discountPercent, discountpctSpecified = true
}

I gained my knowledge from this article.

Related