The following code has been working really well for half a year now but for some
reason it has stopped behaving. I have an invoicing form that is based on a set
SALESORDER=>SALES_ORD_DETAIL
This is a tabbed form with a browse on each tab. SALESORDER on the first tab and
SALES_ORD_DETAIL on the other. The idea is that the user would highlight the
row on the browse he is interested in editing and then press an EDIT button
There is an EDIT button on both tabs.
The following code is found in the EDIT buttons. The only difference is the name
of the form. My problem is with what happens when I try to open the form associated with the eesodet_pop form.
I always get the previous record! It never pulls up the record the cursor is on
when I press the EDIT button. In order to get to the desired record; I have to
highlight the record I want on the browse; then I have to press the EDIT button
to open the form, I would then close the form and press the EDIT button again.
This is a real pain having to go in and out twice each time I have to edit a record.
I have used the debugger to watch the vdetRec value. The correct value is actually
getting into the variable. I is really frustrating to watch the program time and
time again ignore the filter_expression. In fact, as I am going through the code step by step in the debugger, I find that the debugger stops at;
f2 = :Form.load("eesodet_pop","Dialog")
then it goes straight for ;
f2.show()
It doesn't bother going through the code in between! For some reason this happens only in the form that contains this EDIT button. This debugger behavior doesn't happen in any other form. The :form.load also fails to pick up the proper record.
The following is the code in the EDIT button.
vRec = Recno()
vdetRec = alltrim(str(vrec))
f2 = :Form.load("eesodet_pop","Dialog")
f2:TABLES:sales_ord_detail.filter_expression = "between(recno(),"+vdetRec+","+vdetRec+")"
f2:tables:sales_ord_detail.order_expression = ""
f2:tables:sales_ord_detail.query()
f2.show()
reason it has stopped behaving. I have an invoicing form that is based on a set
SALESORDER=>SALES_ORD_DETAIL
This is a tabbed form with a browse on each tab. SALESORDER on the first tab and
SALES_ORD_DETAIL on the other. The idea is that the user would highlight the
row on the browse he is interested in editing and then press an EDIT button
There is an EDIT button on both tabs.
The following code is found in the EDIT buttons. The only difference is the name
of the form. My problem is with what happens when I try to open the form associated with the eesodet_pop form.
I always get the previous record! It never pulls up the record the cursor is on
when I press the EDIT button. In order to get to the desired record; I have to
highlight the record I want on the browse; then I have to press the EDIT button
to open the form, I would then close the form and press the EDIT button again.
This is a real pain having to go in and out twice each time I have to edit a record.
I have used the debugger to watch the vdetRec value. The correct value is actually
getting into the variable. I is really frustrating to watch the program time and
time again ignore the filter_expression. In fact, as I am going through the code step by step in the debugger, I find that the debugger stops at;
f2 = :Form.load("eesodet_pop","Dialog")
then it goes straight for ;
f2.show()
It doesn't bother going through the code in between! For some reason this happens only in the form that contains this EDIT button. This debugger behavior doesn't happen in any other form. The :form.load also fails to pick up the proper record.
The following is the code in the EDIT button.
vRec = Recno()
vdetRec = alltrim(str(vrec))
f2 = :Form.load("eesodet_pop","Dialog")
f2:TABLES:sales_ord_detail.filter_expression = "between(recno(),"+vdetRec+","+vdetRec+")"
f2:tables:sales_ord_detail.order_expression = ""
f2:tables:sales_ord_detail.query()
f2.show()
Comment