suhas-mahajan
29th May 2003, 14:17
Dear *.*
In a new generated session, BaaN has created a small Find Form for me and I don't know, how it has choosen the fields for finding. Definitely it is not depends on index.
Can anybody tell, What is the logic behind the Find Button & its Contents?
How to change the find fields?
-Suhas
lbencic
29th May 2003, 19:38
Suhas -
I have found that it does depend on the current key (index) of the user in the session. The only exception I found is that if all of the index fields are not on the current form then I dunno how it determines which one to display..I think the next index that DOES have all the fields on the form.
If this is the case for you, and you do not want to show one of the index fields on the form, you can put the field on the form, and turn off the 'echo field' option on the form field, and it will not display, but will appear when the user chooses 'find'.
Hope that helps.
NPRao
29th May 2003, 20:03
Suhas,
Lisa is right and the fields in the find option do depend on the current index.
I am not quite sure in the BaaN-4 series, but here is an example from our BaaN-5.2 version.
NOTE- I think this feature might be quite enhanced with the use of the Dynamic Index Switching, a new feature in the tools set.
lbencic
29th May 2003, 22:05
Yes, seems it's working the same in IV and V in that respect.
I another question about interacting with the find though, can I pass it a default value?? I have tried, in Baan IV at least, and can't seem to. I tried:
choice.def.find:
before.choice:
tdsls040.odat = 0
And, when the user chooses 'find', the code gets called, but when the Find screen comes up, the order date is set to the last order date that was current in the session, not the 0 that I set it to. I would like to default it to 0.
Any ideas?
NPRao
30th May 2003, 02:58
Freebie for you Lisa,
choice.def.find:
before.choice:
zmadm200.user="bsp"
make.current()
This fills up the index-field with this value. The only issue I faced is if you click Cancel it finds the record and the display looks wierd.
Maybe you can try to get this working or log a case with BaaN support and share more info with us here. :)
suhas-mahajan
30th May 2003, 08:10
Respected NPRao/Lisa,
Thanks for reply. I got the logic of it. Find Button works on current index only, it is correct. Problem was in my new generated session, I have changed some of index fields as Display type at form field level.
More specific :
Total Fields : 5
1. SrNo (Auto Counter)
2. Date (System Date)
3. Time (System Time)
4. Supplier Code
5. Supplier Name
Only one index :
1. SrNo (Auto Counter)
2. Date (System Date)
3. Time (System Time)
4. Supplier Code
I changed 1, 2, 3 as Display type at form field level and added counter code behind SrNo.
Later when I pressed Find Button, it asked me Supplier Code only which was Input Type, and when I entered any supplier code, it cannot finds for me, which is again problem.
My query is, What changes I have to do for asking SrNo in Find Form without changing SrNo to Input Type? or in other words, How to customize Find form?
-Suhas
Svetlana
30th May 2003, 12:55
Hi,
Maybe...
SrNo of input type
Init.form:
InputField.invisible ("SrNo")
choice.def.find
Before.choice:
InputField.visible ("SrNo")
choice.def.find
after.choice:
InputField.invisible ("SrNo")
mark_h
30th May 2003, 16:50
suhas-mahajan:
You can try this:
(1) First make the fields srno input on the form.
(2) Set up a test boolean variable.
domain tcbool dofind
(3) Set up a before.input section on the field - this will only allow input when you do a find.
field.tablename.srno:
before.input:
if dofind then
attr.input = 1
else
attr.input = 0
endif
(4) Set up def.find section:
choice.def.find:
before.choice:
dofind = true
after.choice:
dofind = false
This should only allow input the srno field. You can do the same for the other fields. I am not sure what this will do to your other code for populating the srno & date fields.
and for Lisa -
I tried doing that once and was never able to figure out how to get it to clear the fields before the find came up. It always wanted to use the current record. That is why I think NPR's solution may not work - it would always find a record. But please correct me if I am wrong.
Good Luck!
Mark
suhas-mahajan
31st May 2003, 08:20
Hi Mark,
Thanks for providing meticulous solution. It worked for me well.
Two small issues is there, which I found i.e. when I entered SrNo which is exact previous SrNo of current SrNo, it is no finding it, Why I don't know? Secondly, How to change color of SrNo from white to grey i.e. input to display. These two issues are not important, I can pass on my users. But as a tech. person, I should know.
Thanks Again.
-Suhas
mark_h
1st June 2003, 03:24
It is probably not finding the record because of the index. In order for it to find the previous record you have to enter all of the fields correctly, including the system time. Since I am not familiar with the session that is my best guess. I probably would have changed the order of the index also - supplier code, srno, system date, system time. This way the user could find any record by entering supplier code and serial number - they would have to blank the date and time fields. Sorry but I really do not know the requirements so recommending changes is hard.
I do not think you can grey out the fields in Baan 4 versions. This has been discussed before and I do not think you can do it. I will look for some threads and check.
Mark
Here is one thread (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=6879&highlight=input) that talks about changing a form field from input to display.