Skip to main content

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.

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.


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.


Reply