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.
- 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.
- Download the LIP package from Github
- Install the LIP package through VBA
- Make sure the VBA module was installed
- 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:
- Create a new lime type for the schedule. For example scheduledtodo
- Enable
Log changes
to ease troubleshooting. - Add all required fields and any additional fields that should be copied from the schedule to the resulting limeobjects.
- Create a new lime type for the parameters. For example scheduledtodoparameters
- Add all required fields and any additional fields that should be copied from the parameters to the resulting limeobjects.
- 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¶
- Configure the views for the scheduledtodo limetype.
- Add the web-component
lwc-limepkg-scheduled-limeobject-schedule-editor-button
to the object card. - Add the web-component
lwc-limepkg-scheduled-limeobject-schedule-change-status
to the object card. - Add the web-component
lwc-limepkg-scheduled-limeobject-schedule-run-now-button
to the object card. - The following properties must be present and editable on the object card:
active
- The following properties should not be present and must not be editable on the object card:
startdate
,until
,starttime
,endtime
,numberofdays
- The following properties should be present but not editable on the object card:
rruledescription
,lastcreated
- Add the web-component
- 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.
- Add an action pad for the schedule lime type. For example scheduledtodo.html
-
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>
-
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>
-
Publish the action pad to all users.