Ranges on field in dialog window

Hello guys, i have dialog with 3 fields. First one is not a problem but the other two.

I want to have range in field with customers depend on field with company.

When i pick some company i want to get in the second field list of customers only from this company. Really don’t know how to do this. I was reading something about custom lookup but really dont know how to make use of this in my project.

Thanks for your help!

You can use UI builder class and override lookup method of the controls on the dialog. Have a look at COSCalculationReportUIBuilder.