OnBeforeGetTablesWithMandatoryFields Event
Codeunit Mandatory Fields Mgt.
Used to add support for Mandatory Fields on a card page. Raised before the list of supported tables is retrieved.
Signature
[IntegrationEvent(false, false)]
OnBeforeGetTablesWithMandatoryFields(var TablesWithMandatoryFields: List of [Integer])
Parameters
var TablesWithMandatoryFields
List of [Integer]
The list of supported table numbers. Add the tables numbers for the card pages that has implemented support for Mandatory Fields.
Example
Add support for the Resource table:
[EventSubscriber(ObjectType::Codeunit, Codeunit::"QWESR Mandatory Fields Mgt.", OnBeforeGetTablesWithMandatoryFields, '', false, false)]
local procedure SetTablesWithMandatoryFields(var TablesWithMandatoryFields: List of [Integer]);
begin
TablesWithMandatoryFields.Add(Database::Resource);
end;
Then add the following trigger to the "Resource Card" page:
trigger OnQueryClosePage(CloseAction: Action): Boolean
var
MandatoryFieldsMgt: Codeunit "QWESR Mandatory Fields Mgt.";
begin
exit(MandatoryFieldsMgt.CheckMandatoryFields(Rec));
end;
This documentation is generated from Spider v27.0