You are probably referring to an incorrect field or a field from a different Table Occurrence.
If you have Filemaker Advanced you could use the script debugger and data viewer to find out exactly where it goes wrong.
Check what table your layout is based on.
Check if the field you are setting as a variable is actually the field in that table.
Check to see if the value you are setting in the other field is the correct variable name.
Check if the field you are setting the variable in is the correct field in the correct table.
Feel free to post your script if you are still unable to solve this.
To post a script to the forum:
- You can upload a screen shot of your script by using the Upload an Image controls located just below Post a New Answer.
- You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here. (with this approach, you can get multiple script steps on the same line, please edit the pasted text by inserting some returns to separate those steps.)
- If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
- If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.
I have a pdf and a script running (with debbug viewer) video record uploaded to dropbox. Could you give me an email to share it with you?
I don't entirely understand your script. I guess you have the need to make invoices if none are there, but I feel like this hasn't been properly implemented because you never really look for the Invoice Id in the Invoices table. You have an if statement that is commented out. That also doesn't really seem right.
I can't see much in the video because the quality is rather bad and you are also not showing the data viewer.
First of all you don't need all the "Go To Field" script steps. They can all be removed. Because while setting the variable or setting a field you are specifying there what field you need to be using. So all of the Go To Field steps are useless.
Second of all, I think there is a problem with your "Set Field" step. It has to much stuff in it. It should be:
Set Field [ Invoices::Delivery_Sheduled_Id_Nv ; $DELIVINV ]
But in your script there is some additional reference to the field. That might be messing your step up.
Try changing that.
I didn't take time to look at your files as Guy gives really good advice without any help from me. But keying in one his comments on your set field step, perhaps this added info on how to set up set field will be helpful:
When Setting up Set Field, there are two Specify buttons that must be clicked. To get Set Field [Table::Field ; Expression], add set field to your script and click the first button (specify target field). Select Table::Field from the list of fields. Do not click the specify button next to the repetition box. Click OK to close this dialog box. Now click the lower specify button (calculated result) and create the expression to the right of the semicolon (;). Do not try to type in the semicolon.
The funny thing is that there are two Set Field script steps in that script and the second one IS correct.
So I think this might just be an oversight, or a silly mistake.
While coding (coding fatigue...) I made a mistake in the Set Field calculation (and was blind to it...). As Guy said, it should be "Set Field [ Invoices::Delivery_Sheduled_Id_Nv ; $DELIVINV ]" !