suhas-mahajan
11th May 2007, 13:31
Hi Friends,

I would like to make a maintain session, where user will enter three fields:
1. User
2. All Warehouses? (Yes/No)
3. Warehouse

If "All warehouses" is selected "No" then third field warehouse will enable. If user selects "Yes", I have to save Yes entry (do not want to delete already saved warehouses, if any), but I am unable to assign warehouse field as a blank or "ZZZ", which couldnt keep "Yes" record.

I tried different types of forms and Indexes, but without success.:(

I have also checked similar kind of sessions ex. ttaad4130m000 but seems they are different in terms of fields and they are using high priority logic.

Just curious, How you people solve this in simpler way?

regards,

-Suhas

suhas-mahajan
11th May 2007, 13:34
Forgotton attachment.

mark_h
11th May 2007, 15:09
Just add a button that says "Set all warehouses". This would run a little routine to update the records - replacing no with yes. Since this is part of the key you might want to add your own edit checks - it sounds like you do not want the user id twice with all warehouses no and all warehouses yes. Something like the "copy user" button on that tools session.

suhas-mahajan
12th May 2007, 09:43
Mark,

Thanks for the info.

Ok...I will add two buttons "Set All warehouses Yes" and "Set All warehouses No". I can write that subroutine to replace No records.

But, suppose first time user has entered username and "All warehouse - Yes" then...BaaN will not keep that record because it require key field to complete record and that is warehouse. Thats why I thought to explicitely complete it by inserting "ZZZ" using db.update/db.insert, but seems not working because its multi-occurance form.

You are right, I do not want user twice.

I repeat, do not want to delete/change "No" records unlike Normal User to Super user in Maintain user data. I want to prioritise "Yes" records like ttaad4130m000 session.

What you say?

regards,

-Suhas

suhas-mahajan
14th May 2007, 14:07
Thanks Mark.

I have changed logic by separating it in two different sessions.

Seems working fine.

regards,

-Suhas

mark_h
14th May 2007, 16:58
I did this once.

choice.start.set:
after.choice:
on.main.table(check_found)
if found then
execute(find.data)
endif

functions:
function void check_found()
{
select tpbcr600.*
from tpbcr600
where tpbcr600._index1={:tpbcr600.gcid, :tpbcr600.cprj, :tpbcr600.clin}
selectdo
found = true
selectempty
found = false
endselect

}


That might be what your are looking for.