Client and NewClient are both editable: Client is a dropdown, NewClient a field. projectclient is hidden, computed.
If I value NewClient, and leave Client blank, on a new document, then click Save, then Close, then re-open the new document, Client is blank. projectclient is properly valued.
This doesn’t seem quite right to me. What’s wrong?
I inherited this program and the previous programmer fixed the issue in the QueryOpen, but the problem here is that the correct value does not appear in the views before the document is reopened.
Subject: Stupid Questions (not a Jeopardy category) – doc item empty after QuerySave values it
Check if the Client field has any translation formulas that may be “conspiring against you”
If not, best bet is to use Synopsis to generate a code listing of all possible elements that could touch that field (agents, subforms, shared fields, script libraries - those all come to mind) and then search for the exact word “Client” - that should find any code that may be setting the value of the Client field even after you set its value in code.
Subject: RE: Stupid Questions (not a Jeopardy category) – doc item empty after QuerySave values it
Do you use aliases in your Client list field? If so, you must set the value to the alias and not to what is displayed to the user.
Also, if your source for the Client field choices is recomputed and for some reason, the choice you made is not available in the list of possible choices, then the value will get cleared. You can confirm by checking the document properties in a view (don’t open the document) and examine the list of fields (2nd tab) to see what the value that was saved with the document. If blank, then something is happening at the time the document is doing its final recalc before the save. If the value is there as expected, then it is being cleared when you open the document.
Subject: RE: Stupid Questions (not a Jeopardy category) – doc item empty after QuerySave values it
Do you use aliases in your Client list fieldI don’t think so. I don’t know what field aliases are.
if your source for the Client field choices is recomputed and for some reason, the choice you made is not available in the list of possible choices, then the value will get cleared
That is probably what is happening. For some reason this line is (the only line) in Postsave:
Source.RefreshHideFormulas
That’s probably causing the problem.
This application seems a bit convoluted, so I’m not confident enough yet to change that (I’m scared it might impact something else).
Subject: RE: Stupid Questions (not a Jeopardy category) – doc item empty after QuerySave values it
Jeff,
A field alias is something like this:
Cleveland|1
Columbus|2
Cincinnati|3
Toledo|4
The users see the city name in the drop down field, but the value that is collected is the numeric (aliased) value.
However, now that you say that the postsave event has a Source.RefreshHideFormulas call in it, it makes me wonder what the hide/when formula for your Client field is. Is it hidden when in read mode? (Keyword fields tend to look like crap in read mode) and if the field is set to be hidden, it may appear like it is empty, but is instead empty. See if changing the doc mode doesn’t make the value appear.
Subject: RE: Stupid Questions (not a Jeopardy category) – doc item empty after QuerySave values it
Oh. I knew what an alias field was (just not the term).
Anyway, the first entry in the Client field is an alias, --New Client–|0.
The other entries are the result of a @DbColumn, the return value does not include aliases.
The issue is not that the field is hidden, I have checked the value at the view level using the Properties box. The field is not being valued correctly.
At any rate, I am still fairly confident that the problem is the recalculation.