You are here:
Utils
Utils is a class of the Framework API.
Required Editions
| Available in Lightning Experience in Professional, Unlimited, and Enterprise Editions that have Consumer Goods Cloud enabled. |
- Utils Date Function
TheUtils Date functioncontains a set of functions, which you can use to create dates. These functions ensure that dates are always used and localized with correct data types. - Utils.helper.ExternalFileUtils
Framework uses Utils.helper.ExternalFileUtils, a new utility class, to manage the loading of external libraries in Consumer Goods Cloud Modeler and use it in the UI container on the mobile device. - Utils.widget.SignatureCapture()
Signature Capture Widget enables the signature control on the device. The signature capture control uses a DIV to specify the signature area. The Pkey and table name for each signature control is passed to the widget as a blob object. Framework forms the path, and then the path is updated in the Business Object. - addDays2AnsiFullDate(sDate, iDays)
Adds the given number of days to the given ANSI date. Result also contains time information. - addDays2AnsiDate(sDate, iDays)
Adds the given number of days to the given ANSI date. - appendString(text, suffix)
Appends suffix to the text if text doesn't end with a suffix. - convertAnsiDate2Date(value)
This topic describes the convertAnsiDate2Date(value) function. - convertAnsiDateToLocaleDate(ansiDate)
This topic describes the convertAnsiDateToLocaleDate(ansiDate) function. - convertAnsiTime2Time(value)
This topic describes the convertAnsiTime2Time(value) function. - convertDate2Ansi(value)
This topic describes the convertDate2Ansi(value) function. - convertFullDate2Ansi(value)
Converts a date object to the string yyyy-mm-dd hh:mm:ss. - convertFullDate2Time(value)
This topic describes the convertFullDate2Time(value) function. - convertLocaleDateToAnsiDate(localeDate)
This topic describes the convertLocaleDateToAnsiDate(localeDate) function. - convertTime2Ansi(value)
This topic describes the convertTime2Ansi(value) function. - convertAnsiDateTime2AnsiDate(string)
Converts an input parameter (string) containing date and time in ANSI format to date in ANSI format by removing the time component from the input. - createAnsiToday()
This topic describes the createAnsiToday() function. - createDateToday()
This topic describes the createDateToday() function. - createDictionary()
Dictionary API is used to create dictionary function. Dictionary is a small structure that allows the storage of key value pairs. There are no restrictions assigned to either the keys or the values. - distanceBetween(lat1Deg, lon1Deg, lat2Deg, lon2Deg, distanceUnit)
Returns a decimal value, which is the distance between the first and the second locations whose geographic coordinates are passed as parameters to the distanceBetween function. The unit of the distance can be kilometers or miles based on the value of the distanceUnit parameter. - echoAsync(value)
Asynchronous echo function resolves the first parameter it receives. It can be called as a Logic type action to write values to the process context. - echo(value)
Echo function returns the parameter it receives. It can be called as a Logic type action to write values to the process context. - endsWith(text, suffix)
Check whether text ends with suffix. Comparison is case-sensitive. - getApplicationRuntimeVersion()
Use this function to fetch the application’s run time version details. This function matches the Modeler Update Package (MUP) installed on the used Modeler environment. - getCalendarWeek(value)
Learn about the getCalendarWeek(value) function. - getCurrentPosition()
Gets the current device GPS position of a mobile device by querying the device’s location services and returns coordinates if available. By default, if high accuracy using GPS is not available, the mobile app switches to coarse location using cell or WiFi. - getDeviceTimeZone()
Learn about the getDeviceTimeZone() function. - getGeneratorVersion()
Use this function to retrieve the version details of Code Generator, which is used to build run-time artifacts. - getModelerWebServiceVersion()
Use this function to retrieve the web service version details of Consumer Goods Cloud Modeler. - getMaxDate()
Learn about the getMaxDate() function. - getMinDate()
Learn about the getMinDate() function. - getModelerClientVersion()
Use this function to fetch the client version details of Consumer Goods Cloud Modeler. - getPackageCreationDate()
Use this function to retrieve the creation date of a package. - getToggleListObject(toggleId,restrictToItemIds)
Learn about the getToggleListObject(toggleId,restrictToItemIds) function. - getVersionsAsync()
Use this function to fetch the version information of software components. - isBlankString(text)
Use this function to verify whether the text is blank, containing only spaces and CRLF. - isDefined(variable)
Returns false if the argument is null or undefined. Otherwise, returns true. - isEmptyString(variable)
Returns true if the argument is emptyString, blank, null, or undefined. Otherwise, returns false. - isTime(value)
Learn about the isTime(value) function. - Localization.localize()
Use this function to convert the date and time to the specified format. Consumer Goods Mobile App Framework uses a third-party library for date-time localization. If you request for date time translations, this function returns the formatted date according to the globally set locale. If the specified languageCode isn’t available or loaded, the english locale is set as default. languageCode must be as per ISO 3166 standard. - replaceMessageParameters (inputString, jsParams)
Use this function to replace parameters in a message string. Message parameters must be of the form #name#. - round(value, precision, mode)
This function returns a value that’s rounded to the specified number of digits in the precision parameter. - roundDown(value, precision)
This function returns a value that’s rounded down to the specified number of digits in the precision parameter. - roundDownToNearestMultipleOf(value, base)
This function returns a value that’s rounded to the next smaller multiple of base. - roundFinancial(value, precision)
This function returns a value that’s rounded financially to the specified number of digits in the precision parameter. - roundToNearestMultipleOf(value, base)
This function returns a value that’s rounded to the closest multiple of base. - roundUp(value, precision)
This function returns a value that’s rounded up to the specified number of digits in the precision parameter. - roundUpToNearestMultipleOf(value, base)
This function returns a value that’s rounded to the next greater multiple of base. - ApplicationContext.setOnGroup(<settingsGroup>, <setting>, <value>)
The ApplicationContext.setOnGroup(<settingsGroup>, <setting>, <value>) method sets the client ID for the Google Map widget as ApplicationContext.setOnGroup("mapSettings", "client", <value>). This updates the settings of Google Maps API. - setMinConnectionTypeForReplication
Use this function to set the minimum connection type that’s required to run a replication. - startsWith(text, prefix)
Use this function to verify whether text starts with prefix. The comparison is case-sensitive. - stripStringStart(text, stripText)
Use this function to strip text from the start of a string’s text. - Utils.openImageEditor(listItem)
Use this function to focus on the problem area in a picture and highlight it by using the Sketch option.
Did this article solve your issue?
Let us know so we can improve!

