Article Details
Id:12460
Product:finPOWER Connect
Type:NEW
Version:2.02.03
Opened:25/11/2014
Closed:26/11/2014
Released:04/12/2014
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.