June 8, 200916 yr Using "Replace Field Contents" to replace with a calculated result works fine manually. But when I place it in a script and try to specify the same calculation, it always gives me the error "The specified table cannot be found", regardless of what table I have selected. What am I doing wrong? Thanks!
June 8, 200916 yr Make sure you have a: - "go to layout" (to a layout based on the table that has that field) - and a "perform find" on the records you want to run replace on (unless you’re doing all, in which case you want a "find all" script step) prior to your "replace field contents" script step..
June 8, 200916 yr Author Actually, I'm getting the error message while writing the script; I'm unable to save it, much less run it. The "Replace Field Contents" dialog that opens when I click the lower of the two "specify" buttons will not allow me to save the calculation I am using, even though that same calculation works manually.
June 9, 200916 yr Author The calculation is _coll & "; " & _synt & "; " & _Objects & "; " & _M in which the four items beginning with an underscore are names of fields in the current layout. As mentioned, this string-concatenation works when I use Replace Field Contents manually. I have indeed been using Go to Layout as the step before Replace Field Contents in the script, as Ben Goldstein suggested. I've just found that I can avoid the error by including the name of the layout before each field-name: Currentlayout:_coll & "; " & Currentlayout::_synt & "; " & Currentlayout::_Objects & "; " & Currentlayout::_M So the problem is solved. But it's curious to me that so much more specificity is needed in the script than in manual operation of the same command. Thanks for your help.
June 9, 200916 yr Those are not layout names, but table occurrences names. You need these in a script, because a script does not have an inherent context. For example, there could be a Name field in two related tables, so a reference to "Name" alone would be ambiguous.
Create an account or sign in to comment