I'm not an expert (in fact, I'm only here to post a question of my own) but there's something odd-looking about the SetField statement. I wonder if that & in the middle shouldn't be a ;
There need to be two parameters for SetField, separated by a semi-colon.
Worth having a look at, I'd have thought.
The sample I followed had a comma but the calculation did not work that way. It said I need an operation. There were no commas, nor semicolons there. It also said somewhere that the field was a text field, which did not make sense, but I tried the & anyway. I couldn't get the calculatin to save unless I put something there. I'm sure this is the problem, but I don't know how to fix it. There don't seem to be any choices.
From the picture you posted, it looks like you're using a Mac and that could be different from Windows but I've attached a little snippet of a script in one of my files.
If I click on the upper "Specify" button (and make sure that that check box is ticked next to it), I get to choose the field - the Modified Date in this case.
If I click on the lower "Specify" button, I get to enter the calculation that you can see "> $LastExport" where $LastExport is a variable I've defined earlier in the script.
Do you have FM Pro Advanced? The Script Debugger is worth the licence cost on its own - you can step through them a line at a time and see error codes if applicable. It cut hours and hours out of my development time when I talked the boss into shelling out for Advanced.
Yes it is a Mac. But it should work the same. Unfortunately I don't have a boss to get me the advanced version. (or maybe fortunately) Are you saying I should use both the upper and lower choices? The upper to pick the field and the lower to put the Get.....? I am not at the Mac right now to try it. There used to be manuals with programs. I hate picking through help files to find what I need to learn. It is too much like a treasure hunt. But once I know something, I like to use the online help.
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.
That did work. Thanks.
Can you explain the difference between the calculation being used in the upper or lower box.
I don't understand the difference. And certainly did not know there was a difference.
Or point me to a place where I can read about this.
Upper Specify Box is the name of the field that you are setting; Lower Specify Box is the value that you're setting that field to.....
but the same calculation is in the upper box too
Are you sure you're not looking at the SetFieldByName script step? It does, indeed, have a calculation box for both specifying the field name and the value to be placed in the field.
The SetField script step's upper "Specify" button only opens a list of fields in the current table from which you choose the one where you want the value to be placed.
At least, that's what they do in my version - FM11.