May 13, 200223 yr I have two db's. one has five fields in it. one of this fields is a date field. The other db has has nine fields which four of them are dates fields. This dates in the second db represent the original date each welders was qualify for each welding process. I made a relationship between the two db using the welder name and use the set field command to create a new record in the second db. this works fine for the welders name. Then I use the set field command for the date. this does not work. Example Set Field["rlated:Name","name"] this workd perfectly Set Field["related:Date2",Date"] this doesnot work this is in a script I would like to insert the dates for each process as they are qualify(this may or maynot be a the same time) into the second db. Does set field work like this or I am expecting it to do something that is was not meant to do. Please Help.
May 13, 200223 yr You have to make sure that the field you are setting appears in the layout you are currently using, and that you have allowed yourself access to enter data into that field in that layout. My guess is that the field "rlated:Name" is in your layout, but "related:Date2" is not... -Stanley
May 13, 200223 yr Author Hi Stanleycar: If I understand you correctly that date2 and date3 and date4 has to be in the primary db and I have to enter the data in them for set field to work. Set field will not work in a relationship where in the primary db has one date and you want is to fill out the other dates in another db. example Set Field(case(process="GTAW",Date2=date,process="SMAW",Date3=Date,etc.) is that correct thanks
May 13, 200223 yr Hi, Have you tried for your date step Set Field ["related::Date2, TextToDate(Date)"] Now, with set field the field does not have to be on that layout. As long as it exists in one layout you can set a field (even a related field) This is the benefit of set field over copy paste or insert calc result.
May 13, 200223 yr Actually, when you use a Set Field, the field does NOT have to be on the current layout. That is its advantage over Paste, Insert and Clear commands which do require the field to be on the current layout. Most likely, this is a problem with the relationship not being valid.
May 13, 200223 yr Bob, I swear I said that set field does not have to be on the layout. OK, I didnt say set field does NOT have to be on the layout. your expression on the NOT is TAKEN IN. Emphasise the negative, got it.
May 13, 200223 yr The trick with "Set Field []" is that the calculation specified in the function *must* return data of the same type as the field. The big catch is when trying to set a date range (eg, 1/1/2001...1/1/2002) into a date field for a find request: FMP will reject it for not being a valid date. In this case, use "Insert Calculated Result []" instead, remembering that this function requires that the field be on the current layout.
Create an account or sign in to comment