Symptom

You open a user form in SAP Business One Studio for Microsoft Visual Studio and choose Preview in SAP Business One Client. Instead of showing the form, Studio stops with this message:

Can't connect to Business One Client.

Editing and saving the form still works. Only the preview fails.

Cause

Studio displays the preview inside the running SAP Business One client and connects to it through the UI API. If the default UI API connection string is not enabled for the company, Studio has no way to attach to the client and the preview fails.

Who is affected

All of the following must apply:

  • You use SAP Business One or SAP Business One, version for SAP HANA (all versions).
  • You design or change user forms in SAP Business One Studio.
  • Enable Default Connection String is not selected in the company's General Settings.

Solution

  1. Log on to the affected company in the SAP Business One client with a user who may change General Settings.
  2. Go to Administration → System Initialization → General Settings.
  3. Open the Services tab.
  4. Under UI API Configuration, select Enable Default Connection String.
  5. Save the settings.
  6. Return to SAP Business One Studio and choose Preview in SAP Business One Client again.

Keep in mind:

  • General Settings apply per company database. Repeat the change in every company where developers preview forms, for example your test and development companies.
  • Keep the SAP Business One client open and logged on to the same company while you preview.

Confirm the result

  • The preview opens the user form inside the SAP Business One client without an error.
  • Close the preview and check that the form still opens normally for end users.