Value Retreival

Sankaran_BalasubramonianSankaran_Balasubramonian Member Posts: 20
Hi Sirs,

I am trying to retrieve values based on a field. I have a form which has the PO Number as one of the fields. My requirement is when I select the PO from this fields I need to get the PO date to be filled in the form. I wrote a code for this. I am here by attaching the code below.


IF porecord.GET("PO Number")
THEN BEGIN
"PO Date" := porecord."Order Date";
END;

The code is compiling properly but I am getting an error message as follows when I run the form.

"The Expression Code Cannot be Type - Converted to a Option Value."

Please advice as to what needs to be done to correct this.

Thanks
Balaji
--
Thanks & Best Regards

Sankaran Balasubramonian

Comments

  • krikikriki Member, Moderator Posts: 9,118
    Table 38 has as primary key "Document Type","No.".
    Document type is an option indicated if the record is an order,invoice,quote,credit memo,...
    So you should write:
    IF porecord.GET(porecord."Document Type"::Order,"PO Number") THEN BEGIN
      "PO Date" := porecord."Order Date";
    END;
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Thanks a lot Kriki...It worked....
    I have another qstn.

    How do we set in coding the Number seriries...for a particulare field

    Balaji
    --
    Thanks & Best Regards

    Sankaran Balasubramonian
  • nasheernasheer Member Posts: 78
    When you check with the Customer or Sales Header table C/AL coding part, you can find the function called AssistEdit(xRec).
    This fucntion has the coding part to assign Numbering series value.

    As well check the Sales Order form (42) for the below,
    In OnAssistEdit() trigger of the 'No.' field, the function AssistEdit(xRec) is called.

    Check using the same method or Try write own coding under the OnAssistEdit() trigger of your field in the form.
Sign In or Register to comment.