November 10, 200619 yr Does anybody know why GetField("FieldName") returns the quoted field's value but GetField($$globalvariable) will not, even though $$globalvariable contains the exact text string "Fieldname", quotes and all?
November 10, 200619 yr It works for me. you might check that the variable is set in the table where the GetField() is used and make sure the field type is appropriate.
November 10, 200619 yr Author I'm sorry, I don't understand what you mean by the variable being "set in the table where the GetField is used" Global variables are Global, right? They do not belong to any table. Their value stays the same until reset, right?
November 10, 200619 yr Sorry, I should have said "file" instead of "table". Global variables are specific to the file they are set in.
November 10, 200619 yr Author Right... yes, same file. GetField can use related fields can't it? I thought that might be it. But I tried an end run by creating a calculation that returns the related value but still no luck... BTW, the "?" that is returned is in the Data Viewer
November 10, 200619 yr Can you describe the relationship and field or script this is used in? Or better yet, post a sample that illustrates what you're trying to do.
November 11, 200619 yr Author The attached is very simple but does show the problem. Try running the SetVariable script while using the dataviewer to watch: $$variable GetField("subchild::subchildvalue") Child::Getsubchildfield You'll see that while the straight formula returns the correct value, the calculation in the Child table does not even though it is looking at $$variable which contains the exact same text as the straight GetField formula. Thanks for your time, Ender! PS: the text editor is adding a space in one of the watched items when I preview the post and I can't seem to get rid of it test.zip
November 11, 200619 yr Remove the Quote() function and change the storage on the GetField()'s calc to "Do not store". Alternatively, you could have the script perform the GetField(), setting the calculated result into a normal text field.
Create an account or sign in to comment