Skip to main content
Question

How to set Discount on Sales Order programmatically


Forum|alt.badge.img
  • Jr Varsity III
  • 23 replies

For a newly created Sales Order I want to add positiv or negativ discounds, on document and line level.

Discounts by percentage work find. On document level I create a new SOOrderDiscountDetail, set Type = ‘B’, IsManual = true and DiscountPct. On line level I just set SOLine.DiscPct.

But I have problems to set discounts by amount. If I set SOOrderDiscountDetail.DiscountAmt or SOLine.DiscAmt, it is set back to 0,0.

The lines and discount details are created any persisted like this.

SOOrderEntry.Transactions.Insert(new SOLine{...});

SOOrderEntry.DiscountDetails.Insert(new SOOrderDiscountDetail{...});

SOOrdeEntry.Actions.PressSave();

 

What is the correct way to set a discount amount on document and line level code?

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings