Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

TextStyleAdd function

Featured Replies

Using [color:"green"] TextStyleAdd(someField; Bold) works just fine to make the text in someField bold...

When I try to make it dynamic and have a field named itemStyle where the user chooses from a list, Bold, Italic, etc. then use the syntax:

[color:"green"] TextStyleAdd(someField; itemStyle) then it does not work. What am I missing? "Normally" we can pass the value of a field as a parameter. I checked to be sure that the result is text. I also tried using GetField("itemStyle") within the function, but no go.

Try:

TextStyleAdd( someField; Evaluate(itemStyle) )

Bold and the like are named constants inside calculations, but have no special meaning inside a field.

  • Author

Perfect! Makes sense now. Works! Thanks.

  • Author

OK. I started nesting the functions as I want to be able to set the font, size, and style on the fly. The Calc is used in a SetField script step. The size and style work fine but I cannot get it to manipulate the font. I checked to make sure the font name taken from a list is spelled correctly and case sensitive. Can you see a flaw in what I have?


/* Calc for setting the numbers with TextStyle, TextSize, and TextFont 

   Dynamically set from the order page, fontStyle, fontSize, fontName */

TextFont(

  TextSize(

    TextStyleAdd(

      NUMBERS::someField;

          Evaluate(ORDERS::fontStyle) ); 

          Evaluate(ORDERS::fontSize) ); 

          Evaluate(ORDERS::fontName) );

)

/* End Calc */

I don't think you need to Evaluate the fontSize or fontName, the fontSize is just a number and the fontName is just a string - so those two will work without Evaluate() on them.

  • Author

Apparently the Shadow does know... that did the trick. thanks for the help.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.