smi4975
26th February 2010, 21:33
Hello Guys,
I need a help in finding a logic to get this done. I have a form( type 3).I'm displaying a set of calculated variables on the form.<<Find the attached screen-1>>
Here is what i require:
1. When i try to select a particular record, the calculated values should be displayed for the specific record. -- i have no problems in that.
2. Also when i select the record, it should be marked so that i can click on the button to navigate to next session.

Here is what i tried. <<coding>>
choice.mark.occur:
after.choice:
get.prices.by.pricelists() --to fetch calculations
execute(find.data)
refresh()
|***** Used b'cos the marking was not occuring after refresh()*****|
if not marked then
mark.occ(actual.occ)
endif

My problem is:
1. when i select a record say at position 15, it displays the calculated values and marks the record..prefect..but scrolls the previous set of records and on the screen i see only the 15th and the rest of the records.<<attached Screen-2>>

I do not want the records to scroll up like this, unless the user exclusively scrolls using the bar. How can i prevent this...

Please suggest!!!

BaanInOhio
28th February 2010, 03:56
Before you process the selection (mark), save the primary key values for the first occurrence (do.occ.without update) for occurrence #1. The function in the 2nd argument saves the key view fields from the table fields in local variables.

do.occ.without update(save.first.rec, 1)

function save.first.rec()
{
local.var1 = table.keyf1
local.var2 = table.keyf2
::
}


Upon return from the zoomed session, put the saved key (local) variables in the table variables and execute(find.data). That will ensure that the record that was at the top of the form before marking/zooming will be at the top when the zoom returns.

table.keyf1 = local.var1
table.keyf2 = local.var2
execute(find.data)

mark_h
28th February 2010, 03:57
Well I don't know the answer, but the execute find will always move the found record to the top of the screen. Have you tried with out the find?

You know you can mark an occurance and then just process the marked occurance with do.occ(). Try searching on that and see if that helps. Here is one thread (http://www.baanboard.com/baanboard/showthread.php?t=54492&highlight=do.occ%28%29) that has some samples.

wiggum
1st March 2010, 16:55
Try following:
- remove "execute(find.data)"
- add "display()" for all calculated fields instead