How to perform a database query in a BO?

  • Michael Scharpf
    Participant
      2 months, 3 weeks ago #68859

      Hello,

      I’m new to Simplifier and would need your help with the following question:

      I have created a SQLite connector and a connector call to insert records into a database. This also works when testing.
      Now I want to call this connector call in a BO, but unfortunately I don’t know how.

      I have tried the following statements:

      var oReturn = Simplifier.Connector.MySQLiteConnector.MySQLiteConnectorCall({“user_id”: sUserID,”firstname”: sFirstname, “lastname”: sLastname});

      and

      var oReturn = Simplifier.Connector.MySQLiteConnector.MySQLiteConnectorCall({“mode”: “execute”,”request”: “INSERT INTO tbl_users (user_id, firstname, lastname) VALUES (:user_id:,:firstname:,:lastname:);”,”user_id”: sUserID,”firstname”: sFirstname, “lastname”: sLastname});

      I always receive this error message: Cannot read property ‘MySQLiteConnectorCall’ of undefined

      Where is my mistake?

      Thank you!

      Lukas Henninger
      Moderator
        Has successfully completed the online course Introduction
        Has successfully completed the online course Intermediate (200)
        Has successfully completed the online course Advanced (300)
        Has successfully completed the online course Basics (100)
        Has successfully completed the online course Advanced (310)
        Has successfully completed the online course Advanced (320)
      2 months, 3 weeks ago #68876
      Up
      1
      Down
      ::

      Hi Michael,

       

      before you can access a Connector/BO inside of a BusinessObject (with the exception beeing Simplifier.CurrentBusinessObject….) you will need to add the Connector/BO to the Business Object. First, in the BO-Overview, select your BO and click on the edit icon.

      Then you can add your Connector/BO using the value Help on the left side of the screen. Hit save when you are done.

      You can find more Information about this in the Docs.

      I hope this helps to resolve your issue.
      Lukas

      Michael Scharpf
      Participant
        2 months, 3 weeks ago #68878
        Up
        0
        Down
        ::

        Hi Lukas,

        thank you very much for your quick reply.

        After assigning the Connector to the BO, it works.

        BR Michael

      Viewing 3 posts - 1 through 3 (of 3 total)

      You must be logged in to reply to this topic.