Showing last 10 lines on field data in an edit box.
Is there a way to show only the bottom 10 lines of the field in the edit box?
Would I be able to edit the data without losing the begining part of the field?
You might be able to do this, but before you try out the following untested suggestion, perhaps you don't need so much data in a single text box? Often, a table of related records in a portal can do what you want here and that would make displaying a subset of the total number of lines quite a bit easier to do.
Define a text field and use a script to load it with the last 10 lines of text in your text field:
Set Field [YourTable::10LineField ; Let ( Lines = RightValues ( YourTable::FullTextField ; 10 ) ; left ( lines ; Length ( lines ) - 1 ) ) ]
OnRecordLoad is a layout based scriptTrigger that you can use to run that script
Then use a script trigger to then update the original field with the contents of the field when the user exits this field.
Set Field [YourTable::FullTextField ; LeftValues ( FullTextField ; ValueCount ( FullTextField ) - 10 ) & YourTable::10LineField ]
Set Field works fine, when I run it on a record manually.
I couldn't find OnRecordLoad, or any layout script triggers.
Is the only thing I can do is a perform script on file open? We're on Filemaker Pro 9.
I wish the large field was in a related table, but this is existing data from another application.
Thanks for the help.
Yep, script triggers were a new feature introduced in FileMaker 10.
In 9, you can perform a script when the file opens, closes, when a button is clicked or it is selected from the scripts menu.
Just because this is "existing data" doesn't mean you can't break it up into individual related records after import into FileMaker. A looping script can do that fairly easily.
Retrieving data ...