Form Menu_Master has Menu_Name field, which is looked up in Form Cafe_Order_Entry, in field Select_Menu, within a Sub Form.
Selecting a menu name from the drop-down (look up field) in form Cafe_Order_Entry, my goal is to fetch the corresponding Menu_Price field value from form Menu_Master.
My code is this.
- if(Menu_Master[Menu_ID == input.Order_Details.Select_Menu].count() > 0)
- {
- fetched_Record = Menu_Master[Menu_ID == input.Order_Details.Select_Menu];
- alert fetched_Record.Menu_Price;
- alert input.Order_Details.Order_Quantity;
- input.Order_Details.Total_Price = input.Order_Details.Order_Quantity * fetched_Record.Menu_Price;
- }
- else
- {
- alert "No Match Found";
- }
I have written the If block to check the match occurrence, and I am getting the output from the Else block - "No Match Found", meaning that no match is found!
I had seen a line of code before where I didn't have to compare the ID field from the looked up form with the look up field value, and that worked too, but I somehow lost that code, and can't find that again!
Any help here?