1 | initial version |
To retrieve the record from a factbox when a row is chosen, you can use the OnAfterGetCurrRecord trigger.
First, you need to identify the factbox control and the field that contains the record ID. Then, you can use the GetRecord function to retrieve the record from the record ID.
Here's an example code snippet:
trigger OnAfterGetCurrRecord()
var
Factbox: FactBox;
RecordID: RecordID;
MyRecord: Record MyTable;
begin
// Identify the factbox control and field
Factbox := Rec.FactBoxes.GetByControlID('MyFactbox');
RecordID := Factbox.GetSelectedRecordID();
// Retrieve the record using the record ID
MyRecord.GetRecord(RecordID);
// Do something with the record
Message('Selected record: %1', MyRecord.Field1);
end;
In this example, we assume that the factbox control is named 'MyFactbox' and the record ID is stored in the default field 'RecId'. You would need to replace 'MyTable' and 'Field1' with the actual table and field names in your solution.