"Hello, {$user.Name}!" - string interpolation support (v.22)

Yes, the title is correct - there's no mistake. "Hello, {$user.Name}!" is actually an expression for a string interpolation. Will become "Hello, John Doe!" after evaluation (assuming that *your* login user is "John Doe").

Of course, this feature is not just about visualizing the name of the current user. Its use and capabilities are much more than that.

What can I use string interpolation for ?

Generally, wherever you want to visualize a string in a certain way.

If a string interpolation expression is in the context of an specific entity, you have access to each of its properties.

In contrast, the expression in the introductory example (the name of the current user) is a global one - i.e. will produce the same output, regardless its context.

Custom display text format

mceclip2.png

Do you recognize the customer's entity panel ? There's a new option - Display Text Format. You can specify how a customer will be displayed. Actually, the display format is a string interpolation expression.

The picture below demonstrates how a customer's dropdown will look like if the display text format is set to {Party.PartyName:T} #{Number}.

mceclip1.png

 

Here are some examples how a customer visualization will change according to different string interpolation expressions.

Expression Interpolated string
{Party.PartyName:T} Jane Doe
{Party.PartyName:T} ({Number}) Jane Doe (ab30027)
{Number}: ({Party.PartyName:T}) ab30027: (Jane Doe)

If the predefined expressions don't suit you, you can always create your own.

--

Another convenient place where string interpolation is extremely useful is when setting up web panels as well as external applications in the desktop client.

Web panels

You can access and interact with an external web service directly from the desktop client. Take a look at the picture below

mceclip1.png

You can see an example of a web panel, part of a customer form, that is set up to display a location in google maps. Аnd how do you think this location is determined ? Exactly - string interpolation.

The URL used to set up the web panel is the following one:

https://www.google.com/maps/place/{Party.Area.Name:T}

And here the string interpolation takes action. The expression {Party.Area.Name:T} is evaluated in the context of a specific customer - "Sofia".

 

More information and examples are available in our official documentation:

https://docs.erp.net/tech/advanced/string-interpolation/index.html

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk