Members
-
restrictNewRecords :boolean
-
Description
- Disable creation of new records except for certain permission levels. Set this.newRecordCreators to the user level(s) that is allowed to create new records.
Details
-
newRecordCreators :string
-
Description
- Permission levels allowed to create new records.
Details
-
adminNames :Array.<string>
-
Description
- Array of user names to have "Admin" privleges in this app.
Details
-
editorNames :Array.<string>
-
Description
- Array of user names to have "Editor" privleges in this app.
Details
-
userNames :Array.<string>
-
Description
- Array of user names to have "User" privleges in this app.
Details
-
viewerNames :Array.<string>
-
Description
- Array of user names to have "Viewer" privleges in this app.
The default getPermissions() method places all users not listed in another permission level in this category.
Details
-
adminRoles :Array.<string>
-
Description
- Array of Fulcrum user roles to have "Admin" privleges in this app.
Details
-
editorRoles :Array.<string>
-
Description
- Array of Fulcrum user roles to have "Editor" privleges in this app.
Details
-
userRoles :Array.<string>
-
Description
- Array of Fulcrum user roles to have "User" privleges in this app.
Details
-
viewerRoles :Array.<string>
-
Description
- Array of Fulcrum user roles to have "Viewer" privleges in this app.
Details
-
lockOnLoad :boolean
-
Description
- Option to check for fieldLock on load.
Details
-
defaultPermissionLevel :string
- The default permission level for users that are not specified as being under a specific permission level.
-
Description
- Possible values are 'Admin', 'Editor', 'User', 'Viewer'.
Details
-
photoCapMax :number
-
Description
- Max characters allowed in a photo caption
Details
-
requireLandscape :boolean
-
Description
- Option to force landscape format for the photo field with data name mApp.dnPhotoLoc
Details
-
setLocoff1photo :boolean
-
Description
- Option to set the record location to the location of the first photo taken from photo field with data name mApp.dnPhotoLoc
Details
-
disableLocationEdit :boolean
-
Description
- Disable location editing for User and Editor. Checked in default updatePermission method. Calls M.disableLocationEdit()
Details
-
dnAutoName :string|null
-
Description
- Data name of the auto-name field. Set to null to disable auto-naming.
Details
-
dnDt :string
-
Description
- Data name of the primary report date field.
Details
-
dnDueDate :string
-
Description
- Data name of the due date field.
Details
-
dnReportID :string
-
Description
- Data name of the report id field.
Details
-
dnFollowUp :string
-
Description
- Data name of the follow=up required y/n field.
Details
-
dnResolved :string
-
Description
- Data name of the follow-up resolved field. Could be a y/n field or a date field.
Details
-
dnFollowUpRepeatable :string
-
Description
- Data name of the follow-up repeatable field.
Details
-
dnSubmit :string
-
Description
- Data name of the 'submit_report' field. Default status functions are checking for value of 'yes'. Turns on field lock. If you are not using the updateStatus data event set this to null.
Examples
mApp.dnSubmit = null //Turns off updatStatus Method.Details
-
dnReviewed :string
-
Description
- Data name of the 'coordinator_reviewed' field. Default status functions are checking for value of 'yes'. Turns on complete lock.
Details
-
dnCoordinatorInitials :string
-
Description
- Data name of the 'dnCoordinatorInitials' field. Signed with coordinator initials when mApp.dnReviewed gets checked 'yes'
Details
-
dnPhotoLoc :string
-
Description
- Data name of the photo field to use for setting record location and also landscape validation.
Details
-
allPhotos :Array
-
Description
- Array of photo names to check for missing captions and exceeding max character limit.
Details
-
completeLockCondition :Array.<string>
-
Description
Array of status values to match for turning on complete record lock.
To turn off complete lock use empty array [].
Examples
mApp.completeLockCondition = []Details
-
completeLockExclude :Array.<string>
-
Description
Array of data names to exclude from read-only status when complete lock is on.
Details
-
fieldLockCondition :Array.<string>
-
Description
Array of status values to match for turning on field lock.
To turn off field lock use empty array [].
Examples
mApp.fieldLockCondition = []Details
-
fieldLockExclude :Array.<string>
-
Description
Array of data names to exclude from read-only status when field lock is on.
Details
-
install_template
-
Description
Installs an app template, binding all template methods to this MerjentApp instance.
Templates are functions that configure the app by binding mixin methods and setting defaults. See
MerjentApp.DefaultTemplatefor the default template implementation.Parameters
Name Type Attributes Default Description templatefunction <optional> DefaultTemplate Template function to install. Defaults to DefaultTemplate.
Returns
Examples
// Use default template const mApp = new MerjentApp();// Use custom template import { CustomTemplate } from './templates/CustomTemplate'; const mApp = new MerjentApp(); mApp.install_template(CustomTemplate);
Methods
-
start( event ) → {void}
-
Description
App entry point. Runs: updatePermission > updateStatus > updateLock (if lockOnLoad).
Stub - Implementation provided by
DefaultTemplate.Parameters
Name Type Description event* Fulcrum event object
Returns
-
enterReportID( event ) → {void}
-
Description
Set report id to:
{year}{month}{day}_T{hours}{minutes}_{initials}Stub - Implementation provided by
DefaultTemplate.Parameters
Name Type Description event* Fulcrum event object
Returns
-
reportIDprefix() → {string|null}
-
Description
Callback that returns a prefix for the report ID. Override to customize.
Stub - Implementation provided by
DefaultTemplate.Returns
-
addCoordinatorInitials( event ) → {void}
-
Description
Adds coordinator initials when dnReviewed is checked 'yes'.
Stub - Implementation provided by
DefaultTemplate.Parameters
Name Type Description event* Fulcrum event object
Returns
-
getStatus( event ) → {string}
-
Description
Calculate the record status based on field values.
Stub - Default implementation:
StatusMixins.draft_completeAvailable alternatives in
StatusMixins:draft_complete- Two-state: Draft → Completeactive_resolved- Two-state: Active → Resolvedp_s_complete- Three-state: Pending → Submitted → Completep_s_c_f_resolved- Five-state with follow-up
Parameters
Name Type Description event* Fulcrum event object
Returns
-
updateStatus( event ) → {void}
-
Description
Update the record status if it has changed.
Stub - Implementation provided by
DefaultTemplate.Parameters
Name Type Description event* Fulcrum event object
Returns
-
getPermissions( event ) → {string}
-
Description
Get the permission level for the current user.
Stub - Default implementation:
PermissionMixins.fourTierParameters
Name Type Description event* Fulcrum event object
Returns
-
getCompleteLockStatus( event ) → {boolean}
-
Description
Check if complete lock conditions are met.
Stub - Default implementation:
LockingMixins.checkCompleteLockStatusParameters
Name Type Description event* Fulcrum event object
Returns
-
standardAdmin( event ) → {void}
-
Description
Apply Admin permission restrictions.
Stub - Default implementation:
PermissionMixins.standardAdminParameters
Name Type Description event* Fulcrum event object
Returns
-
standardEditor( event ) → {void}
-
Description
Apply Editor permission restrictions.
Stub - Default implementation:
PermissionMixins.standardEditorParameters
Name Type Description event* Fulcrum event object
Returns
-
standardUser( event ) → {void}
-
Description
Apply User permission restrictions.
Stub - Default implementation:
PermissionMixins.standardUserParameters
Name Type Description event* Fulcrum event object
Returns
-
standardViewer( event ) → {void}
-
Description
Apply Viewer permission restrictions.
Stub - Default implementation:
PermissionMixins.standardViewerParameters
Name Type Description event* Fulcrum event object
Returns
-
baseUpdatePermission( event ) → {void}
-
Description
Apply base permission restrictions (read-only fields based on user level).
Stub - Default implementation:
PermissionMixins.standardUpdateParameters
Name Type Description event* Fulcrum event object
Returns
-
addUpdatePermission( event ) → {void}
-
Description
Hook for additional permission logic. Override in your template.
Stub - Implementation provided by
DefaultTemplate. Returns null by default.Parameters
Name Type Description event* Fulcrum event object
Returns
-
updatePermission( event ) → {void}
-
Description
Apply all permission restrictions. Calls baseUpdatePermission + addUpdatePermission.
Stub - Implementation provided by
DefaultTemplate.Parameters
Name Type Description event* Fulcrum event object
Returns
-
getLockStatus( event ) → {boolean}
-
Description
Check if field lock conditions are met.
Stub - Default implementation:
LockingMixins.checkLockStatusParameters
Name Type Description event* Fulcrum event object
Returns
-
updateLock( event ) → {void}
-
Description
Toggle field lock based on getLockStatus().
Stub - Implementation provided by
DefaultTemplate.Parameters
Name Type Description event* Fulcrum event object
Returns
-
baseLockEditing( event ) → {void}
-
Description
Apply base field locking based on permission level.
Stub - Default implementation:
LockingMixins.standardLockEditingParameters
Name Type Description event* Fulcrum event object
Returns
-
addLockEditing( event ) → {void}
-
Description
Hook for additional locking logic. Override in your template.
Stub - Implementation provided by
DefaultTemplate. Returns null by default.Parameters
Name Type Description event* Fulcrum event object
Returns
-
lockEditing( event ) → {void}
-
Description
Apply all field locking. Calls baseLockEditing + addLockEditing.
Stub - Implementation provided by
DefaultTemplate.Parameters
Name Type Description event* Fulcrum event object
Returns
-
validatePhoto( event ) → {void}
-
Description
Validate photo (landscape requirement, set location from photo).
Stub - Default implementation:
PhotoMixins.standardValidationParameters
Name Type Description event* Fulcrum event object
Returns
-
limitCaption( event ) → {void}
-
Description
Alert if photo caption exceeds photoCapMax characters.
Stub - Default implementation:
PhotoMixins.limitCaptionParameters
Name Type Description event* Fulcrum event object
Returns
-
validateAllPhotos( event ) → {void}
-
Description
Validate all photos have captions on submit.
Stub - Default implementation:
PhotoMixins.validateAllPhotosParameters
Name Type Description event* Fulcrum event object
Returns
-
disableNewRecordCreation( event ) → {void}
-
Description
Prevent users without permission from creating new records.
Stub - Implementation provided by
DefaultTemplate.Parameters
Name Type Description event* Fulcrum event object
Returns
Examples
ON('new-record', mApp.disableNewRecordCreation)