Idea ID: 2774540

Asset Manager should document how to handle newline characters in Rest POST/PUT

Status : Waiting for Votes
Waiting for Votes
See status update history
over 1 year ago

Past and current version (9.71) of Asset Manager fails at documenting that newline characters (\r and \n) within memComment and long text fields during insert and update (POST and PUT respectively.)

In order to successfully write multiline text, newline character sequences have to be "escaped" in an unconventional (and formidably ugly) manner.

While at it, documentation should also include a short paragraph about how single quotes characters also need to be escaped.

For reference, below is the javascript  snippet we currently use to handle text values to POST/PUT



value .replace(/'/g, "''") // escape single quotes .replace(/\r\n?/g, '\n') // normalize newline character sequences .replace(/\n/g, "'+CHAR(13)+CHAR(10)+'"); // escape newline chararacters