I have had added CrossItem attribute to the InventoryID field in Appointments page. But, this caused inventory id invalid cast issue.

This is how I have added the attribute to the property.
And here is the stack trace of it. 1/4/2018 10:56:49 AM Error: Error: An error occurred during processing of the field Inventory ID : Specified cast is not valid..
System.InvalidCastException: Specified cast is not valid.
at System.Data.SqlClient.SqlBuffer.get_Int32()
at PX.Data.PXDataRecord.GetInt32(Int32 i)
at PX.Data.PXDBIntAttribute.RowSelecting(PXCache sender, PXRowSelectingEventArgs e)
at PX.Data.PXCache.OnRowSelecting(Object item, PXDataRecord record, Int32& position, Boolean isReadOnly)
at PX.Data.PXCache.OnRowSelecting(Object item, PXDataRecord record, Int32& position, Boolean isReadOnly)
at PX.Data.PXCache`1.Select(PXDataRecord record, Int32& position, Boolean isReadOnly, Boolean& wasUpdated)
at PX.Data.PXView.GetResult(Object[] parameters, PXFilterRow[] filters, Boolean reverseOrder, Int32 topCount, PXSearchColumn[] sorts, Boolean& overrideSort, Boolean& extFilter)
at PX.Data.PXView.Select(Object[] currents, Object[] parameters, Object[] searches, String[] sortcolumns, Boolean[] descendings, PXFilterRow[] filters, Int32& startRow, Int32 maximumRows, Int32& totalRows)
at PX.Data.PXView.SelectMultiBound(Object[] currents, Object[] parameters)
at PX.Data.PXSelectBase`1.selectBound(Object[] currents, Object[] arguments)
at PX.Objects.FS.AppointmentEntry.FSServiceOrder_RowSelected(PXCache cache, PXRowSelectedEventArgs e) in F:\Bld2\AC-FULL2017R201-JOB1\sources\WebSites\Pure\PX.Objects.FS\AppointmentEntry.cs:line 6983
at PX.Data.PXRowSelected.Invoke(PXCache sender, PXRowSelectedEventArgs e)
at PX.Data.PXCache.OnRowSelected(Object item)
at PX.Data.PXCache`1.set_Current(Object value)
at PX.Data.PXGraph.ExecuteSelect(String viewName, Object[] currents, Object[] parameters, Object[] searches, String[] sortcolumns, Boolean[] descendings, PXFilterRow[] filters, Int32& startRow, Int32 maximumRows, Int32& totalRows)
at PX.Data.PXGraph.ExecuteSelect(String viewName, Object[] parameters, Object[] searches, String[] sortcolumns, Boolean[] descendings, PXFilterRow[] filters, Int32& startRow, Int32 maximumRows, Int32& totalRows)
at PX.Web.UI.PXBaseDataSource.ExecuteSelect(String viewName, DataSourceSelectArguments arguments, PXDSSelectArguments pxarguments)
at PX.Web.UI.PXDataSource.ExecuteSelect(String viewName, DataSourceSelectArguments arguments, PXDSSelectArguments pxarguments)
at PX.Web.UI.PXDataSourceView.Select(DataSourceSelectArguments arguments, PXDSSelectArguments swarguments, DataSourceViewSelectCallback callback)
at PX.Web.UI.PXFormDataProvider.DataBind()
at PX.Web.UI.PXBoundPanel.PerformSelect()
at System.Web.UI.Control.DataBindChildren()
at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
at System.Web.UI.Control.DataBindChildren()
at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
at System.Web.UI.Control.DataBindChildren()
at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
at System.Web.UI.Control.DataBindChildren()
at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
at PX.Web.UI.PXBoundPanel.OnAfterSelect(PXFormDataProvider provider)
at PX.Web.UI.PXFormDataProvider.a(IEnumerable A_0)
at PX.Web.UI.PXFormDataProvider.DataBind()
at PX.Web.UI.PXCallbackManager.a(Dictionary`2 A_0, List`1 A_1)
at PX.Web.UI.PXCallbackManager.a(PXCallbackResultMethod A_0, XmlWriter A_1)
at PX.Web.UI.PXCallbackManager.a(PXCallbackResultMethod A_0)
I have had the same issue in Service Orders page too. How do I resolve this issue?
Thanks.

