Only display details in lookup/search window that match values shared in two fields

I only want the details displayed in the lookup/search window that match the value of the ‘PlantLocation’ field (eg U980) in the Adjustment Form with the value ‘PlantCodeUp’ field (eg. U980) in the MaterialCodeDesc Form. I will be uploading approximately 50,000 plant codes. Each plant code has prices which can be different depending on their location…

Is this possible?

Adjustment Form

MaterialCode_1 (field)

Default Value = MaterialCode1

Dialog List field – Use Dialog View for Choices

Looks up View – LookupMaterialCodeDesc – with field PlantCodeUp

PlantLocation (field)

Default Value = PlantCode

Dialog List field - Use formula for choices

Looks up View – LookupPlantCodeDesc with field PlantCode

Input Translation

Have tried:

SELECT ((Form = “Adjustment Form”)) & ((Form = “Material Code Desc Form”)) & (@Contains(PlantLocation;PlantCodeUp))

SELECT ((Form = “Adjustment Form”)) & ((Form = “Material Code Desc Form”)) & (@Matches(PlantLocation;PlantCodeUp))

Subject: @DbLookup

When I do something like that, I use @DbLookup in the second field to get the values. The @DbLookup will use the other field to filter the values in a categorized view.

Subject: KARL-HENRY Can you please help with the code?

Hi Karl-Henry

I have cateogorize the MaterialCode_1 column and when I search it still finds the Material Code,but displays all Plant Codes belonging to that Material Code. I don’t know how to restricted the data to only show the description etc. for one plant code only.

For View Selection I have:

SELECT ((Form = “Material Code Desc Form” : “Adjustment Form”)) & (@Contains(PlantCodeUp; PlantLocation))

Can you show me how to do this.

‘AdjustmentForm’ contains the - ‘PlantLocation’ field is selected at the top the form eg U666

This lookup uses ‘Material Code Desc Form’

The value for the ‘MaterialCode_1’ field (on the Adjustment Form) is the lookup view which the user can enter a Material Code eg 0012356 and search. But I only want to display the MaterialCodeUp_1, MaterialDescUp, Adj$Up if ‘PlantLocation’ field equals ‘PlantCodeUp’ Eg. U666

0012356 Desc1 $111 U222

0012356 Desc1 $120 U666

0012356 Desc1 $150 U700

MaterialDesc_1 value

@If(MaterialCode_1 = “”; “” ;@DbLookup(“”:“”;“”:“”;“LookupMaterialCodeDesc”; MaterialCode_1; 2))

Adj$_1 valule

(@If(MaterialCode_1 = “”; “” ;@DbLookup(“”:“”;“”:“”;“LookupMaterialCodeDesc”; MaterialCode_1; 3)))

Regards,

Marion