KVSKBAContactLib#
Procedures#
GetContNoByNoAndTableID(Code[20], Integer) : Code[20]#
Summary: Retrieves the contact no. associated with a given primary key and table ID.
procedure GetContNoByNoAndTableID(No: Code[20]; TableID: Integer): Code[20]
Parameters:
No: Primary key for searching.TableID: Identifier specifying the table type (e.g., Customer, Vendor, Bank Account).
Returns: The contact no. corresponding to the provided primary key and table ID.
Remarks: Searches contact business relations to find the contact number linked to the specified entity. Returns empty string if no unique relation is found or if parameters are invalid.
GetCurrNoAndTableIDByContNo(Code[20], Code[20], Integer) :#
Summary: Retrieves the preferred no. and table ID associated with the given contact no.
procedure GetCurrNoAndTableIDByContNo(ContactNo: Code[20]; var CurrNo: Code[20]; var CurrTableID: Integer):
Parameters:
ContactNo: The contact number for searching.CurrNo: The preferred no. corresponding to the contact number.CurrTableID: The table ID specifying the type of record (e.g., Customer, Vendor, Bank Account, Contact).
Remarks: Attempts to find business relations in order of priority: Customer, Vendor, Bank Account, and finally Contact itself. Returns the first match found or defaults to Contact if no business relations exist.
GetSalutCodeByNoAndTableID(Code[20], Integer) : Code[10]#
Summary: Retrieves the salutation code associated with the provided primary key and table ID.
procedure GetSalutCodeByNoAndTableID(No: Code[20]; TableID: Integer): Code[10]
Parameters:
No: Primary key for searching.TableID: Identifier specifying the table type (e.g., Customer, Vendor, Bank Account).
Returns: The salutation code corresponding to the provided primary key and table ID.
Remarks: First resolves the contact number from the business entity, then retrieves the salutation code from the contact. Returns empty string if contact is not found or no salutation is defined.
CalcNumberOfSalesDocByContNo(Code[20], Integer) : Integer#
Summary: Calculates the number of sales documents associated with the provided contact no. and document type.
procedure CalcNumberOfSalesDocByContNo(ContactNo: Code[20]; DocumentType: Integer): Integer
Parameters:
ContactNo: The contact no. for whom the documents are to be calculated.DocumentType: The type of document to consider (e.g., sales order, invoice).
Returns: The number of documents related to the provided contact number and document type.
Remarks: Resolves contact to customer relationship and counts matching sales headers. Provides integration event for handling non-standard table relationships.
CreateActivityByContNo(Code[20]) :#
Summary: Creates an activity related to the current contact.
procedure CreateActivityByContNo(ContactNo: Code[20]):
Parameters:
ContactNo: The contact number for whom the activity is to be created.
Remarks: Uses the standard Contact.CreateInteraction method to create a new interaction/activity for the contact.
CreateOpportunityByContNo(Code[20]) :#
Summary: Creates an opportunity related to the current contact.
procedure CreateOpportunityByContNo(ContactNo: Code[20]):
Parameters:
ContactNo: The contact no. for whom the opportunity is to be created.
Remarks: Creates a temporary opportunity record and uses the standard CreateOppFromOpp method to generate the opportunity. Associates the opportunity with the contact and inherits the salesperson code.
CreatePersonByContNo(Code[20]) :#
Summary: Creates a person contact related to the current contact.
procedure CreatePersonByContNo(ContactNo: Code[20]):
Parameters:
ContactNo: The contact no. for whom the person contact is to be created.
Remarks: Creates a new person-type contact linked to the specified company contact. Opens the Name Details page for data entry and deletes the contact if left empty. Uses number series from Marketing Setup for new contact numbering.
CreatePhoneCallByContNo(Code[20]) :#
Summary: Creates a phone call related to the current contact.
procedure CreatePhoneCallByContNo(ContactNo: Code[20]):
Parameters:
ContactNo: The contact number for whom the phone call is to be created.
Remarks: Uses TAPI management to initiate a phone call to the contact's phone number. Integrates with telephony systems if configured.
CreatePurchDocByContNo(Code[20], Enum Purchase Document Type) :#
procedure CreatePurchDocByContNo(ContactNo: Code[20]; DocumentType: Enum "Purchase Document Type"):
CreateSalesDocByContNo(Code[20], Enum Sales Document Type) : Code[20]#
procedure CreateSalesDocByContNo(ContactNo: Code[20]; DocumentType: Enum "Sales Document Type"): Code[20]
CreateToDoByContNo(Code[20]) :#
Summary: Creates a to-do related to the current contact no.
procedure CreateToDoByContNo(ContactNo: Code[20]):
Parameters:
ContactNo: The contact number for whom the to-do is to be created.
Remarks: Creates a task/to-do using the standard CreateTaskFromTask method. Links the task to the contact's company and lookup contact information.
GetCustNo(Record Contact) : Code[20]#
Summary: Retrieves the customer no. associated with the current contact.
procedure GetCustNo(Contact: Record "Contact"): Code[20]
Parameters:
Contact: The contact record for whom the customer no. is to be retrieved.
Returns: The customer number corresponding to the provided contact.
Remarks: Searches contact business relations for customer link using the contact's company number. Returns empty string if no customer relationship exists.
GetVendNo(Record Contact) : Code[20]#
Summary: Retrieves the vendor number associated with the current contact.
procedure GetVendNo(Contact: Record "Contact"): Code[20]
Parameters:
Contact: The contact record for whom the vendor number is to be retrieved.
Returns: The vendor number corresponding to the provided contact.
Remarks: Searches contact business relations for vendor link using the contact's company number. Returns empty string if no vendor relationship exists.
Events#
OnBeforeCreateVendorPart1Tab5050(Record Contact, Boolean) :#
Obsolete
This Element will be removed or changed with a future Version of the App.
Summary: Integration event that is triggered before creating a vendor from contact (Part 1). This event is obsolete and will be removed. Use OnBeforeCheckContactBusinessRelationOnCreateVendorfromContact instead.
[Obsolete('This event is no longer supported, pleaes use OnBeforeCheckContactBusinessRelationOnCreateVendorfromContact instead', '26.3')]
[IntegrationEvent(false, false)]
local procedure OnBeforeCreateVendorPart1Tab5050(Contact: Record "Contact"; var Handled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAContactLib", 'OnBeforeCreateVendorPart1Tab5050', '', false, false)]
local procedure DoSomethingOnBeforeCreateVendorPart1Tab5050(Contact: Record "Contact"; var Handled: Boolean)
begin
end;
Parameters:
Contact: The contact record being processed.Handled: Indicates if the event has been handled.
Remarks: This event is deprecated and should not be used in new implementations. Use OnBeforeCheckContactBusinessRelationOnCreateVendorfromContact for vendor creation validation.
OnBeforeCheckContactBusinessRelationOnCreateVendorfromContact(Record Contact, Boolean) :#
Summary: Integration event that is triggered before checking contact business relation when creating vendor from contact.
[IntegrationEvent(false, false)]
local procedure OnBeforeCheckContactBusinessRelationOnCreateVendorfromContact(Contact: Record "Contact"; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAContactLib", 'OnBeforeCheckContactBusinessRelationOnCreateVendorfromContact', '', false, false)]
local procedure DoSomethingOnBeforeCheckContactBusinessRelationOnCreateVendorfromContact(Contact: Record "Contact"; var IsHandled: Boolean)
begin
end;
Parameters:
Contact: The contact record being processed.IsHandled: Indicates if the event has been handled.
Remarks: Allows subscribers to provide custom validation logic before checking if contact is already linked to a vendor. Can be used to implement additional business rules for vendor creation from contacts.
OnCreatePersonByContNoOnBeforeDeleteEmptyContact(Record Contact, Record Contact, Boolean) :#
Summary: Integration event that is triggered before deleting an empty contact during person creation.
[IntegrationEvent(false, false)]
local procedure OnCreatePersonByContNoOnBeforeDeleteEmptyContact(var Contact: Record "Contact"; CompanyContact: Record "Contact"; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAContactLib", 'OnCreatePersonByContNoOnBeforeDeleteEmptyContact', '', false, false)]
local procedure DoSomethingOnCreatePersonByContNoOnBeforeDeleteEmptyContact(var Contact: Record "Contact"; CompanyContact: Record "Contact"; var IsHandled: Boolean)
begin
end;
Parameters:
Contact: The contact record that might be deleted.CompanyContact: The company contact record.IsHandled: Indicates if the event has been handled.
Remarks: Allows subscribers to prevent deletion of empty person contacts or perform cleanup operations. Called when user creates a person but leaves the name field empty.
OnCalcNumberOfSalesDocByContNoOnBeforeCurrTableIDCaseElse(Code[20], Integer, Code[20], Integer, Integer, Boolean) :#
Summary: Integration event that is triggered when calculating sales documents by contact number encounters an unhandled table ID.
[IntegrationEvent(false, false)]
local procedure OnCalcNumberOfSalesDocByContNoOnBeforeCurrTableIDCaseElse(ContNo: Code[20]; DocType: Integer; CurrNo: Code[20]; CurrTableID: Integer; var ReturnValue: Integer; var Handled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAContactLib", 'OnCalcNumberOfSalesDocByContNoOnBeforeCurrTableIDCaseElse', '', false, false)]
local procedure DoSomethingOnCalcNumberOfSalesDocByContNoOnBeforeCurrTableIDCaseElse(ContNo: Code[20]; DocType: Integer; CurrNo: Code[20]; CurrTableID: Integer; var ReturnValue: Integer; var Handled: Boolean)
begin
end;
Parameters:
ContNo: The contact number being processed.DocType: The document type being calculated.CurrNo: The current number associated with the contact.CurrTableID: The current table ID.ReturnValue: The return value to be used if handled.Handled: Indicates if the event has been handled.
Remarks: Allows subscribers to handle custom table relationships when calculating sales document counts. Used for extending contact relationships beyond standard Customer, Vendor, Bank Account types.
OnCreatePersonByContNoOnAfterModifyContact(Record Contact, Record Contact) :#
Summary: Integration event that is triggered after modifying a contact during person creation.
[IntegrationEvent(false, false)]
local procedure OnCreatePersonByContNoOnAfterModifyContact(var Contact: Record "Contact"; CompanyContact: Record "Contact"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAContactLib", 'OnCreatePersonByContNoOnAfterModifyContact', '', false, false)]
local procedure DoSomethingOnCreatePersonByContNoOnAfterModifyContact(var Contact: Record "Contact"; CompanyContact: Record "Contact")
begin
end;
Parameters:
Contact: The contact record that was modified.CompanyContact: The company contact record.
Remarks: Allows subscribers to perform additional setup or validation after person contact creation. Called after the person contact has been linked to the company contact.
OnCreatePersonByContNoOnBeforeModifyContact(Record Contact, Record Contact) :#
Summary: Integration event that is triggered before modifying a contact during person creation.
[IntegrationEvent(false, false)]
local procedure OnCreatePersonByContNoOnBeforeModifyContact(var Contact: Record "Contact"; CompanyContact: Record "Contact"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAContactLib", 'OnCreatePersonByContNoOnBeforeModifyContact', '', false, false)]
local procedure DoSomethingOnCreatePersonByContNoOnBeforeModifyContact(var Contact: Record "Contact"; CompanyContact: Record "Contact")
begin
end;
Parameters:
Contact: The contact record to be modified.CompanyContact: The company contact record.
Remarks: Allows subscribers to set additional fields or perform validation before person contact is finalized. Called after basic person contact setup but before saving to database.
OnLookupCockpitByContNoOnBeforeRunModalPage(Record Contact, Boolean) :#
Summary: Integration event that is triggered before running the modal page in contact lookup.
[IntegrationEvent(false, false)]
local procedure OnLookupCockpitByContNoOnBeforeRunModalPage(var Contact: Record "Contact"; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAContactLib", 'OnLookupCockpitByContNoOnBeforeRunModalPage', '', false, false)]
local procedure DoSomethingOnLookupCockpitByContNoOnBeforeRunModalPage(var Contact: Record "Contact"; var IsHandled: Boolean)
begin
end;
Parameters:
Contact: The contact record being displayed.IsHandled: Indicates if the event has been handled.
Remarks: Allows subscribers to show custom pages or perform actions instead of the standard contact card. Can be used to implement role-specific contact views or additional validation.
OnUpdatePurchaseQuotesBeforeChangePurchHeader(Record Purchase Header, Record Contact, Record Vendor, Boolean) :#
Summary: Integration event that is triggered before changing purchase header during purchase quotes update.
[IntegrationEvent(false, false)]
local procedure OnUpdatePurchaseQuotesBeforeChangePurchHeader(var PurchaseHeader: Record "Purchase Header"; Contact: Record "Contact"; Vendor: Record "Vendor"; var IsHandled: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAContactLib", 'OnUpdatePurchaseQuotesBeforeChangePurchHeader', '', false, false)]
local procedure DoSomethingOnUpdatePurchaseQuotesBeforeChangePurchHeader(var PurchaseHeader: Record "Purchase Header"; Contact: Record "Contact"; Vendor: Record "Vendor"; var IsHandled: Boolean)
begin
end;
Parameters:
PurchaseHeader: The purchase header record to be changed.Contact: The contact record being processed.Vendor: The vendor record being associated.IsHandled: Indicates if the event has been handled.
Remarks: Allows subscribers to customize purchase header updates when converting contact to vendor. Can be used to set additional fields or implement custom business logic during conversion.