Jump to content
Server Maintenance This Week. ×

Selective format


This topic is 3560 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi all.

 

Hopping a guru can enlighten me. I have a field called "Service Performed" next to this field I have bottom with the below script.

 

TextStyleAdd(TextSize(ticket::Service Performed" & "- " & Get (accountName) & "- " & "" & Get(currenthosttimestamp) & "Enter" ; 12 ); Bold)

 

The basic idea is as users are typing and a new event needs to be entered a users would press the bottom and a time stamp with the username is inserted.

 

It works find except the formatting. Now what I would like to happen is to either bold or change the color of the inserted line. but what I get is the entire field in bold.

 

Is this possible.

 

thanks

RudyM 

Link to comment
Share on other sites

but what I get is the entire field in bold.

 

Your issue lies with using the correct order of evaluation.

 

Since nested expressions are evaluated from the inside out, you're effectively adding the new entry to the existing field contents, then format the result – while what you actually want to do is add a formatted new entry to the existing contents.

 

Using Let() can make this clearer, e.g.

Let ( [
      newLine = ticket::Service Performed" & " – " & Get (accountName) & " – " & Get( currenthosttimestamp ) & "Enter" /* what's 'Enter'? */ ) ; // the new line
      formattedLine = TextStyleAdd ( TextSize ( newLine ; 12 ) ; bold ) 
      ] ;
       List ( ticket::Service Performed ; formattedLine ) // result is existing contents and a new, formatted line
  )

That being said, consider using a related table and add a record for whatever it is you're storing in a single line, with fields for the entity itself, and for metadata like timestamp, user etc..

 

Then you can calculate these discrete pieces of data into whatever result you need, and format the display, instead of the data.

Link to comment
Share on other sites

This topic is 3560 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.