Best way to add 1400 character data field?

Our A/R department has been pasting a standard payment terms text block into order comments. We’re creating a customization that takes interest rate (UD field in Terms), terms, and order balance to do deferred revenue for promissory notes.

What’s the best way to save this terms template to be used for order comments? One idea our developer suggested would be to create an x(1500) UD field on ARSyst. I’d love to use User Codes, but that’s not big enough… It’d be nice not to hard-code it into the customization, but that’s an option as well.


(Ignore that interest is off by 100x).

What would be most efficient way? Most reasonable? We don’t want to slow down Epicor any more than it already is…

Thanks for the advice!

UD field on the user code table?

Alternatively, I’ve attached PDF documents to the whole company (via Company config) and used a breaking and routing routine to grab it when the user prints the PO/Invoice/SO etc. I personally like that better because then someone can properly format the legal doc rather than me dumping plain text into the system.

Just FYI, if you create a UD field as x(1000) format, it will actually turn into an nvarchar(max) in the backend which gets you a billion characters or something insane like that.

1 Like

You can use the UserCodes, just put it into 3 different user codes with the same CodeTypeID; 1 UserCode for each section separated by **********************************, and add them using something like:

var termsBlock = Db.UDCodes.Where( x => x.CodeTypeID == "TermsBlock" );

To get the whole set, and then you can get a single text block by adding the UDCodes.LongDesc for each code.

Edit: I call foul on these Dumpster Fire Emojis.

Interesting. Does the application, or whatever layers between app and DB, truncate or otherwise misbehave when you exceed 1000 chars?

I think @Rich or someone explained this all on the forum before but I can’t find it now…

In SQL it definitely turns into nvarchar(max). The question would be if there are any quirks in the UI – I’ve never noticed any myself.

No, everything in Epicor knows x(1000) is nvarchar(max).

At least as far as everything I have seen.

1 Like