Question

Custom Vendor Status Value, Allow on selecting on PO Entry (and other Vendor related Transactions)

  • 10 October 2023
  • 3 replies
  • 33 views

Userlevel 5
Badge +1

Hi All,

 

We are currently running into an issue where we cannot use a new Vendor Status as the Selection of Vendors on a Purchase Order is limited to Active, One-Time and hold Payments.

This seems to be limited in the Vendor Attribute

Doing some research, I also found out that we Vendor and PO Vendor Attributes with the differences that the PO Vendor is excluding Employee Records except for Transfer PO Types.

 

We tried the same logic for the Vendor Attribute as we wanted to control which Statuses are showing up.

Any ideas on how we can expand the Attributes for VendorID on the PO.POOrder Screen?
Original Attribute:
[POVendor(Visibility = PXUIVisibility.SelectorVisible, DescriptionField = typeof(Vendor.acctName), CacheGlobal = true, Filterable = true)]
[PXDefault]
[PXForeignReference(typeof(FK.Vendor))]

The last thing I tried that got me the closest is the following:

 

[Vendor(typeof(Search<Vendor.bAccountID,
                Where2<Where<Vendor.type, NotEqual<BAccountType.employeeType>>,
                And<Vendor.status, NotEqual<VendorStatus.inactive>>>>),
                Visibility = PXUIVisibility.SelectorVisible, DescriptionField = typeof(Vendor.acctName), CacheGlobal = true, Filterable = true)]

[PXDefault]
[PXForeignReference(typeof(POOrder.FK.Vendor))]

Yet, I get the error that the Vendor Status is invalid when I select a Vendor with the new Status. Any ideas?


3 replies

Userlevel 7
Badge +4

@krausef77 

You could try using PXRemoveBaseAttribute to remove desired attribute from a DAC field and then add desired attribute.

Here’s some reference,

Remove base Attribute with Customization - Acumatica Developers Blog

Append and Replace of DACs Attributes - Acumatica Developers Blog

example: Override AccountAttribute | Community (acumatica.com)

 

From customization guide:

 

Then replacing PXDefaultAttribute with PXDBDefaultAttribute looks as shown in the following code.

[PXMergeAttributes(Method = MergeMethod.Append)]
[PXRemoveBaseAttribute(typeof(PXDefaultAttribute))]
[PXDBDefault(typeof(SOShipment.siteID), 
 PersistingCheck = PXPersistingCheck.Nothing)]
protected void SOOrderShipment_SiteID_CacheAttached(PXCache sender) { }

In this example, all existing attributes are reused by the PXMergeAttributes attribute, the PXDefaultAttribute is removed by the PXRemoveBaseAttribute attribute, and the new PXDBDefault attribute is declared

Userlevel 5
Badge +1

@krausef77

You could try using PXRemoveBaseAttribute to remove desired attribute from a DAC field and then add desired attribute.

Here’s some reference,

Remove base Attribute with Customization - Acumatica Developers Blog

Append and Replace of DACs Attributes - Acumatica Developers Blog

example: Override AccountAttribute | Community (acumatica.com)

 

From customization guide:

 

Then replacing PXDefaultAttribute with PXDBDefaultAttribute looks as shown in the following code.

[PXMergeAttributes(Method = MergeMethod.Append)]
[PXRemoveBaseAttribute(typeof(PXDefaultAttribute))]
[PXDBDefault(typeof(SOShipment.siteID), 
 PersistingCheck = PXPersistingCheck.Nothing)]
protected void SOOrderShipment_SiteID_CacheAttached(PXCache sender) { }

In this example, all existing attributes are reused by the PXMergeAttributes attribute, the PXDefaultAttribute is removed by the PXRemoveBaseAttribute attribute, and the new PXDBDefault attribute is declared

Hi Rohit
Thanks for your resources. It looks like the proposed solution didn’t work for the original Post due to a PXRestrictor on the Attribute. This also applies for the Vendor and PO Vendor Attributes.

Any idea on how to accomplish this?

Userlevel 7
Badge

Hi @krausef77 were you able to find a solution? Thank you!

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved