YuChieh Posted January 25, 2006 Posted January 25, 2006 How do I set a new value into a field that applys to all records? I use a script, setfield function. And I called the value from another database using the relationship. It didn't do anything. If I did "copy/paste", it only pastes into the current records. Thanks
Matt Klein Posted January 25, 2006 Posted January 25, 2006 Try the "Replace Field Contents" script step. That will replace the field contents in all records in the found set. Just make sure that the field you are replacing the contents in is on the current layout before you use the step.
YuChieh Posted January 25, 2006 Author Posted January 25, 2006 Actually I found out, probably it's becuase the relationship is not working. I have it like this -- DB1::Accouting = DB2::Accouning However, DB2::Accounting is a blank field that I want to put the new value in (from DB1:Accounting). So the relationship is not really linked. make sense? Then how do I insert a value from one database into a blank field in the other database? Thanks
Matt Klein Posted January 25, 2006 Posted January 25, 2006 DB2::Accounting is a blank field... That is definitely not going to work. Without a value in the DB2::Accounting field the relationship doesn't work. However, if you set that relationship to allow creation of records in the DB2 file, you can use the SetField step to populate any other field in the DB2 file using that relationship. When you populate this other field a new record will be created in the DB2 file and the DB2::Accounting field will automatically be set to the DB1::Accounting fields contents so that the relationship will be valid.
YuChieh Posted January 26, 2006 Author Posted January 26, 2006 Thanks for the input. I found a way. I set the DB2::Accounting as Global field. Then using scripts to copy DB1::Accounting and paste it into DB2. So the DB2::Accounting in all records will be populated. Thank you!!
Matt Klein Posted January 26, 2006 Posted January 26, 2006 I set the DB2::Accounting as Global field. Well, without knowing exactly what your intent is, you may find that using a Global field is NOT the way to go here. There are two main reasons why I say this: 1. Data in Global fields is not persistent. In other words not permanent. 2. Data in Global fields is only available to the single workstation that populates it. The data in a single global field can, and usually is, be different on two different workstations at the same time. Oh, and one more thing, data in a global field is shared by ALL records not just records in the found set at the time you populate it. You may already realize this, but since I really don't know the context of your post, I thought I should at least point it out.
YuChieh Posted January 26, 2006 Author Posted January 26, 2006 Sorry I didn't state the situation clearly. For this case, I think it's safe to use global field. 1. we don't need to keep these records permanently. once the values are calculated in the records, we print them out to keep. Then we clear them and ready for the next job. 2. only one person will process this and print the numbers out right away. so it shouldn't have any conflict. 3. it's exactly what I want - have that global field shared by all records. Thank you very much for pointing these conditions out by using global fields. I will pay more attention for future use. One more question. Now I try to do a script/button to "clear" the content of one field (not the global one) in all records at once. I tried "set field", "find/replace", "insert calculated results". But they all clear the content in only "current record", not all records. How do I set to clear off all records? Thank you.
Matt Klein Posted January 26, 2006 Posted January 26, 2006 You will have to either loop through all the records and "clear" the field or use the aforementioned "Replace Field Contents" script step.
YuChieh Posted January 26, 2006 Author Posted January 26, 2006 Replace Contents works. Again, thank you very much.
Matt Klein Posted January 26, 2006 Posted January 26, 2006 Replace Contents works. Again, thank you very much. You are welcome. I am glad I could help. Happy FileMaking!
Recommended Posts
This topic is 6878 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