Hi Rizwan,
If I understand this, what you need is to select a certain document contract in a certain field in your customer contract table.
This should open a list of document contracts where the document state code is the same as in your contract table?
If this is correct, then I'd suggest using this approach:
- on the Customer Contract page, on lookup event of the field you want to contain your document contract number write something like this:
DocumentContractRecord.RESET();
DocumentContractRecord.SETRANGE(StateCode,CustomerContractRecord.StateCode);
IF Page.RUNMODAL(0,DocumentContractRecord) = Action::LookupOK Then
BEGIN
CustomerContractRecord.DocumentContractCode := DocumentContractRecord.Code;
...
END;
Where CustomerContractRecord can be your Rec variable on the page, but I wrote it that way so it is clear what it is.
Cheers,
Robert
If this helps in resolving your issue, please verify my answer!