and this closes the response doc? I think that it should not. Try @Command([CloseWindow]) instead of @Command([FileCloseWindow]). Usually, people ask for how to do it the other way around: How can I make the next formula work in the context of the new document.
N.B.: You can omit @DbName in your compose command. If the doc is to be created in the current database, one argument is sufficient:
Thanks Mr. Harkpabst Melia and Arshad Khalid for your kind response.
But both work around are not working for me!!!
I think when response doc open from parent handler goes to that response doc, for this I use @Command([EditGotoField];“tmpField”); to got the focus in parent doc. then I use @Command([CloseWindow]), this is also not working, It close response doc.
Actually, while the focus does switch to the newly opened response document, the formula context (in which all following formulas are executed) definitely should NOT. Expected behavior would be, that any @Formula or @Command issued after the @Command([Compose]; …) SHOULD always apply to the parent doc!
@UpdateFormulaContext (as suggested by Arshad) was introduced with R6 just to overcome this limitation. But there is no build-in formula to switch the formula context back to what it might have been before. This is what Arshad tries to simulate by the use of
@UpdateFormulaContext;
@Command([NavigateToBacklink]);
@UpdateFormulaContext;
The only difference between @Command([FileCloseWindow]) and @Command([CloseWindow]) is, that the former is always executed after any other formula in the same event, while the latter is executed exactly when the corresponding line is processed (possibly truncating the rest of the formula). In your case, it should not make a difference, as there are only 2 lines of code.
So much for the theory. Now comes the ugly part. You did not mention what release you are on, but - unfortunately - I can easily reproduce everything you said on 7.0.3.
This IS a BUG. Period.
From Designer help on @UpdateFormulaContext:
“For example, if the code accesses a new form called “Response” by using @Command([Compose]:“Response”, @UpdateFormulaContext switches the context of the formula to this new form. Any subsequent functions in the code execute in the context of the Response document, not the current document.”
That’s how I had explained it and how it should work. Obviously, it doesn’t. You should contact IBM support, so this issue can be SPRed.