Udf events String or binary data would be truncated in table CXSRetail.dbo.PurPurchaseOrderDetail',

Udf events String or binary data would be truncated in table CXSRetail.dbo.PurPurchaseOrderDetail',

*****************For Internal purpose*********************



Product Version

iVend 6.6 integrated with SAP B1


Problem Statement 

Used defined field events stuck on Integration Failure Monitor with error message from SAP to iVend


“System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated in table 'CXSRetail.dbo.PurPurchaseOrderDetail', column 'U_ItemCode'. Truncated value: 'MI-UB200-02BE/B'.  The statement has been terminated”


Proposed Solution

Customer created a UDF on purchase order detail and tried to update it by increasing its length due to which there was an error in the integration monitor. Suggested customer UDF once created can't be updated again.As a workground we update the length of udf through sql query.


Steps 

Below are the steps for increasing UDF  length in iVend. 


 1.Check column DataLength for  Table CfgUserDefinedFieldDetail against given user defined field. 


Example:

update CfgUserDefinedFieldDetail

set DataLength=50

where DataLength=15 and UserDefinedTableKey='5b81d90d-6989-43c1-b544-7f970d584b26'



2.Also required to alter length of associated Table UDF. 


Example:

Alter table purpurchaseorderdetail alter column U_ItemCode nvarchar(50)


Constraints / Scenarios 

NA