4

I'm extremely new to AX and am starting with something very simple. I need to increase the size of a column named Invoice. In the AOT, the StringSize property on the column is greyed out so I cannot change it there.

In SQL Server (2005) the column is a nvarchar(20) so I'm thinking AX might just be using whatever DataType is defined in the db.

If I attempt to increase the size of the column in SQL Server it tells me that the table would need to be dropped and re-created.

What is the best way to increase a column size in AX?

Brent Lamborn
  • 1,370
  • 3
  • 17
  • 37

1 Answers1

4

To increase the capacity of the column you would normally change the StringSize property on the InvoiceId extended data type.

However, in this case the InvoiceId extended data type extends from the Num extended data type and you will need to make the change there. This size increase will also affect all other extended datatypes that extend Num.

This extended datatype can be found in the AOT at \Data Dictionary\Extended Data Types\Num.

dlannoye
  • 1,746
  • 19
  • 19
  • 1
    You can remove the Num property value of the extended data type InvoiceId and leave Num unchanged. This will make fewer changes in database. – Jan B. Kjeldsen Jan 27 '11 at 09:48
  • dlannoye - I finally figured that out yesterday and made the change on our dev environment. IT took about 15 minutes for it to complete. I did kind of figure a lot of objects extend Num. – Brent Lamborn Jan 27 '11 at 14:09
  • Since I already changed num on dev, is there a way I can roll it back? I imagine I can just change it back to 20 again, but when I ran it I got this message (screen shot)- http://img4.imageshack.us/img4/1111/numfail.png Is there a way to do a true rollback - not just manually reverting the property value? I'd like to roll it back and try Jan's approach on dev before I do it on our live system. – Brent Lamborn Jan 27 '11 at 14:27
  • The best way to rollback the change would be to delete the changes element to the element in your layer if you are working in a layer other than sys. – dlannoye Jan 27 '11 at 15:47
  • One thing to watch out for it you decide to just change InvoiceId is that anywhere in the system that casts from InvoiceId to something else derived from Num could cause data loss, since if the value is longer than 20 characters it will be truncated. – dlannoye Jan 27 '11 at 15:50
  • dlannoye - I see. Ok great. I appreciate all your help. – Brent Lamborn Jan 27 '11 at 15:56
  • I wonder why the default is 20 characters. That is so short for such a widely used type. – Brent Lamborn Jan 27 '11 at 16:00
  • @Brent, any problems with the change, what did you end up going to prod with. We are having the same issue, that 20 characters is too short for InvoiceID – CaffGeek Apr 18 '11 at 17:47
  • Also, check this post and comment. It is similar to this : http://stackoverflow.com/a/15670463/1904519 – Kenny Saelen Apr 09 '13 at 10:21