Skip to main content
Solved

A way to hide Inactive Discount Codes on Sales Orders?

  • April 9, 2026
  • 3 replies
  • 47 views

courtneyb
Freshman II
Forum|alt.badge.img

Is there a way or something I am missing that will not show discounts on the line or document level to select if they are expired, a sequence doesn’t exist, or the sequence is marked as inactive? We have old discounts codes we don’t use anymore and even if I have deleted all sequences or inactivated all sequences they still show up to select on sales orders. There is an error when selected, but we don’t want these to even show.

Best answer by nasir

Hi ​@courtneyb 

No, there is no functional configuration (screen checkbox, feature toggle, or setup option) in Acumatica to automatically hide expired, inactive, or sequence-less discount codes (ARDiscount) from sales order selectors (SOLine.DiscountID, SOOrderDiscountDetail.DiscountID). The selector shows all ARDiscount records regardless of DiscountSequence status—inactivating sequences or unchecking Active on ARDiscount reduces errors but doesn't filter the dropdown.

 

3 replies

Forum|alt.badge.img+3

Hello ​@courtneyb I not aware of any functional configuration except to set Uncheck Active checkbox.
but you can use this snippet and keep Uncheck that Active checkbox & it will hide those Inactive discount codes without deleting sequence or code :
 

 [PXMergeAttributes(Method = MergeMethod.Replace)]
[PXSelector(typeof(Search2<
ARDiscount.discountID,
InnerJoin<DiscountSequence,
On<DiscountSequence.discountID, Equal<ARDiscount.discountID>>>,
Where<
DiscountSequence.isActive, Equal<True>,
And<DiscountSequence.isActive, Equal<True>,
And<Where<
DiscountSequence.endDate, IsNull,
Or<DiscountSequence.endDate, GreaterEqual<Current<AccessInfo.businessDate>>>>>>>>))]
protected void _(Events.CacheAttached<SOOrderDiscountDetail.discountID> e)
{
}

you can add this in SO graph.

 

I hope it helps!


Forum|alt.badge.img
  • Jr Varsity I
  • Answer
  • April 13, 2026

Hi ​@courtneyb 

No, there is no functional configuration (screen checkbox, feature toggle, or setup option) in Acumatica to automatically hide expired, inactive, or sequence-less discount codes (ARDiscount) from sales order selectors (SOLine.DiscountID, SOOrderDiscountDetail.DiscountID). The selector shows all ARDiscount records regardless of DiscountSequence status—inactivating sequences or unchecking Active on ARDiscount reduces errors but doesn't filter the dropdown.

 


Forum|alt.badge.img+4
  • Jr Varsity II
  • April 13, 2026

Hi ​@courtneyb ,

can modify the CacheAttached or DAC attribute on ARSalesPrice/DiscountCode selector used on the sales order to add a Where<DiscountSequence.isActive, Equal<True>>