Solved

LocationAvail attribute not working with 23R2

  • 15 May 2024
  • 2 replies
  • 35 views

We need to populate warehouse location on purchase receipt screen.

[LocationAvail(typeof(POReceiptLine.inventoryID), typeof(POReceiptLine.subItemID), typeof(POReceiptLine.costCenterID),
            typeof(POReceiptLine.siteID), typeof(POReceiptLine.tranType), typeof(POReceiptLine.invtMult),
            DisplayName = "To Location ID", BqlTable = typeof(PX.Objects.PO.POReceipt))]

public virtual int? UsrTransferDestLocID { get; set; }
        public abstract class usrTransferDestLocID : PX.Data.BQL.BqlInt.Field<usrTransferDestLocID> { }

I added source code.

On purchase receipts screen when we click  “+” button it gives an error.

Error Message: 

UsrTransferDestLocID is our custom field.

icon

Best answer by darylbowman 15 May 2024, 15:19

View original

2 replies

Badge +12

I don’t see anything wrong with the code you posted. However, I suspect the error could be arising from the field being used elsewhere. Here is a StackOverflow post indicating possibilities for receiving this error.

I removed this attribute and use custom code.

[PXSelector(typeof(Search<INLocation.locationID, Where<INLocation.siteID, Equal<Current<usrTransferDestSiteID>>>>),
typeof(INLocation.locationCD),
typeof(INLocation.descr),
typeof(INLocation.active),
typeof(INLocation.primaryItemID),
typeof(INLocation.primaryItemClassID),
typeof(INLocation.receiptsValid),
typeof(INLocation.salesValid),
typeof(INLocation.transfersValid),
DescriptionField = typeof(INLocation.descr),
SubstituteKey = typeof(INLocation.locationCD))]
public virtual int? UsrTransferDestLocID { get; set; }
public abstract class usrTransferDestLocID : PX.Data.BQL.BqlInt.Field<usrTransferDestLocID> { }

This works for me.

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