AnsweredAssumed Answered

How to make script operate only on current record in found set?

Question asked by bbqchick on Jan 21, 2010
Latest reply on Jan 21, 2010 by comment_1

Title

How to make script operate only on current record in found set?

Post

I am a FM newbie. I have a button on a form to parse a name and only want it to apply to the current record in the found set. Parsing seems to be done on all records in the found set. What am I doing wrong? Thanks. Using FM10 Pro Advanced. Here is script for button:

 

Go to Layout [ original layout ]

Set Variable [ $NameWordCount; Value:WordCount (Master::Name) ]

If [ $NameWordCount = 2 ]

     Replace Field Contents [Master::Name; Replace with calculation: RightWords (Master::Name;1) & ", " & LeftWords (Master::Name;1 ) ]

     Exit Script [ ]

Else If [ $NameWordCount=3 ]

     Replace Field Contents [Master:: Name; Replace with calculation: RightWords (Master::Name;1) & ", " & LeftWords (Master::Name; 1)

         & " " & MiddleWords (Master:: Name; 2; 1) ]

     Exit Script [ ]

End If

Outcomes