new DataEventHelpers()

Boilerplate methods common in Merjent apps

Description

Provides methods for weather data, fire danger ratings, and other common data event tasks.

Inheritance: Utils → FulcrumHelpers → RequestHelpers → DataEventHelpers

This is the top-level class used by the Mtools singleton in data event modules.

Inherited Methods:

  • All Utils utility methods (see Utils documentation)
  • All FulcrumHelpers Fulcrum-specific methods (see FulcrumHelpers documentation)
  • All RequestHelpers HTTP request methods (see RequestHelpers documentation)

Methods Defined in This Class: Only data event-specific methods are documented below.

Members


getFireDanger

Description

Description placeholder

Parameters
Name Type Description
callback function

Function to SETVALUE of field in app


getNwsPoint

Description

Description placeholder

Parameters
Name Type Attributes Default Description
callback function

Function to process result from request and enter data into field or variable. Will be passed on to this.getCurrentWeather()

getCurrentWeather function <optional>
this.getCurrentWeather

Calls this.getCurrentWeather() to complete data request

Returns
  • Calls this.getCurrentWeather() to complete data request

getCurrentWeather

Description

Description placeholder

Parameters
Name Type Description
url string

passed in from this.getNwsPoint()

loc string

passed in from this.getNwsPoint()

callback function

passed in from this.getNwsPoint()


getPlss

Description

Description placeholder

Parameters
Name Type Description
callback function

Function to process result from request and enter data into field or variable.


getClosedDateFromRep

Description

Returns the most recent date from a repeatable field

Parameters
Name Type Description
repDn string

The repeatable field to check for dates

dtDn string

The date field within the repeatable field

Returns
  • Returns the most recent date in ISO format or null if no dates are found

requestAppRecords

Description

Description placeholder

Parameters
Name Type Attributes Default Description
query string
callback function <optional>
opt * <optional>
Returns
Details

requestRecById

Description

Description placeholder

Parameters
Name Type Attributes Default Description
appId string

fulcrum app id

qflds string <optional>
''

fields to pull in request

recIDs Array.<string>

array or _record_id to request

callback function

callback

opt * <optional>

option for callback

Returns
Examples
function enterDisturbanceAreaTypeCallback(rows,dn){
   var output = rows.map(x => x.disturbance_area_type)
   SETVALUE(dn,output.join(', '))
}

var opt = 'disturbance_area_types'

M.requestRecById(appId,qflds,recIDs,enterDisturbanceAreaTypeCallback,opt)
Details

Description

Description placeholder

Parameters
Name Type Description
rows Array.<{_record_id: string}>

rows

opt *

data name of field to enter record links into

Returns
Details

updateRecord

Description

Description placeholder

Parameters
Name Type Attributes Default Description
recID string

_record_id to get

record *
callback function

callback to modify properties of existing record

index number <optional>

index of current record. If being called from array.

end number <optional>

index of last record in array of records. If being called from array.

complete string <optional>
''

Text for alert message when this.updateRecord is complete

Returns
Details

getRecord

Description

Description placeholder

Parameters
Name Type Attributes Default Description
recID string

_record_id to get

callback function <optional>

callback is used by M.updateRecord

index number <optional>

index of current record. If being called from array.

end number <optional>

index of last record in array of records. If being called from array.

complete string <optional>
''

Text for alert message when this.updateRecord is complete

Returns
Details

Methods


updateMStates( event )

Description

Updates the 'states' field with the choice values from the event

Parameters
Name Type Description
event Object

The event object containing the value with choice_values


checkConnection( error )

Description

Description placeholder

Parameters
Name Type Description
error *
Details