May 14, 201114 yr 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
May 15, 201114 yr 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
May 15, 201114 yr 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.
May 15, 201114 yr 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.
Create an account or sign in to comment