Reputation: 18051
When saving a SalesLine
, changing only the Name
field, the doUpdate
method will occasionally throw an error exception:
The length of the specified literal string exceeds max limit.
When the string length of Name is 128 the doUpdate
succeeds.
When the string length of Name is 129 the doUpdate
fails (but sometimes it succeds if you change the characters).
The Name
field has a defined length of 1000 character (nvarchar(1000)
in the database).
It fails in the production system, but not in the test system!
Database logging is not enabled. The Database is SQL 2008 R2. AX kernal version: 5.0.1500.5660
Anyone seen this error?
Any hints to resolve?
Upvotes: 0
Views: 2470
Reputation: 1496
I have seen this behaviour too.
It must be something in combination with the literals as posted by David. Do you use literals
or placeholders
in your query?
I can perfectly reproduce this in kernel 5.0.1600.2967 (on the salestable).
It has to be a bug with the combination of forceliterals
and doUpdate()
Changing the field to data type memo or some other changes like changing the cachelookup
didn't help either.
Upvotes: 0
Reputation: 11
Dont use literals in query. I quess in salesLine datasource init method you use literals. Like:
SalesLine_ds.query().literals(true);
Upvotes: 1
Reputation: 2354
It is possible quotename is being used in sql server 2008?
There appears to be an issue with the length restriction being 128 characters in this version of SQL server
http://sqlserverpedia.com/blog/sql-server-bloggers/watchout-when-using-quotename-2/
Upvotes: 0