spartacus
14th July 2009, 10:35
I'm trying to limit the number of possible selections on a mocc-form to one (Baan 5.0c).

Therefore I tried this code:


choice.mark.occur:
after.choice:
long occ.no
extern long count
count = 0
for occ.no = 1 to filled.occ |filled.occ is a predefined variable!
if mark.table(occ.no) then
count = count + 1
if count > 2 then
message("To many lines selected")
remove.mark()
endif
endif
endfor


But using the "remove.mark()" function generates an "recursion is yet not implemented" error. --> See attachement.

Meanwhile I suppose, that remove.mark() on Baan5 is not able to handle more than one mark. Is that correct?

mark_h
14th July 2009, 14:49
Interesting - you code works for me on 4c4. No recursion error and it removes all the marks from the records.

spartacus
14th July 2009, 15:41
Hi Mark,

nice to hear that ;-)
So I think I will never solve the problem, because meanwhile the request for a maximum of one select doesn't exist anymore. At the moment I will not have the time to play with it anyways.

Thx for your support and kind regards

shah_bs
14th July 2009, 22:55
Your code works just fine on BAAN IVc3.

So, when you have a moment again, here is a possible 'kludge' to try, if it is acceptable functionality:

a. Use choice.again() instead of remove.mark()
b. execute(find.data) will remove the mark. Since the context of the data is still the same, the worst this will do is reposition the records on the screen to the first set - kind of irritating if the user is on the third page and the validation brings him back to page one.

spartacus
17th July 2009, 09:12
Hi shah,

I tried already with "choice.again" and "execute(find.data)", as an alternative to "remove.mark()".

Interessting that my code will work for all of you and not for me :-)

Perhaps I should have tried with a "log out / log in" into Baan. I think I will try next days again in a test-session.

Kind regards

hardei
17th July 2009, 12:48
does this problem occur due to the Porting set version? :)