milefaker Posted June 8, 2009 Posted June 8, 2009 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!
Ben Goldstein Posted June 8, 2009 Posted June 8, 2009 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..
milefaker Posted June 8, 2009 Author Posted June 8, 2009 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.
comment Posted June 8, 2009 Posted June 8, 2009 Well, will you post the calculation or do you just prefer wild guesses?
milefaker Posted June 9, 2009 Author Posted June 9, 2009 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.
comment Posted June 9, 2009 Posted June 9, 2009 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.
Recommended Posts
This topic is 5647 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now