rpaterick Posted September 6, 2011 Share Posted September 6, 2011 Address Line 1 or 2 if the data contains "9" digits or characters in numeric, skip record on OUTPUT. Customers data software that compiles the lists to us accidentally included someones SS number in the Address Line 2 field. Thanks Link to comment Share on other sites More sharing options...
esmith Posted September 6, 2011 Share Posted September 6, 2011 Assuming there's a question in there somewhere, I would create an OnRecordStart rule: if ((Field("Add1").search(/\d{9}/) > -1) || (Field("Add2").search(/\d{9}/) > -1)) { FusionPro.Composition.composeThisRecord = false; ReportWarning("Record #" + CurrentRecordNumber() + " was skipped because it may have a SS# in address field."); } Link to comment Share on other sites More sharing options...
rpaterick Posted September 6, 2011 Author Share Posted September 6, 2011 Assuming there's a question in there somewhere, I would create an OnRecordStart rule: esmith, this didn't work for me. I thought I had something going and when I went to test a few scenarios, my FP doc error'd on me and wasn't kicking out the "9 digit" numbers. I've attached the file to this post. Looked like it was going to work and maybe I didn't have something quite right. I want to try and skip the last 2 records in this test file or records 3 and 4 when I compose all. Will the code only look for 9-digit NUMBERS(any combination) in a row and not just 9-digits overall in the field? Thanks!test.pdf22673_Final.txt Link to comment Share on other sites More sharing options...
esmith Posted September 6, 2011 Share Posted September 6, 2011 Today I learned that you can not use a regular expression in an indexOf method. However, the search method is the equivalent method which does use regular expressions. If you replace the two instances of .indexOf with .search, the code should work as expected. Will the code only look for 9-digit NUMBERS(any combination) in a row and not just 9-digits overall in the field? The code ignores any record with a string of 9 digits (in a row) in either of two fields. Link to comment Share on other sites More sharing options...
rpaterick Posted September 6, 2011 Author Share Posted September 6, 2011 If you replace the two instances of .indexOf with .search, the code should work as expected. The code ignores any record with a string of 9 digits (in a row) in either of two fields. AWESOME!!! this worked. Thanks E! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.