Hi,I have a field (dialog list, editable) on a form, that previously used an @Dblookup. Unfortunately, now such a lookup does not work, as it returns more than 65 000 bytes of data.
Now, I am using (in the same field) the option to ‘Use View Dialog for choices’ - this is great, as a) it works, and b) You can easily find what you are looking for with using ‘Quick search’ functionality’.
The field itself is OK (it is just the ‘company name’, but I want other fields (some computed, some editable) also set based on the values from the inital line selected.
I want the selection to occour ONCE only - my customer is very particular about this - but the user selects the relevant line - and fields are populated based on their choice…
Surely you must be able to do this? Otherwise, using this option is very limited, and theres little point looking at views with more than one column?
Previously these fields where based on @Dblookups - of course, just like the original one, these no longer work (too much data).
Subject: Need to use view dialogue for choices, and then set fields based on the line selected
Hi Andrew,
I do this all the time. They most efficient way I found to accomplish this is to forget about the dialog list all together. Create a button instead that does an @Picklist from the view you want.
Format the view so that the first column makes sense to the user but return a column from further right with all the detail you need. Think web here and query string type info.
IE: Customer by Name view… first column is Customer Name, second column might be a formulat that would return something like…
CName=ABC Company~CId=12345~CPhone=555-1212
etc etc
Assign this return value to a hidden field and then in each of the fields you want your users to see use a formula like:
Company Name field - @Middle(HiddenField;“CName=”;“~”)
Continue this for all fields you need. this way you don’t need a bunch of DBLookups.
PS. In your button don’t forget to refresh the form so you computed fields get updated.
Cheers,
Mark
Subject: RE: Need to use view dialogue for choices, and then set fields based on the line selected
Mark,Thanks - that sounds fine…
BUT - and I guess this is the crucial link I am missing - How do you get the information into the hidden field.
My picklist for the button & set code is:-
choice:=@PickList( [Custom] : [Single] ; @DbName ; “Customers” ; “Select a customer” ; “Please select the customer” ; 1 );
FIELD HiddenField :=Choice;
But this just puts the customer name (ONLY) in the hidden field (I want ALL the information it returns - or even just one other field for now, just to prove it works)…
Subject: RE: Need to use view dialogue for choices, and then set fields based on the line selected
Hi Andrew…
you need to return a different column than “1”
Your code:
choice:=@PickList( [Custom] : [Single] ; @DbName ; “Customers” ; “Select a customer” ; “Please select the customer” ; 1 );
FIELD HiddenField :=Choice;
New code:
choice:=@PickList( [Custom] : [Single] ; @DbName ; “Customers” ; “Select a customer” ; “Please select the customer” ; 2 );
FIELD HiddenField :=Choice;
@Command([ViewRefreshFields])
Where column 2 is a formula that creates the return code as demonstrated in my first reply.
Something like:
CName := CompanyName;
CId := CompanyID;
CPhone := CompanyPhone;
“CName=” + CName + “~CId=” + CId + “~CPhone=” + CPhone… etc.
Cheers,
Mark
Subject: RE: Need to use view dialogue for choices, and then set fields based on the line selected
Mark,Thanks a lot - that works a treat…
Subject: Need to use view dialogue for choices, and then set fields based on the line selected
Another option would be to set the returned column to @Text(@DocumentUniqueID). Then you could use LotusScript to get the document (db.GetDocumentByUNID) and access anything you want, no weird parsing required.
HTH,
Charles