Skip to main content
Answer

Modified PXRestrictor fails validation (customized Sales Order customer id field)

  • March 12, 2025
  • 3 replies
  • 69 views

Forum|alt.badge.img

All,

We’re currently on 23R2 and in the process of upgrading to 24R2, testing it on the supplied sandbox.

One change we noted (I think this happened back in 24R1) -- customers on credit hold are now selectable from the Customer field in the sales order screen. We DO NOT want to place orders for Customers on credit hold. :) 

So I changed the code (probably incorrectly)

original attribute:

[PXDefault]
[Customer(
typeof(Search<BAccountR.bAccountID, Where<True, Equal<True>>>), // TODO: remove fake Where after AC-101187
Visibility = PXUIVisibility.SelectorVisible,
DescriptionField = typeof(Customer.acctName),
Filterable = true)]
[CustomerOrOrganizationInNoUpdateDocRestrictor]
[PXRestrictor(typeof(Where<Optional<SOOrder.isTransferOrder>, Equal<True>,
Or<Customer.status, IsNull,
Or<Customer.status, Equal<CustomerStatus.active>,
Or<Customer.status, Equal<CustomerStatus.oneTime>,
Or<Customer.status, Equal<CustomerStatus.creditHold>>>>>>),
AR.Messages.CustomerIsInStatus,
typeof(Customer.status))]
[PXForeignReference(typeof(Field<SOOrder.customerID>.IsRelatedTo<BAccount.bAccountID>))]

new attribute:

[PXDefault]
[Customer(
typeof(Search<BAccountR.bAccountID, Where<True, Equal<True>>>), // TODO: remove fake Where after AC-101187
Visibility = PXUIVisibility.SelectorVisible,
DescriptionField = typeof(Customer.acctName),
Filterable = true)]
[CustomerOrOrganizationInNoUpdateDocRestrictor]
[PXRestrictor(typeof(Where<Optional<SOOrder.isTransferOrder>, Equal<True>,
Or<Customer.status, IsNull,
Or<Customer.status, Equal<CustomerStatus.active>,
Or<Customer.status, Equal<CustomerStatus.oneTime>>>>>),
AR.Messages.CustomerIsInStatus,
typeof(Customer.status))]
[PXForeignReference(typeof(Field<SOOrder.customerID>.IsRelatedTo<BAccount.bAccountID>))]

I simply removed the Or<Customer.status, Equal<CustomerStatus.oneTime> from the restrictor.

But the validation fails with the following:

 

 \App_RuntimeCode\PX_Objects_SO_SOOrder_extensions.cs(49): error CS0122: 'CustomerOrOrganizationInNoUpdateDocRestrictorAttribute' is inaccessible due to its protection level

\App_RuntimeCode\PX_Objects_SO_SOOrder_extensions.cs(49): error CS0122: 'CustomerOrOrganizationInNoUpdateDocRestrictorAttribute' is inaccessible due to its protection level

[2025-03-12 14:26:46.620] Compiler time, in seconds: 5.1147322

[2025-03-12 14:26:46.625] Validation failed.

Any help appreciated. :)

Best answer by aiwan

Hi ​@swartzfeger 

 

Try to remove the [CustomerOrOrganizationInNoUpdateDocRestrictor] from your field declaration.

 

Checking release notes between 23R2 to 24R2 might also be useful, if you’re lucky, Acumatica will have described the attribute being removed, and if you’re even luckier, what replaced it.

 

Release notes are very comprehensive but occasionally things slip through the cracks.

 

Aleks 

3 replies

Forum|alt.badge.img+8
  • Captain II
  • Answer
  • March 12, 2025

Hi ​@swartzfeger 

 

Try to remove the [CustomerOrOrganizationInNoUpdateDocRestrictor] from your field declaration.

 

Checking release notes between 23R2 to 24R2 might also be useful, if you’re lucky, Acumatica will have described the attribute being removed, and if you’re even luckier, what replaced it.

 

Release notes are very comprehensive but occasionally things slip through the cracks.

 

Aleks 


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • March 12, 2025

Hi ​@swartzfeger 

 

Try to remove the [CustomerOrOrganizationInNoUpdateDocRestrictor] from your field declaration.

 

Checking release notes between 23R2 to 24R2 might also be useful, if you’re lucky, Acumatica will have described the attribute being removed, and if you’re even luckier, what replaced it.

 

Release notes are very comprehensive but occasionally things slip through the cracks.

 

Aleks 

Thanks Aleks, I will re-publish as soon as everyone logs off… appreciate your input!


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • March 13, 2025

Hi ​@swartzfeger 

 

Try to remove the [CustomerOrOrganizationInNoUpdateDocRestrictor] from your field declaration.

 

Checking release notes between 23R2 to 24R2 might also be useful, if you’re lucky, Acumatica will have described the attribute being removed, and if you’re even luckier, what replaced it.

 

Release notes are very comprehensive but occasionally things slip through the cracks.

 

Aleks 

This was perfect Aleks -- removing [CustomerOrOrganizationInNoUpdateDocRestrictor] did the trick! And good tip on the release notes, thank you...