Skip to content

Installation Instructions

For solutions that don't use scheduled work orders, complete all these steps:

1. Add Package Dependency

Add limepkg-scheduled-limeobject as a dependency to your solution.

poetry add limepkg-scheduled-limeobject

2. Set up Users

There's an included task which is set to run every hour, this task runs as user task@scheduledlimeobject. If this user doesn't exist, it won't be able to run.

  1. In LISA, create the task@scheduledlimeobject user with the following settings:
    • Password: Type a really long nonsense password. Do not store it anywhere (it is not needed).
    • Active: No
    • Type: Integration
    • Login: LIME PRO Authentication (default in Cloud)

3. Install LIP

The LIP package for Scheduled LimeObject does not contain any tables, only apps and VBA.

  1. Download the LIP package from Github
  2. Install the LIP package through VBA
  3. Make sure the VBA module was installed
  4. Make sure the app limepkg_scheduled_limeobject_scheduleeditor was installed

4. Set Up the Database Structure

As described in the technical section there are three lime types involved:

  • The schedule
  • The parameter set
  • The lime type to be created

In LISA:

  1. Create a new lime type for the schedule. For example scheduledtodo
  2. Enable Log changes to ease troubleshooting.
  3. Add all required fields and any additional fields that should be copied from the schedule to the resulting limeobjects.
  4. Create a new lime type for the parameters. For example scheduledtodoparameters
  5. Add all required fields and any additional fields that should be copied from the parameters to the resulting limeobjects.
  6. Add all required fields to the lime type to be created. For example todo.

5. Configure the Package

The package has a configuration page in Lime Admin. Add the new schedule lime type above and configure its details.

6. Configure the Web Client

  1. Configure the views for the scheduledtodo limetype.
    1. Add the web-component lwc-limepkg-scheduled-limeobject-schedule-editor-button to the object card.
    2. Add the web-component lwc-limepkg-scheduled-limeobject-schedule-change-status to the object card.
    3. Add the web-component lwc-limepkg-scheduled-limeobject-schedule-run-now-button to the object card.
    4. The following properties must be present and editable on the object card: active
    5. The following properties should not be present and must not be editable on the object card: startdate, until, starttime, endtime, numberofdays
    6. The following properties should be present but not editable on the object card: rruledescription, lastcreated
  2. Configure the views for the scheduledtodoparameterset limetype.

7. Action pad

Some of the schedule properties (rrulejson) must only be edited using a specific schedule editor app in the desktop client.

  1. Add an action pad for the schedule lime type. For example scheduledtodo.html
  2. Add a link that, through VBA, opens the schedule editor in a new window:

    <a data-bind="vba:'AO_Scheduled_LimeObject.ShowScheduleEditor', text:'Schedule editor', icon: 'fa-calendar'"></a>
    
  3. Optionally you also add a link that calls the "run now" endpoint, this would allow a user to run the schedule immediately instead of waiting for the next execution of the scheduled task.

    <script type="text/javascript">
      function runScheduleNow() {
        $.support.cors = true;
        $.ajax({
          url: encodeURI(
            lbs.limeDataConnection.Database.FullActiveServerName +
            "/" +
            lbs.activeDatabase +
            "/limepkg-scheduled-limeobject/" +
            lbs.activeClass + "/" +
            lbs.activeInspector.Record.ID +
            "/run/"
          ),
          headers: {
            sessionId: lbs.limeDataConnection.Database.SessionID,
            "Content-Type": "application/json"
          },
          method: "POST",
          cache: false,
          success: function (data) {
            alert('The schedule will run in the background.')
          },
          error: function (data) {
            try {
              jason = JSON.parse(data.responseText)
              alert(jason.message || jason.error);
            } catch {
              alert(data.responseText);
            }
          }
        });
      }
    </script>
    
    <div>
      <a onclick="runScheduleNow()" data-bind="text:'Run schedule now', icon: 'fa-bullseye'"></a>
    </div>
    
  4. Publish the action pad to all users.

Back to top