What is the secret to updating all records but on an individual record:field basis in a table?

Discussion created by tguise on Dec 20, 2013
Latest reply on Dec 23, 2013 by BruceHerbach

"Thanks in Advance" to anyone & all who can provide some insight into what I thought would be a simple exercise. (Needless to say, I am very new to FM Pro 12...and now humbled even more...)


Given: A (test) Table with 3 Fields, 50 Records.

Research showed I must have Fields 2 and 3 set to Global status, but that by doing so "now" would destroy the field content.



(a) Create 2 new fields in existing table with Global attributes.

(b) Create a "script" to step through each record and copy the contents from Field 2 to Field 4 AND Field 3 to Field 5.

(c) Delete Fields 2 and 3.


Proposed Script


Go to Layout [x]

Set Variable [$TRC; Value:Get (TotalRecordCount)]

Set Variable [$K; Value:0]

Go to Record/Request/Page [First]


Set Variable [$K; Value: $K + 1]

Set Field [Test_Corporations::Test_Corp_Type Copy; Test_Corporations::Test_Corp_Type]

Set Field [Test_Corporations::Test_Corp_Name Copy; Test_Corporations::Test_Corp_Name]

Go to Record/Request/Page [$K]

Exit Loop If [$K > $TRC]


To my surprise, shagrin, frustration, etc.... Set Field, Set Field by Name, Replace Contents..., etc change ALL Contents of Each Field & Record in the found set!


So... What is the strategy whereby one moves to each successive record and update field contents with unique values?

Again, "Many Thanks" in Advance for some insight into this situation!