Skip to Content
0
Former Member
May 20, 2015 at 11:19 AM

FMS: Internal Error (3006) (Message 131-183)

427 Views

Hi all,

I have created this query for ItemCode generation:

DECLARE @num as nvarchar(20);

DECLARE @max_num as integer;

SET @num =$[$U_Level1.0.0] +$[$U_Level2.0.0] + $[$U_Level3.0.0]

SET @max_num = CASE WHEN NOT EXISTS(SELECT itemcode from OITM where itemcode like @num + '%')

THEN 0 ELSE (SELECT MAX( CAST (REPLACE(Itemcode, @num, '') AS INT)) FROM OITM where itemcode like @num + '%') END

SELECT @num + STUFF(

'00000',

6 - LEN(CAST(@max_num + 1 as nvarchar (20))),

LEN(CAST(@max_num + 1 as nvarchar (20))),

CAST(@max_num + 1 as nvarchar (20)))

When i'm adding this FMS to UDF field it is works fine (like on screenshot)

But when i'm adding this FMS to ItemCode field and press the magnifying glass, i'm receiving error:

"Internal Error (3006) (Message 131-183)"

I'm also tried to use magic symbol '-' before the item index, but in that case FMS does not work even in my UDF...

Will be appreciate for any help.

--

Best regards,

Alexander

Attachments

screen1.png (21.7 kB)