Jump to content

Unknown Entity Error


-Lisa-

Recommended Posts

I'm composing a data file which includes several records that contain an ampersand in the company name. There is no space between the ampersand and the next character (i.e. H&R Block).

 

I have a copyfit rule created for the company name which uses the CopyFitLine function. Since I need to check "Treat Returned Strings as Tagged Text" in order for this rule to compose successfully,this is what's causing my "Unknown Entity" error.

 

I'm assuming I'm going to need to add something to my rule which replaces the entity. But is there a way to do this without having to create an instance for each and every letter of the alphabet? I'm trying to make life easy....;)

 

 

Thanks!

Link to comment
Share on other sites

Just globally replace the ampersands with the entity version like this:

return "H&R Block".replace(/&/g,"&"); // returns "H&R Block"

That will work for the ampersand character in particular, but there are other special markup characters that can confuse the tagged markup parser, such as < (less than). The correct way to handle all of these is to use the TaggedTextFromRaw function, like so:

return TaggedTextFromRaw("H&R Block");

Or more generally:

return TaggedTextFromRaw(Field("Company Name"));

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...