Expression Error

Expression Error

Hi,
I have a Form by name Document_Library which has following fields.

1. Document Type
2. Document Reference Number
3. Cargo Arrival Date

Field 1 and 2 is updated much before the Cargo Arrival date. To update Cargo Arrival date, the user has to search by Document Reference Number. For this I have created a stateless form which has got Document Reference number as a lookup field.

x = Document_Library[ID == input.Document_Library];
openUrl("#Form:Document_Library?ID=" + x.ID,"same window");

On clicking Search Button, I am opening the Document_Library form by passing the ID. The objective is to load the form with Document Type and Document Reference number pre-populated but somehow I am not able to get the details.

x=Document_Library[ID==input.ID];
input.Document_Type=x.Document_Type;
input.Document_Reference_Number=x.Document.Reference_Number;

I am getting this error In Criteria left expression is of type STRING and right expression is of type BIGINT and the operator == is not valid.

Please suggest.

Regards,
Dinesh