March 23, 201213 yr New to scripting and I'm just trying to write a new record with some fields changed. I can write the new record based on a related tables key field but none of the fields I set to new values change in the new record. here's the script For some reason I can't copy and paste it so this is an image file. (Explanation anyone?) Anyway the new records are written to Pay Records as expected using the key field from Form View but none of the fields I am setting are being written with the set value. I know this is caused by my own stupidity but a few days of research and I can't figure it out. Any help gratefully appreciated.
March 23, 201213 yr You have a comment that says Loop, but you aren't looping. Read up on how to loop.
March 23, 201213 yr Author I commented the loop out for testing. Will put it back when I get it to work.
March 23, 201213 yr To be clear, you do not have the Loop or End Loop script steps and they are not disabled. Placing a comment does not "comment" out script steps. You have two sets of the same fields. You will not need more than one set of fields: go to layout 1 Go to First Rec Loop Set $var Set $var2 go to layout other new record set field, $var go to layout1 got to next, exit after last End Loop That is the basic structure. When you get to the Set Field PayRecords::Pay Salary, you are in the PayRecords context. You are trying to set the field to the Personnel Records Salary field. Without seeing your relationship graph, I can't tell if you can actually "see" this field from the context of PayRecords? What is the relationship btw the two tables?
March 24, 201213 yr Author Thanks for the answers. To be clear I have put the loop back in although that is not the problem. The script is not writing the variables to the new record in Pay Records apart from the Employee ID field (from $Emp). I am sure I am doing something basic wrong but can't for the life of me figure it out. I have attached the script (with loop reinstated) and the relationship graph. Thanks for any help.
March 24, 201213 yr If $fullmonth ≠ N, the personneorecords::Sallary field is entered into the field repetition, not the field value.
Create an account or sign in to comment