My main menu screen is based on a dummy table "Main_menu". On my main menu I have a multistate button and a conditional object that is controlled by a variable passed from the multistate button. On the multistate button are two buttons SALES and QUOTES. When you press SALES the conditional object displays a "Record Entry" Button and a "Record Editing" Button. The Record Editing button contains the following script in the onpush event:
'Opens Sales form for editing
this.disable()
vmode="Edit"
f=:Form.load("EESALES","dialog") 'Browse form only not for entry or editing
f:Tables:SALES_ORDER.filter_expression="quote_status=.f. .AND. orderstatus='Opened'"
f:Tables:SALES_ORDER.order_expression=""
f:Tables:SALES_ORDER.query()
f.activate()
f.restrict_enter=.t. 'no entry at form level
f:browse1.allow_change(.f.)
f.show()
f.close()
vmode=""
this.enable()
END
If you press the QUOTES button on the multistate button the conditional object displays a button that reads "Edit Quotes" the Onpush event uses the same script as above except that the filter expression is "quote_status=.T. .AND. orderstatus='Opened'"
In my application I can change the status of a sales order to a quote by changing the "Quote_status" field from an "F" to a "T".
By pressing SALES on the main menu and then "Record Editing" I get a form containing a browse that lists all open Sales Orders then by pressing QUOTES on the main menu and then pressing "Edit Quotes" I should get the same form listing all Sales Orders that have been changed to "QUOTES". The problem is that pressing SALES then "Record Editing" gets me what I expect but after closing the EESALES form and arriving at the main menu I find that Pressing the QUOTES button and then the "Edit Quotes" gets me the result of the previous operation. The program seems to ignore the new filter expression. If I exit the form and press the QUOTES and "Edit Quotes" button again I get what I am expecting. I can't figure out why it doesn't respond properly to the first button presses while responding properly to the second button presses.
I did notice that the system created a second session on the mainmenu object. Perhaps it is getting confused? And by the way how do you shut down these extra sessions without closing A5.
'Opens Sales form for editing
this.disable()
vmode="Edit"
f=:Form.load("EESALES","dialog") 'Browse form only not for entry or editing
f:Tables:SALES_ORDER.filter_expression="quote_status=.f. .AND. orderstatus='Opened'"
f:Tables:SALES_ORDER.order_expression=""
f:Tables:SALES_ORDER.query()
f.activate()
f.restrict_enter=.t. 'no entry at form level
f:browse1.allow_change(.f.)
f.show()
f.close()
vmode=""
this.enable()
END
If you press the QUOTES button on the multistate button the conditional object displays a button that reads "Edit Quotes" the Onpush event uses the same script as above except that the filter expression is "quote_status=.T. .AND. orderstatus='Opened'"
In my application I can change the status of a sales order to a quote by changing the "Quote_status" field from an "F" to a "T".
By pressing SALES on the main menu and then "Record Editing" I get a form containing a browse that lists all open Sales Orders then by pressing QUOTES on the main menu and then pressing "Edit Quotes" I should get the same form listing all Sales Orders that have been changed to "QUOTES". The problem is that pressing SALES then "Record Editing" gets me what I expect but after closing the EESALES form and arriving at the main menu I find that Pressing the QUOTES button and then the "Edit Quotes" gets me the result of the previous operation. The program seems to ignore the new filter expression. If I exit the form and press the QUOTES and "Edit Quotes" button again I get what I am expecting. I can't figure out why it doesn't respond properly to the first button presses while responding properly to the second button presses.
I did notice that the system created a second session on the mainmenu object. Perhaps it is getting confused? And by the way how do you shut down these extra sessions without closing A5.
Comment