Skip to main content
Question

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


Forum|alt.badge.img+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

RohitRattan88
Acumatica Moderator
Forum|alt.badge.img+4
  • Acumatica Moderator
  • 253 replies
  • October 11, 2023

@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


Forum|alt.badge.img+1
  • Author
  • Semi-Pro I
  • 184 replies
  • October 12, 2023
RohitRattan88 wrote:

@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?


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2755 replies
  • November 27, 2023

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


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