Solved

Error: Updating the 'RelationGroup' record failed because data in some field is too long.

  • 3 January 2024
  • 3 replies
  • 76 views

Userlevel 4
Badge

Upon Adding of New Restriction Groups,

The system gave me this error.

Would you help me to solve this issue?

 

icon

Best answer by budi12 16 January 2024, 04:01

View original

3 replies

Badge +18

Hello @Fie ,

Please give us more information:

What Entities are used in the above restriction group? 

Look at these entities and make sure their ID’s, descriptions and other key fields do not exceed the limit. If possible, temporarily make the Segmented Key segments longer and then see whether any ID’s for the entities now appear to have even longer ID’s than the rest. 

What information is in the Trace (Tools → Trace)? 

Post the details here. Thank you!

Laura

Hi! We are running into the same issue.

ERROR TRACE:

System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at PX.Data.PXDatabaseProviderBase.ExecuteNonQuery(IDbCommand command) at PX.Data.PXDatabaseProviderBase.insert(Type table, PXDataFieldAssign[] pars, String commandText, Boolean switchAllowed, companySetting setting) ClientConnectionId:45efa41b-4783-450f-9ad6-0561e588e80f Error Number:8152,State:30,Class:16 at PX.Data.PXDatabaseProviderBase.insert(Type table, PXDataFieldAssign[] pars, String commandText, Boolean switchAllowed, companySetting setting) at PX.Data.PXDatabaseProviderBase.Insert(Type table, PXDataFieldAssign[] pars) at PX.Data.PXCache`1.PersistInserted(Object row, Boolean bypassInterceptor) at PX.Data.PXCache`1.Persist(PXDBOperation operation) at PX.Data.PXGraph.Persist() at PX.SM.BaseAccess.Persist() at PX.Objects.AP.APAccess.Persist() at PX.Data.PXSave`1.<HandlerInternal>g__Persist|3_2() at PX.Data.PXSave`1.<HandlerInternal>d__3.MoveNext() at PX.Data.PXAction`1.<Press>d__38.MoveNext() at PX.Data.PXAction`1.<Press>d__38.MoveNext() at PX.Web.UI.PXBaseDataSource.tryExecutePendingCommand(String viewName, String[] sortcolumns, Boolean[] descendings, Object[] searches, Object[] parameters, PXFilterRow[] filters, DataSourceSelectArguments arguments, Boolean& closeWindowRequired, Int32& adapterStartRow, Int32& adapterTotalRows) at PX.Web.UI.PXBaseDataSource.ExecuteSelect(String viewName, DataSourceSelectArguments arguments, PXDSSelectArguments pxarguments)

Upon Adding of New Restriction Groups,

The system gave me this error.

Would you help me to solve this issue?

 

Hi There, I got same error, I try to extend column length and the error disappear.
This is my script to extend column length related table.
 

/** THIS IS SCRIPT TO EXTEND ALL GroupMask Column ON ANY Table **/

DECLARE @P0 NVARCHAR(MAX)='YOUR_DB_NAME';
DECLARE @SQL NVARCHAR(MAX);

DECLARE tmp CURSOR FOR
SELECT CONCAT('alter table ',a.TABLE_NAME,' alter column ',a.COLUMN_NAME, ' [varbinary](128) NOT NULL;') SQL_SCRIPT
FROM INFORMATION_SCHEMA.COLUMNS a
INNER JOIN sys.objects b ON b.name=a.TABLE_NAME
WHERE TABLE_CATALOG=@P0
AND DATA_TYPE='varbinary'
AND CHARACTER_MAXIMUM_LENGTH=128
AND COLUMN_NAME=N'GroupMask'
AND IS_NULLABLE='NO'
AND b.type != N'V'
OR (TABLE_NAME=N'Neighbour' AND DATA_TYPE='varbinary')
OPEN tmp
FETCH NEXT FROM tmp INTO @SQL
WHILE @@FETCH_STATUS=0
BEGIN
PRINT @SQL
EXEC SP_EXECUTESQL @SQL
FETCH NEXT FROM tmp INTO @SQL
END
CLOSE tmp
DEALLOCATE tmp
GO


Do with your own risk.

Thank you.

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