Setup:Form has a two row table.
Row 1 = embedded editor
Row 2 = embedded single category view.
Both the form with the embedded editor/view and the form used as the embedded editor are set to not refresh fields. I tried it with refresh on and there was no change in the outcome.
Embedded editor has all elements on the form set to hide when embedded excep the action bar.
The action bar has seven main actions with 7 sub-actions.
The main actions match fields created for each day of the week.
The intent is to provide the user with one or two docs they need to manage and make it look like a view with actions.
I need the docs to go into and out of edit mode since I have a subform that uses the PostOpen and QuerySave events to generate an audit trail.
Each action is basically the same:
Pass a set of pre-determined values to the INI file.
Call an @Function agent.
The agent:
Put the doc in edit mode
Reads the INI values
Uses @Setfield to set the field values
Save the doc
Exit edit mode.
If I use one of the buttons, it works great.
Most of the time, if I step through one sub action for each day of the week in a single go, everything works great.
If, however, I start to use different sub-actions in a single session, the actions work every other time.
If I
Click the doc in the embedded view
Execute a sub-action
Click the doc in the embedded view
Execute a sub-action
Everything works great.
So, it appears that, for some reason, some sequence of action clicks results in the embedded editor loosing it’s handle on the doc in the embedded view.
The subform code does not do anything to the document, it only creates new audit trail docs. I disabled the subform code and nothing changed.
Because of the way our network is set up, I can’t copy/paste the code here so below is a conceptual model of the code. Essentially, I pass in the field names I want to update and values for those fields.
There is more code, but none of it triggers a file save.
Button:
@SetEnvironment(“FieldToEdit”;“Field1”);
@SetEnvironment(“Value1”;“Something”);
@Command([RunAgent];“MyAgent”);
MyAgent:
@Command([EditDocument];“1”);
FieldToEdit := @Environment(“FieldToEdit”);
MyVal := @Environment(“Value1”);
@SetField(FieldToEdit;MyVal);
@SetEnvironment(“Value1”;“”);
@PostedCommand([FileSave]);
@PostedCommand([EditDocument];“0”);
I’ve searched here, no hits on this specific problem.
I’ve been to Chris Blatnick’s site and can’t find anything there.
I’ve tried a nuber of different things, all to no effect.
Add ‘EditSelectAll’ at the start of the agent.
Add ‘EditSelectAll’ at the end of the agent prior to exiting edit mode.
Moving all of the code into each button.
Move the ‘EditDocument’ code into the button
Create one agent to enter edit mode, one to update the data, and one to save/exit edit mode.
Killed a chicken.
I don’t understand why and embedded editor wouldn’t edit a document in an embedded view.
TIA for any help.
Doug