Skip 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.

A better way removing formatting from fields?

Featured Replies

Okay, I'm stuck. I want to prevent users from inserting formatted text (boldface, italics, color, etc.) into my solution so I thought of using the calculation, TextFormatRemove(Self), on all the user-available fields using the AutoEnter Calculation function...but to do that for all the fields--100+ of them--seems like a klunky way of doing things. Is there a more elegant solution to accomplish the same goal?

As always, TIA for your help!

Rich

Hi

If you are open to scripting this script will tidy up all fields on a layout.

Some notes on it.

1. It was made to tidy data in a legacy system where repeating fields rule.

2. I did not ever get it to work for portals

3. You will note it requires no context to run in. Completely portable(but doesn't do portals)

4. The routine can be run via script trigger - On RecordCommit or OnLayoutExit

5. Error Capture On deals with calculated fields - you don't get the warnings.

#Systems - Remove Formatting By Indirection

Set Error Capture [ On ]

#Capture all field names on this layout

#Count the number of fields

#Capture layout table name

#

Set Variable [ $AllFields; Value:FieldNames ( Get ( FileName ) ; Get ( LayoutName ) ) ]

Set Variable [ $FieldCount; Value:ValueCount($AllFields) ]

Set Variable [ $ThisTable; Value:Get ( LayoutTableName ) ]

Set Variable [ $Count; Value:1 ]

Loop

Exit Loop If [ $Count > $FieldCount ]

Set Variable [ $Counter; Value:1 ]

Loop

#Store the field name

#If it is a repeating field note the number of reps - a non-repeater will return Horizontal 1 or Vertical 1.

Set Variable [ $ThisField; Value:$ThisTable & "::" & GetValue($AllFields; $Count) ]

Set Variable [ $Reps; Value:FieldRepetitions ( Get ( FileName ) ; Get ( LayoutName ) ; $ThisField ) ]

#The returned value is text and number, we just want the number...

Set Variable [ $RepsCount; Value:GetAsNumber($Reps) ]

#

#Capture the value in the current field.

Set Variable [ $FieldValue; Value:GetField($ThisField & "[" & $Counter & "]") ]

#Define the target and strip formatting from the value

Set Variable [ $Target; Value:$ThisField & "[" & $Counter & "]" ]

Set Field By Name [ $Target; TextFormatRemove($FieldValue) ]

Set Variable [ $Counter; Value:1 + $Counter ]

Exit Loop If [ $Counter > $RepsCount ]

End Loop

#

Set Variable [ $Count; Value:1 + $Count ]

Set Variable [ $RepsCount; Value:"" ]

Set Variable [ $Reps; Value:"" ]

End Loop

Stephen

If that works for you and you ever figure out how to be indirect with portals I'd love to see how you did it. My goal was complete portability.

See attached file.

well "You (or rather I) aren't permitted to upload this kind of file". I can send it to you back-channel if you like.

Ah, Grasshopper! Your file must be zipped...

Test123.fp7.zip

  • Author

Thanks! I'll give it a go at work in a few days; it looks promising!

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.