Francesco
19th August 2002, 23:46
Hopefully a simple question:

From a custom form, I want to zoom to general item data, but _only_ allow the user to select a generic item.
Preferably, all the user would see in the zoom list is a subset of generic items only.

Now how do I do that.?

NPRao
20th August 2002, 00:38
Francesco,

You might try to use the coding with the function -

http://www.baanboard.com/programmers_manual_baanerp_help_functions_sql_query_extensions_query_extend_where

Hope it helps you out.

Francesco
20th August 2002, 00:39
I got it.

With a little help from my collegue....

query.extend.where.in.zoom(" tcibd001._index6 = {tckitm.generic} ")

in before.zoom does the trick.

However, because I was using a field that had the standard item domain (tcitem), and as such was segmented, it was not getting to the before.zoom session (don't ask me why, apparently segmented fields have their own set of zoom rules).
Once I changed the domain on the form fields, it worked like a charm.

Francesco
20th August 2002, 00:40
NOW he tells me ;)

NPRao
20th August 2002, 00:45
well your impatient... and... and I posted it before you did.. :p

BTW, I dont know there is an option in this forum, that I can subscribe to any threads/topic, that if anyone makes a posting there, I would get a notifier :confused:

Francesco
20th August 2002, 00:51
...it's those "customers" that want everything...NOW.

yawl 'now that song.

Anyway, there is an option just below the 'new thread' button at the top of each forum to subscribe to it.

and btw, thanks Prashanth.

patvdv
20th August 2002, 00:55
NPRao,

Right underneath this post is a link called Subscribe to this thread :)

NPRao
20th August 2002, 00:57
Francesco,

Good thread to open up... this was at the back of my mind... and I found my notes now, it will help you with more info -


query.extend.where.in.zoom() - Within this function the query can be defined in a main session, and should be parsed and executed in the sub- session.
A behavior of the usage of this function is, that program variables cannot be bind into the query string, because the program variables are often not known in the sub-session. Therefore, the query string has been build up by concatenating the program variables into that query string.
Program variables of all data types are used in this concatenation.

Problem
The problem is the concatenation of program variables of data type string. Normally this works fine, but if the concatenated variable in runtime contents a single quote char (') or double quote char ("), a runtime query error will occur in the sub-process.

Example:
query.extend.where.in.zoom("whwmd210.cwar = """ & cwar.t & """")
If the value of cwar.t (length=3) is A"B, the resulting where condition will become:
whwmd210.cwar = "A"B"
As can be seen, the double quote's are not matching, so a runtime query errors will occur.

The same problems will occur on the next definition:
query.extend.where.in.zoom("whwmd210.cwar = '" & cwar.t & "'")
If the value of cwar.t is A'B, also a runtime error occurs.

So, concatenation of strings in function query.extend.where.in.zoom() will give runtime errors when users have single- or double quotes in their codes.
The same is true for the function query.extend.where(). But in this construction concatenation it is almost never implemented, because there is no need to do concatenation.

The concatenation in query.extend.where.in.zoom(), and SET.BROWSE.FILTER.UI() has been implemented in BaaN-5 about 1100 times.

Solution
quoted.string() - This function will handle quotes in string variables in that way that concatenation will be according to the syntax rules.
Implementation of quoted.string():
query.extend.where.in.zoom("whwmd210.cwar = " & quoted.string(cwar.t))
This function will analyze the contents of the variable and will put quotes around it.
So, when cwar contains: ROB'S , the query string will become: whwmd210.cwar = "ROB''s"
And when cwar contains: ROB"S , the query string will become: whwmd210.cwar = 'ROB"s'

NPRao
20th August 2002, 02:51
Francesco,

I found more interesting info today -



iBaan ERP Tools

Auto complete
In iBaan ERP 5.2a, string fields, and multibyte string fields that have a directreference to another iBaan ERP table, can support Auto Complete functionality.

In fields with Auto Complete functionality implemented, when you enter an incomplete value, and press the TAB key:
If your incomplete data matches only one record in the field’s table, iBaan ERP completes the record in the field, and the cursor moves to the next field. If your incomplete data matches more than one record in the field’s table:
−−−−iBaan ERP underlines and turns the data in the field red.
−−−−If you right-click on the field, iBaan ERP displays the best seven matches to your incomplete data, and a More… option . You can select a record from the list, or More… to view all the matching records from which you can make a selection.
−−−−iBaan ERP completes the entry in the field with your selected record, and the cursor moves on to the next field.
For a field to support Auto Complete functionality:
The field must have a zoom session.
If the zoom session’s return field is a table field, the return field must be part of the zoom session’s reference table.
Auto Complete functionality is not supported for:
Segmented fields.
Fields with centered or right-aligned data.
Fields with a field button.


Isnt that cool ? seems, BaaN is going in line with Microsoft style of development/user interfaces and we might be looking out for some new suprises... :p

Francesco
20th August 2002, 21:42
But I just heard this morning that we are NOT going to upgrade for a while (despite earlier statements that we were going to upgrade ASAP....lalala - what a wonderfull world - lala la).

This means I am stuck in my little 5b world and I don't want to hear about goodies that I can't get my hands on. :(

~Vamsi
20th August 2002, 23:12
Francesco,

Preferably use the correct domain. Here is how you make your zoom work with a segmented field:

field.myfieldname.segment.1:
before.zoom:
myfunction1()

field.myfieldname.segment.2:
before.zoom:
myfunction2()

Francesco
20th August 2002, 23:54
Very usefull information. Didn't know you could do that.