I can't pickup field County from a code lookup that refers to Post Code Table AL

Hi,
AM trying to lookup field "county" from post code table using the code field so that after successfully picking the code field in my page the county field should populate from the post code table.
When I lookup the code field in my page, the break point sets its self on vscode on the line that's lookin up. And when I go back to BC page, my page hangs and displays a message "working on it".
I need to pick the field county on page. Kindly assist?
  • The primary key for the table 225 "Postal Code" is "Code","City" and you can't do the action which you wrote.

    1 error - you need to use Lookup-action instead of validate.

    2 error - you can't write table relation "Postal Code".Code because you are trying to store the "County" field and it is out of the PK.

    2 error - write something like:

    var PostalCode record "Post Code";

    PostalCodesList page "Post Codes"

    begin

    PostalCode.reset;

    PostalCode.SETRANGE|SETFILTER - write filters here..

    clear(PostalCodesList)

    PostalCodesList.SETRECORD(PostalCode)

    PostalCodesList.SETTABLEVIEW(PostalCode);

    PostalCodesList.LOOKUP(TRUE);

    IF PostalCodesList.RUNMODAL = ACTION::LookupOK then begin

    PostalCodesList.GETRECORD(PostalCodes);

    CountyNo := PostalCodes.County;

    end;

Related
Recommended