Loading
Visual Studio Code Based Modeler for Consumer Goods Cloud
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Facade

          Facade

          The facade acts as an interface between the proxies and the application.

          • addCustomDataSource(objectClassName, dataSource)
            Define a custom data source at runtime. Custom data sources are used when the normal data source mechanism can’t be applied. In the current framework, the data source name is derived from the business object name that uses this data source. Another use case could be that in certain situations, a data source that differs from the default data source configured for the business object must be used.
          • checkNetworkCredentialsAsync(userName, password)
            Facade.checkNetworkCredentialsAsync() is one of the KeyChain API methods for providing a secure key-value storage for framework users. This storage can be used to store any sensitive information, such as credentials for web-based authentication.
          • clear([groupId])
            This function removes all timers from the TM without any further action (for example, Message box, app context modifications or callbacks). If the parameter defined is group ID, then the timers with the specified group ID are removed.
          • commitTransaction()
            Run the SQL statement buffer maintained by the Facade in a single transaction.
          • copyAttachmentAsync()
            This Framework function is used to copy the file and the related thumbnails.
          • createCallbackTimer(timerId, autoDestroy, [duration[, message[, appContextValues]]])
            A timer with callback can be created in a logic action by calling TimerManager.createCallbackTimer() with the following parameters:
          • createShortCallbackTimer(timerId, autoDestroy, [duration[, message[, appContextValues]]])
            A short timer with callback can be created in a logic action by calling TimerManager.createShortCallbackTimer() with the following parameters:
          • createShortTimer(timerId, autoDestroy, [duration[, message[, appContextValues]]])
            This function is used to create a short timer in the logic action based on the specified parameters.
          • createTemporaryTable(name, columns, indices)
            Facade.createTemporaryTable(name, columns, indices) allows creation of modeled tables to store data temporarily.
          • createTimer(timerId, autoDestroy, [duration[, message[, appContextValues]]])
            This function is used to create a timer in the logic action based on the specified parameters.
          • deleteSessionStorage()
            This function clears the session storage in the system.
          • deleteAllCookies()
            This function deletes all the cookies from the system by calling HTML APIs.
          • ideleteFromTableAsync: function (tableName, whereCond)
            This function deletes the data from the specified table based on the defined conditions.
          • destroyTimer(timerId)
            This function removes the timer from the TM without any further action (e.g Message box, app context modifications, or callbacks).
          • executeSQL(dataSource, dataSourceMethod, jsonParams)
            Run a custom non-select SQL statement.
          • getAllTimers([groupId])
            The function returns an array of objects with functions defined in the Returns section.
          • getBarCodeScannerDataAsync()
            Load the device's default camera and scan the barcode.
          • getElapsedTime(timerId)
            The function returns the elapsed time in minutes if the timer with the corresponding timer ID exists.-1 otherwise.
          • getListAsync(objectClass, jsonQuery)
            Loads a list from the database. The result is a JSON object representation of the loaded list.
          • getMergedListAsync(datasourceInfos, [tableName, returnResult])
            Merge engine helps to merge and join data from various database tables to create a single record. As this function may sometimes result in empty values in some records, default values are defined for such records.
          • getNetworkConnectionStatus()
            Get the current network status. This method can be called by customizers.
          • getObjectAsync(objectClass, jsonQuery)
            Load an object from the database. The result is a JSON object representation of the loaded object.
          • getMergedListAsync(jsonQuery)
            Used to load a list from the database by using the merge engine. The result is a JSON object representation of the loaded list.
          • getPictureAsync({Object}cameraSettings, {String}source)
            Loads the device's default camera and gets the image URI. It can also read images from the device image gallery.
          • getPictureFromLibraryAsync({Object}cameraSettings)
            This API calls the getPictureAsync API with the parameter IMAGE_LIBRARY to read images from the device image gallery.
          • getSfOnDemandDataAvailabilityAsync(nftName, objectId)
            Gets information about the download status of a Named Fetch Tree (NFT).
          • getShortElapsedTime(timerId)
            The function returns the elapsed time in seconds if a short timer with the corresponding timer ID exists.-1 otherwise.
          • getTimer(timerId)
            The function returns an object containing getter functions defined in the table under Returns section, if the timer with the corresponding timer ID exists.
          • getTimerSnapshotLO([groupId])
            The function returns an LO.
          • getUriSchemeAsync()
            To enable error free input of Consumer Goods Cloud application URL in the Deployment screen, that is the first screen, the user can click the URL from the link in the email attachment or any other source.
          • hasTimer(timerId)
            Here are the parameters and returns.
          • insertQueryIntoAsync(tableName, selectFromDatasourceName, selectParamsJson)
            This function inserts the result of SELECT statement executed on the specified data source, using the defined parameters, into the table name.
          • isFilePendingForCompressionAsync(filePath)
            The Facade method isFilePendingForCompressionAsync(filePath) checks if the file is pending for compression or is compressed.
          • isSfOnDemandDataAvailabilityAsync(nftName, objectId)
            Checks the download status of a Named Fetch Tree (NFT).
          • Launch()
            Time Manager leverages Framework Timer APIs to manage multiple timers. All the timers that are created or changed are stored in the database on the device.
          • loadJSONFileAsync(path)
            Test plugins that load JSON files in the reference application. The method reads the file from the given path, parses it, and returns a correctly formed JSON object. loadJSONFileAsync() is a convenience method to work with JSON objects. It uses the standard Facade method loadFileAsync(path).
          • loadLookupsAsync(jsonParams)
            Load lookups. Lookups are read-only objects that contain limited information about a special business object.
          • logOutUser()
            This main function invokes several methods to clear cookies, sessions, cache, and any user-related data. It terminates the backend processes that are running and initiates the login screen.
          • removeCustomDataSource(objectClassName)
            Custom data sources are used when the normal data source mechanism can't be applied. In the current framework, the data source name is derived from the business object name that uses this data source. Another use case could be that in certain situations a data source that differs from the default data source configured for the business object must be used. removeCustomDataSource() removes such a mapping and restores the default.
          • resetNetworkCredentialsAsync()
            Facade.resetNetworkCredentialsAsync() is one of the KeyChain API methods that provides a secure key-value storage for framework users. This storage can be used to store any sensitive information, such as credentials for web-based authentication. resetNetworkCredentialsAsync() resets the username and password from secure storage.
          • restartShortTimer(timerId)
            This function restarts the short timer. If restartShortTimer() is called with a timer ID that doesn’t exist, a false value is returned. During the restart process, the duration of the short timer is reset to the initial value. The values of 'message' and 'appContextValues' remains as is.
          • restartTimer(timerId)
            This function restarts the timer. If restartTimer() is called with a timer ID that doesn’t exist, a false value is returned. During the restart process, the duration of the short timer is reset to the initial value. The values of 'message' and 'appContextValues' remains as is.
          • rollbackTransaction()
            Reset the SQL statement buffer maintained by the Facade.
          • saveCorrelatedListAsync(listObject, nameOfSaveLO, mappingJSON)
            Fills the Facade's SQL-Statement buffer with statements must save the list items in the list combined with the list items of the nested lists. Depending on the object status these are INSERT, UPDATE or DELETE statements.
          • saveFileAsync((content, fileType, compressed)
            This method saves the file.
          • saveJSONFileAsync(jsonObject, compressed)
            Save JSON content to a file. An optional parameter, compressed, enables the function to compress the JSON object.
          • saveListAsync(listObject)
            Fill the Facades SQL statement buffer with statements required to save the list items in the list. Depending on the object status, these statements are INSERT, UPDATE, or DELETE statements. Note that this method doesn't save anything directly.
          • saveObjectAsync(object)
            Fill the Facades SQL statement buffer with statements required to save the object. Depending on the object status, these statements are INSERT, UPDATE, or DELETE statements. Note that this method doesn't save anything directly.
          • secureGetAsync(key, defaultValue)
            Get a secure key-value storage for framework users. This storage can be used to store any sensitive information, such as credentials for web-based authentication. secureGetAsync() gets the value of the key supplied; if no value is found, the default value is returned.
          • secureSetAsync(key, value)
            Provides a secure key-value storage for framework users. This storage can be used to store any sensitive information, such as credentials for web-based authentication. secureSetAsync() saves the value of the key in iOS (KeyChain) / Android (Shared Preferences). For Android, if (version >= API Level 18), the value is encrypted; if (version < API Level 18), the value isn't encrypted.
          • selectSQL(dataSource, dataSourceMethod, jsonParams)
            Run a custom Select SQL statement.
          • sendEmailAsync(emailObject)
            You can now send emails from within the Consumer Goods (CG) Cloud offline mobile app. Using this method opens the compose view of the email client on the device. If more than one email client is registered, then the user is given an option to choose the email client.
          • sendSMS(dial, message)
            Opens the SMS manager or the default SMS application on the device with the requested phone number and message to initiate sending an SMS directly from the CG Cloud offline mobile app.
          • setGroupId(timerId, groupId)
            This function is used to create a timer in the logic action based on the specified parameters.
          • setNetworkCredentialsAsync(userName, password)
            Facade.setNetworkCredentialsAsync() is one of the KeyChain API methods for providing a secure key-value storage for framework users. This storage can be used to store any sensitive information, such as credentials for web-based authentication.
          • setPrintFont(printFontId)
            Sets the custom font for PDF printing in the Consumer Goods offline mobile app. After you set up a custom print font, you can’t switch to another custom print font during the application runtime.
          • setQuickSearchDelay()
            Sets the delay time in milliseconds for successive quick search operations.
          • startBackgroundReplicaton()
            Starts a full replication including both upload and download.
          • startBackgroundUpload()
            Uploads changes without full synchronization, which helps to load data faster. This function is supported in the Consumer Goods Cloud Solution.
          • startEndlessReplication(syncTimeInterval)
            Starts periodic background replication.
          • startPhoneCall(dial)
            Opens the phone dialer application on the device with the requested phone number to initiate a phone call directly from the Consumer Goods (CG) Cloud offline mobile app.
          • startShortTimer(timerId)
            This function starts the short timer. A formerly stopped short timer continues with the remaining duration.
          • startThirdPartyAsync(url, jsonParams)
            You can call third-party apps from within the Consumer Goods (CG) Cloud offline mobile app on Android.
          • startTimer(timerId)
            This function starts the timer. A formerly stopped timer continues with the remaining duration.
          • startTransaction()
            Reset the SQL-Statement buffer maintained by the Facade.
          • stopShortTimer(timerId)
            This function stops the short timer. If stopshortTimer() is called with a timer ID that doesn’t exist, the function returns a false value. The elapsed time is saved in the short timer.
          • stopTimer(timerId)
            This function stops the timer. If stopTimer() is called with a timer ID that doesn’t exist, the function returns a false value. The elapsed time is saved in the timer.
          • UiCache.clearCache(true)
            This function clears the cache. It passes a Boolean value 'true'. If the value is true, the cache is cleared.
          • updateAppContextValues(timerId, message)
            If updateAppContextValues() is called with a timer ID that doesn’t exist, timer isn’t created and false value is returned. This function can’t be used on callback-timers.
          • updateBTPrefixSuffixAsync(prefix[Code], suffix[Code])
            Changes the prefix and suffix based on the values passed.
          • updateDuration(timerId, duration)
            This function updates the timer duration.
          • updateMessage(timerId, message)
            This function updates the message. If the updateMessage() is called with a non-existent timer ID, the timer isn’t created and false value is returned. This option can’t be used on callback-timers.
          • updateShortDuration(timerId, duration)
            This function updates the short timer duration.
           
          Loading
          Salesforce Help | Article