February 10, 200422 yr I have a notes field that contains information about our customers that is useful in sales. Our sales people like to apply formatting to the text in this field so important information can be bolded, or red, etc. The problem is, I have a script that is used when a new note is added. So, a user clicks the 'New Note' button, and the script automatically inserts the date and username like in the following example: Set Field["Notes", "DateToText(Status(CurrentDate)) & " (" & Status(CurrentUserName) & "): " & "nn" & Notes"] NOTE: The 'nn' above is really the FM paragraph symbol... This puts the new notes entry at the top of the notes field, so the newest entries are at the top. However, when this script is run, any existing formatting is lost. I think it is because it is essentially copying and pasting the existing text, and FM doesn't carry over the existing formatting. Has anyone run into a similar situation? Is there any way around this? I want to keep the formatting, but still want to automatically enter the date and username before each entry and keep newest entries at the top. Our old ACT DB could do this... can FM? Thanks for your help.
February 10, 200422 yr If you Paste the old notes instead of Set Field, you can retain style. In other words Copy["Notes"] Set Field["Notes", "DateToText(Status(CurrentDate)) & " (" & Status(CurrentUserName) & "): " & "nn"] Paste["Notes"] When pasting, do not "select entire contents" and do not "paste without style"
February 10, 200422 yr This is expected behavior for FileMaker Versions 6 and older (calculations strip any text formatting). Rumor has it that this will change in V 7. There are some workarounds, Click Here to see one example of a workaround. and here a couple more: Text Style By: Steve Murray URL: http://www.fmfiles.com/tnt11.html Scripting the insertion of coloured/formatted text! By: Ray J. Cologon URL: http://www.nightwing.com.au/FileMaker/ Field Text Formatting System Sampler By: Ray J. Cologon URL: http://www.nightwing.com.au/FileMaker/ HTH Lee
Create an account or sign in to comment