Friday, September 6, 2013

NLS bind with single quote messages

Ex:
NLS.bind("Deleting projects from Account '{0}'",  dataProvider.getCurrentAccount().getName())

This will not give you the desired output.

Output: Deleting projects from Account '{0}'

As per API, Text appearing within single quotes is treated as a literal. A single quote is escaped by a preceeding single quote.

Modify as below:
NLS.bind("Deleting projects from Account ' '{0}' ' ",  dataProvider.getCurrentAccount().getName())

output: Deleting projects from Account KondalKolipaka

No comments:

Post a Comment