I'm trying to use the INLotSerialNbrAttribute on my custom screen. I get below error message. I think it must have something to do with some screens using the split function. For my screen I just want to allow a single Serial Number per line similar to the adjustment screen. Do I need to add something on my graph to handle this or should I create my own selector?
Here's the definition of my DAC field
#region LotSerialNbr
[PXUIField(DisplayName = "Lot Serial Nbr")]
[INLotSerialNbr(typeof(AHSVendorCoreDetails.inventoryID),
typeof(AHSVendorCoreDetails.subItemID), typeof(AHSVendorCoreDetails.locationID),
PersistingCheck = PXPersistingCheck.Nothing)]
public virtual string LotSerialNbr { get; set; }
public abstract class lotSerialNbr : PX.Data.BQL.BqlString.Field<lotSerialNbr> { }
#endregion
[PXArgumentException: IN Error: The specified type AHSVendorCore.AHSVendorCoreDetails must implement the PX.Objects.IN.ILSMaster interface. Parameter name: itemType]
PX.Data.PXCacheCollection.get_Item(Type key) +1547
PX.Data.PXGraph.GetStateExt(String viewName, Object data, String fieldName) +383 PX.Web.UI.PXGrid.bk() +345 PX.Web.UI.PXGrid.d() +64 PX.Web.UI.PXGrid.InitColumnsLayout() +262 PX.Web.UI.PXGrid.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +498
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +230 System.Web.UI.Control.EnsureChildControls() +130 System.Web.UI.Control.PreRenderRecursiveInternal() +66
System.Web.UI.Control.PreRenderRecursiveInternal() +297
System.Web.UI.Control.PreRenderRecursiveInternal() +297
System.Web.UI.Control.PreRenderRecursiveInternal() +297
System.Web.UI.Control.PreRenderRecursiveInternal() +297
System.Web.UI.Control.PreRenderRecursiveInternal() +297
System.Web.UI.Control.PreRenderRecursiveInternal() +297
System.Web.UI.Control.PreRenderRecursiveInternal() +297
System.Web.UI.Control.PreRenderRecursiveInternal() +297
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7479
Edit Here's the definition of the grid columns.
<px:PXGridColumn DataField="LineNbr" Width="70" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="InventoryID" Width="70" ></px:PXGridColumn>
<px:PXGridColumn DataField="TranDesc" Width="280" ></px:PXGridColumn>
<px:PXGridColumn DataField="UOM" Width="72" ></px:PXGridColumn>
<px:PXGridColumn DataField="ReturnQty" Width="100" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="SiteID" Width="140" ></px:PXGridColumn>
<px:PXGridColumn DataField="LocationID" Width="70" ></px:PXGridColumn>
<px:PXGridColumn DataField="LotSerialNbr" Width="220" /></Columns></px:PXGridLevel></Levels></px:PXGrid></Template></px:PXTabItem></Items>
Edit 2 Here's the updated version with the row template showing the lot serial field is a selector. I'm still getting the same issue.
<px:PXGrid SyncPosition="True" runat="server" ID="CstPXGrid2" Height="473px" SkinID="Details" Width="100%" DataSourceID="">
<Levels>
<px:PXGridLevel DataMember="Details" >
<Columns>
<px:PXGridColumn DataField="LineNbr" Width="70" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="InventoryID" Width="70" ></px:PXGridColumn>
<px:PXGridColumn DataField="TranDesc" Width="280" ></px:PXGridColumn>
<px:PXGridColumn DataField="UOM" Width="72" ></px:PXGridColumn>
<px:PXGridColumn DataField="ReturnQty" Width="100" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="SiteID" Width="140" ></px:PXGridColumn>
<px:PXGridColumn DataField="LocationID" Width="70" ></px:PXGridColumn>
<px:PXGridColumn DataField="LotSerialNbr" Width="220" ></px:PXGridColumn></Columns>
<RowTemplate>
<px:PXSelector runat="server" ID="CstPXSelector12" DataField="LotSerialNbr" ></px:PXSelector>
<px:PXNumberEdit runat="server" ID="CstPXNumberEdit13" DataField="LineNbr" />
<px:PXSegmentMask runat="server" ID="CstPXSegmentMask14" DataField="InventoryID" />
<px:PXTextEdit runat="server" ID="CstPXTextEdit15" DataField="TranDesc" />
<px:PXSelector runat="server" ID="CstPXSelector16" DataField="UOM" />
<px:PXNumberEdit runat="server" ID="CstPXNumberEdit17" DataField="ReturnQty" />
<px:PXSegmentMask runat="server" ID="CstPXSegmentMask18" DataField="SiteID" />
<px:PXSegmentMask runat="server" ID="CstPXSegmentMask19" DataField="LocationID" /></RowTemplate></px:PXGridLevel></Levels></px:PXGrid>
I think you just need to make sure your DAC implements the ILSMaster interface and related fields. If not fully needed just make all required fields Non db fields (Ex: PXInt vs PXDBInt) with unbound defaults to provide some default information. For example InvtMult helps determine if receipt or issue transaction and you can have it default to -1, 0, or 1 depending on your requirements.
Ex:
public class AHSVendorCoreDetails : PX.Data.IBqlTable, ILSMaster
{
// Include all required fields from ILSMaster (can be bound or unbound fields)
}