How should you complete the code segment?
HOTSPOT
You need to define the properties for the Receipt No. field in the Non-conformity table when storing the information to the purchasing department.
How should you complete the code segment? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.
Answer:
Explanation:
field(3; "Receipt No."; Code[20])
{
DataClassification = CustomerContent;
TableRelation = "Purch. Rcpt. Header"."No." where ("Buy-from Vendor No." = field("Vendor No."));
}
Field Declaration:
The field(3; "Receipt No."; Code[20]) part defines the field in the table with ID 3 and type Code with a length of 20. This field will hold the receipt number. DataClassification:
CustomerContent is selected for the DataClassification property, which categorizes the data for privacy and compliance management. This aligns with Business Central’s recommendations for handling sensitive data in customer-related tables. TableRelation Property:
The TableRelation property links the "Receipt No." field to another table, which in this case is the "Purch. Rcpt. Header" table. This ensures that only valid receipt numbers from the Purchase Receipt Header table can be selected or entered in this field. Relation Filter:
The filter condition is applied using the where clause. It ensures that the Receipt No. is only from the Purchase Receipt Header records where the "Buy-from Vendor No." matches the "Vendor No." of the current record.
The condition field("Vendor No.") is selected from the drop-down as shown in the image. This links the vendor information in the non-conformity table to the receipt in the Purchase Receipt Header table.
By linking the "Vendor No." fields, you ensure that only receipt numbers from the correct vendor are available, which improves data consistency and reduces errors during data entry.
DRAG DROP to AL Language:
The TableRelation property is frequently used to create references between tables in Business Central. In this case, the correct relationship between the "Purch. Rcpt. Header" and the Non-conformity table is established using the TableRelation and filter. Reference Documentation:
AL TableRelation Property
AL Field Syntax
Latest MB-820 Dumps Valid Version with 56 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund