0
votes

I have a scenario in which there are three fields, based on the selection of First Field( 3 values in first field),the next field is getting values ( it is a dialogue list field) through DBcolumn. and then on the basis of selection of second field the third field is coming. All the above mentioned field are dialogue list field.

The issue is with multi selection, when ever multi values are selected out of first field the next fields are coming as DBColumn is used (due ot lesser values), but Since second filed has lots of values, we have to use DB Look up and here the multi selection is not fetching the data for corresponding filed.

Eg. I have a field named Database (having 3 values), and other two fields are Project(many values) and Brand.

I am using DBColumn to get Values in Project Field from Database field Selection (multi-selection), which I am getting properly (using @if), but after multi selection of Project Field (there are many values) I am not able to get values in next field (using DBLookup).

Please let me know any workaround....

1

1 Answers

1
votes

First: Your code would have probably helped in solving this problem, although I think, it is not code- related:

Please check the field- property "refresh fields on keyword change" on the Project and the property "Refresh Choices on document refresh" on the Brand- Field.

If you do not get ANY- values whenever you select a second Project, then check, if your Key for Lookup is correctly used as an Multiple value for your DBLookup and that it does not try to lookup something like "value1;value2" instead of "value1" : "value2"...

Bets practice for debugging something like this, is to have a "BrandList" field, Computed for Display, hidden, with the DBLookup in it:

_viw := "YourViewName";
_crit := Project;
_col := 2;
REM "Don't do lookups, if project is empty"; 
@if( _crit = "" ; @Return( "" ) ; "" ); 
_lkp := @DBLookup( "" : "NoCache" ; _viw ; _crit ; _col );
@if( @IsError( _lkp ) ; "" ; _lkp );

And the let the brand point to this field (simply use the fieldname as Formula). that way you can easily debug the returned values.

In addition: If you are not sure, that there will be Brands for every Project you select, you need to add [FailSilent] to the lookup, otherwise the whole lookup will fail, if only one of the projects cannot be found... _lkp := @DBLookup( "" : "NoCache" ; _viw ; _crit ; _col; [Failsilent] );

BUT: Failsilent is very bad when debugging something, as you never get an error Message... AND: For debugging purposes, you of course do NOT use the @IsError- line and simply return _lkp...