Works in R5 not in R6 --> uiws.currentdocument

Hello,We are migrating databases from R5 to R6.

Following logic exists in one of the database.

1> DocA composes DocB in QueryClose event using Formula language

2> DocB embeds an excel sheet to display. An agent is executed(using formula language) in the PostOpen event of DocB to achieve this.

3> The Agent uses the current document to retrieve some values for calculations on the Excel sheet

Now when agent runs in R5,

set uidoc=uiws.currentdocument

retrieves (as expected) DocB)

But in R6, uidoc is getting set to DocA!!!

As a result the entire subsequent code in the Agent goes for a toss.

Please let me know what is the workaround for this. I need to access DocB in the agent and not DocA.

I tried closing DocA before composing DocB but to no avail.

regds

Santosh