Best Practices¶
Disclaimer: The following is in no way a complete list of all best practices.
- The modern Lime CRM platform should be used as far as possible. Only in cases where it is not possible, the usage of legacy components such as VBA, Lime Bootstrap Apps,
localize
records or SQL expressions are allowed.
Configurability¶
- Any limetypes or properties on them used by the add-on should preferrably be configurable through Lime Admin. Flexibility is key in Lime CRM, and the add-on might be needed on different limetypes in different customer solutions. Any hard coded limetypes and properties that the add-on expects to exist, must be listed under Requirements in the technical documentation.
Lime Bootstrap Apps¶
-
Use the add-on's unique name as a prefix on CSS classes and id:s.
-
Do not use
vbaVisible
andvisible
. Instead, use<--! ko if: expression --> <-- /ko -->
. - Do not save data changes through VBA, instead use the REST API or a custom endpoint. Then refresh fields on the card using
lbs.activeInspector.Record.Refresh();
for relation fields,lbs.activeInspector.Controls.RefreshField("<fieldName>")
for all other fields, andlbs.activeInspector.WebBar.Refresh();
if you have to reload the Actionpad. - If you need the
sessionId
, fetch it usinglbs.limeDataConnection.Database.SessionID;
instead of through VBA. - If you need the
baseUrl
, get it usinglbs.limeDataConnection.Database.FullActiveServerName + '/' + lbs.activeDatabase + '/';
instead of through VBA. - Do not configure which limetype the app is currently on, instead use
lbs.activeClass;
. - Make it clear for the user that sometimes it has to wait for things that are loading, by setting the mouse pointer. For status loading, use
lbs.limeDataConnection.MousePointer = 11;
and when done, set back tolbs.limeDataConnection.MousePointer = 0;
. - Do not load the
activeInspector
as adataSource
in a Limebootstrap app, to prevent loading it twice. It is already available withlbs.vm[lbs.activeClass];
.
VBA¶
Option Explicit
must be used.- Any VBA functions called from javascript code in a Lime Bootstrap app must include the Inspector GUID as a parameter if the Inspector object is going to be used in the VBA code.