Detect if the current company does not have custom table and specific data

Hi all,

I am having this situation. I have A,B as my existing companies and have my custom table added to their database. Then I have a new company C, and this company does not have my custom table yet so none of my customize form is working on company C.

My question is, how to detect if a company does not have my custom tables and to check on specific data programmatically, once user login to the company?

thank you.

  • 0

    One way - in your own forms - is to override CheckBlockingConditions, something like this:

    Protected Overrides Sub CheckBlockingConditions()
      MyBase.CheckBlockingConditions()
      'check for DD tables
      Dim oDirectDebitSettings As New DirectDebitSettings
      Try
        oDirectDebitSetting = oDirectDebitSettings.First
      Catch ex As Sage.ObjectStore.InvalidObjectException
        Throw New Sage.Accounting.Exceptions.SageAccountingException("Direct Debit settings not present")
      End Try
    End Sub

    in this example, if the DirectDebitSettings custom table doesn't exist, a SageAccountingException is thrown, which prevents the form from loading.

    If customising Sage forms, do a similar Try/Catch and set a flag to indicate whether the customisation code should be run.