Rockxyzzy Posted November 4, 2007 Posted November 4, 2007 I have a user who continues to use the "Return" key instead of the "Enter" key after populating a field with a PO Number. The result of this is that subsequent searches fail to see a match between the fields containing "PO123" and "PO123" because of the hard return character in the field. How can I set up FMP 8.5 Advanced to ignore trailing hard returns in a field for the purposes of content comparison? (I can't merely compare the values of the first X characters because the field must be very dynamic, as the PO Numbers being entered are from a variety of external customers and have no set format, structure, etc.)
bcooney Posted November 4, 2007 Posted November 4, 2007 There are a couple of things that you could do. First, set the PO field to auto-enter calc using the custom function Trim4 ( see here ). It trims all trailing spaces and returns. Also, you can set the behavior of the field to go to next object on Enter Return and Tab. PS: Update your forum profile to reflect that you have FM8.5A
Rockxyzzy Posted November 4, 2007 Author Posted November 4, 2007 This is cool. Thank you. I'll have to figure out how to install and use a custom function; I've never done so before. Thanks!
Rockxyzzy Posted November 4, 2007 Author Posted November 4, 2007 One question about custom functions: does a custom function reside at the application level or at the document level? That is, if I install a custom function into a specific file and then give that document to someone else running the same version of FMP, will the custom function be available to them when they open my file in their copy of FMP?
Lee Smith Posted November 4, 2007 Posted November 4, 2007 (edited) Hi Rock, If you have trouble figuring it out, let us know. Basically, Just follow the way you see it in the page of your Browser. I made a Help file for myself of all these, so that I could search and test some of them. Using this CF as an example: Start by opening the page in your browser for the CF, and the File you are going to use it in. In the File, Go to: File >> Define >> Custom Function >> [color:blue]New Enter in the blank boxes: Function Name: [color:blue]Trim4 hint: don't put the brackets Function Parameters: [color:blue]Text hint: be sure and click on the + after you enter the Parameter Trim4 (text) hint: Be sure and capture the complete calculation. To do this, use the Button at Brian's site that says [color:blue]Select All Let([ C1 = PatternCount ( " ¶"; Left ( text; 1 )); Cn = PatternCount ( " ¶"; Right ( text; 1 )); Ca = C1 + Cn ]; If ( Ca; Trim4 ( Middle ( text; 1 + C1; Length ( text ) - Ca ) ); Text ) ) Hit the Okay button, and then Okay again. You can use this in a new New Field (calculation, text results), or as an [color:blue]Auto-Enter Calculated Value. To access the CF, it is now available in the "Specify the Calculation" Edit Box, under the Drop Down Menu All Functions by Name >> Custom Function (second from the bottom) in. In this case, I would use the [color:blue]Auto-Enter Calculated Value. Don't forget to [color:red]Deselect the box below the Calculated Value labeled, Do not replace existing value (if any) HTH Lee Edited November 4, 2007 by Guest
Rockxyzzy Posted November 4, 2007 Author Posted November 4, 2007 Fantastic. Thank you. I'll give this a shot and see how it goes. Thanks again.
Rockxyzzy Posted November 4, 2007 Author Posted November 4, 2007 Worked like a charm! Thank you very much! This is great!
Recommended Posts
This topic is 6228 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now