NEW2.02.03 · Released 4 December 2014
NEWfinPOWER Connect
Released in
2.02.03
4 December 2014
  1. Opened25 Nov
  2. Closed26 Nov
  3. Released4 Dec
Article 12460 Job J014523

Page Sets; Ability to show Company Lookup form added

Page Sets can now display the Company Lookup form (as per the Clients form and the New Client wizard).

The following code sample will display a company lookup:

Public Sub txtCompany_ButtonClick(sender As Object, e As finPageObjectButtonClickEventArgs) Handles txtOrganisationName.ButtonClick, txtCompanyNumber.ButtonClick

  Dim ExistingDetails As ISKeyValueList
  Dim DetailsToUpdate As ISKeyValueList
  Dim Results As ISKeyValueList
  Dim SearchBy As isefinCompanyLookupSearchBy 
  Dim SearchQuery As String

  ExistingDetails = finBL.CreateKeyValueList()
  With ExistingDetails
    .SetString("CompanyName", txtOrganisationName.Text)
    .SetString("CompanyNumber", txtCompanyNumber.Text)
  End With
  
  If sender Is txtOrganisationName Then
    SearchBy = isefinCompanyLookupSearchBy.CompanyName
    SearchQuery = txtOrganisationName.Text
  Else
    SearchBy = isefinCompanyLookupSearchBy.CompanyNumber
    SearchQuery = txtCompanyNumber.Text
  End If

  If psh.FormShowCompanyLookup(SearchBy, SearchQuery, Results, ExistingDetails, DetailsToUpdate) Then
    If Results Is Nothing Then
      mUI.MsgBox("Cancelled by User.", MsgBoxStyle.Information)
    Else
      ' Update fields based on selected values (could use Results instead if we're not worried about what the User selected)
      If DetailsToUpdate.Exists("CompanyName") Then txtOrganisationName.Text = DetailsToUpdate.GetString("CompanyName")
        If DetailsToUpdate.Exists("CompanyNumber") Then txtCompanyNumber.Text = DetailsToUpdate.GetString("CompanyNumber")
    End If
  Else
    mUI.ErrorMessageShow()
  End If

End Sub

Company Lookup is only available if licensed for the Credit Enquiry Add-On and is currently implemented for Australia and New Zealand.

The new method, FormShowCompanyLookup is documented in the Page Sets documents. A new section has been added: Advanced Scripting, Showing Special Forms, Company Lookup.