KVSKBAServiceContractManagment#
Events#
OnBeforeSetDefaultSalesperson(Record Service Contract Header, Boolean) :#
Summary: Event raised before setting the default salesperson for a service contract header.
[IntegrationEvent(false, false)]
local procedure OnBeforeSetDefaultSalesperson(var ServiceContractHeader: Record "Service Contract Header"; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAServiceContractManagment", 'OnBeforeSetDefaultSalesperson', '', false, false)]
local procedure DoSomethingOnBeforeSetDefaultSalesperson(var ServiceContractHeader: Record "Service Contract Header"; var IsHandled: Boolean)
begin
end;
Parameters:
ServiceContractHeader: The service contract header being processedIsHandled: Set to true to skip the default salesperson assignment logic
Remarks: This integration event allows extensions to intercept and customize the default salesperson assignment process before it executes. Subscribe to this event to implement custom salesperson assignment logic, validate conditions, or prevent the standard assignment by setting IsHandled to true. The event is called after verifying the contract exists and before retrieving user setup, customer, and sales setup data. Useful for implementing custom business rules for salesperson assignments, handling special contract types, or integrating with external systems for salesperson determination.
OnAfterSetDefaultSalesperson(Record Service Contract Header) :#
Summary: Event raised after setting the default salesperson for a service contract header.
[IntegrationEvent(false, false)]
local procedure OnAfterSetDefaultSalesperson(var ServiceContractHeader: Record "Service Contract Header"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAServiceContractManagment", 'OnAfterSetDefaultSalesperson', '', false, false)]
local procedure DoSomethingOnAfterSetDefaultSalesperson(var ServiceContractHeader: Record "Service Contract Header")
begin
end;
Parameters:
ServiceContractHeader: The service contract header with the assigned salesperson codes
Remarks: This integration event allows extensions to perform additional processing after the default salesperson has been assigned to a service contract. Subscribe to this event to implement post-assignment logic, update related records, trigger workflows, send notifications, or perform additional validations based on the assigned salesperson codes. The event is called after both the primary Salesperson Code and the secondary KVSKBADefSalespersonCode2 have been determined and validated. Useful for extending the salesperson assignment process with custom business logic or integrating with external systems.