KVSCRSServiceHandlingFacade
Summary: Public facade of the Creditsafe Credit-Check Service extension. The codeunit is the supported entry point for other extensions, it exposes the functions for searching companies, requesting reports and maintaining the monitoring portfolios and forwards the calls to the internal service handling, so that the internal implementation can change without breaking callers.
Procedures
FindCompanies(Record KVSCRSCompanySelection, Record KVSCRSIDLanguage, Integer, Code[20], Text[30], Text[30], Text[30], Text[151], Text[151], Text[30], Text[30], Code[2], Enum KVSCRSMatchType, Enum KVSCRSDEReasonCodes) : Integer
Summary: Searches for companies in the Creditsafe database using various search criteria to find matching business entities. This procedure is the public entry point for external callers who need to perform a company search against the Creditsafe service (both SOAP and REST/API connection types are supported). The results are written into the two temporary tables passed by reference.
procedure FindCompanies(var TempCompanySelection: Record "KVSCRSCompanySelection"; var TempCrsIdLanguage: Record "KVSCRSIDLanguage"; CompanyType: Integer; CompanyNo: Code[20]; CreditsafeId: Text[30]; CreditsafeNo: Text[30]; VatID: Text[30]; Name: Text[151]; Address: Text[151]; Postcode: Text[30]; City: Text[30]; Country: Code[2]; MatchType: Enum "KVSCRSMatchType"; DeReasonCode: Enum "KVSCRSDEReasonCodes"): Integer
Parameters:
TempCompanySelection: Temporary table that receives the search results with company selection data. Must be passed as a temporary record; existing content is not cleared before population.TempCrsIdLanguage: Temporary table that receives language information associated with the search results.companyType: Type of company being searched for (0 = all types).companyNo: Company registration number or local identifier. Pass empty string to ignore.creditsafeId: Creditsafe unique identifier for the company. Pass empty string to ignore.creditsafeNo: Creditsafe number for the company. Pass empty string to ignore.vatID: VAT identification number. Pass empty string to ignore.name: Company name to search for. Pass empty string to ignore.address: Street address to narrow the search. Pass empty string to ignore.postcode: Postal code for the search. Pass empty string to ignore.city: City name for the search. Pass empty string to ignore.country: ISO 3166-1 alpha-2 country code that determines the Creditsafe database to query.matchType: Matching algorithm to apply when comparing the supplied criteria against the Creditsafe data.deReasonCode: System.Object[]
Returns: The number of companies found that match the supplied search criteria. Returns 0 when no matches were found or when the service call failed.
GetReport(Record KVSCRSID) : Integer
Summary: Retrieves a detailed credit report for a specific company from the Creditsafe service. Depending on the setup, the report is either fetched synchronously (online) or enqueued via the Job Queue for background processing when Request Report with Job Queue is enabled and the company type is set.
procedure GetReport(CrsId: Record "KVSCRSID"): Integer
Parameters:
crsId: System.Object[]
Returns: An integer status code from the service response when the report is fetched synchronously. Returns 0 when the ID is blank or when the report has been enqueued for background processing.
GetSuccessStatus() : Code[20]
Summary: Returns the status code that indicates a Creditsafe request has completed successfully. Use this value to compare against the KVSCRSRequest.Status field to determine whether a previously executed service call succeeded without errors.
procedure GetSuccessStatus(): Code[20]
Returns: The fixed status code 'SUCCESS' used across all request records to mark successful completions.