Skip to main content

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:

 

                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]
ePXForeignReference(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?

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

sPXMergeAttributes(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


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

tPXMergeAttributes(Method = MergeMethod.Append)]
bPXRemoveBaseAttribute(typeof(PXDefaultAttribute))]
bPXDBDefault(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?


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


Reply