LoginFunctions

This object is returned after a successful login to the server. Use the following methods for this object to retrieve information regarding the Priority installation and API.

Methods

Name Description
apiVersion Returns the current version of the Web SDK API.
companies Returns information on available companies and user profiles.
languages Returns information on available system languages.
constants Returns information on system constants currently in effect.
entMessage Used to retrieve messages for a specific Priority entity.
priorityVersion Returns the current version of Priority installed on the server.
isUserConsent Checks whether the user has provided consent for personal data stored by the system (to address GDPR regulations).

apiVersion(onSuccess, onError)

This method can only be run on the LoginFunctions object, which is returned after a successful login.

This method returns the current version of the Web SDK API supported on the server. Version numbering is divided into MAJOR.MINOR.PATCH, e.g. 18.0.1.

Param Type Description
onSuccess GetAPIVersionSuccessCallback Called on success.
onError ErrorCallback Called on error.

GetAPIVersionSuccessCallback: function

Properties

Param Type Description
version string Version number of the Web SDK API on the server.

companies(onSuccess, onError)

This method can only be run on the LoginFunctions object, which is returned after a successful login.

This method returns an array Company which provides information on the available companies and user profiles for each one.

Param Type Description
onSuccess GetCompaniesSuccessCallback Called on success.
onError ErrorCallback Called on error.

GetCompaniesSuccessCallback: function

Properties

Param Type Description
Company array Contains a listing of available companies.
Company: array

Properties

Param Type Description
dname string Internal (short) name of the company.
title string Full company name.
color array Color[] array containing the RGB values of the company color.
EnvProfile array EnvProfile[] array that contains the usage profiles configured for this company.
EnvProfile: array

Properties

Param Type Description
profilename string The profile name.
profile number The profile ID number.

languages(onSuccess, onError)

This method can only be run on the LoginFunctions object, which is returned after a successful login.

This method returns an array of type language which provides information on the available languages you can work with.

Param Type Description
onSuccess GetLanguagesSuccessCallback Called on success.
onError ErrorCallback Called on error.

GetLanguagesSuccessCallback: function

Properties

Param Type Description
Language Language Contains a listing of available languages.
Language: array type

Properties

Param Type Description
lang number Language code number.
langtitle string Language description e.g. “Australian English”.

constants(onSuccess, onError)

This method can only be run on the LoginFunctions object, which is returned after a successful login.

Results in an object with properties that describe various system constants currently in effect, e.g. decimalsign which determines the decimal sign.

entMessage(ename, type, from, to, onSuccess, onError)

This method can only be run on the LoginFunctions object, which is returned after a successful login.

Use this method to retrieve messages from a specified Priority entity, returned as an array Message. This is useful in apps catering to multiple languages, as the returned message will be in the language specified when logging in (assuming the message has a translation recorded on the server).

Param Type Description
ename string Entity name.
type string Type of entity. Available types are C - compiled program; F - form; or P - procedure.
from number Retrieve messages starting with this message number.
to number Retrieve messages up to this message number.
onSuccess GetMessageSuccessCallback Called on success.
onError ErrorCallback Called on error.

Returns: Promise - - When both onSuccess and onError are not provided.

Fulfill: Message array

Reject: ServerResponse

GetMessageSuccessCallback: function

Properties

Param Type Description
Message array Array containing the messages retrieved from the server.

Message: array

Properties

Param Type Description
message string Message text.
num number Message number.


priorityVersion(onSuccess, onError)

This method can only be run on the LoginFunctions object, which is returned after a successful login.

This method returns the current version of Priority installed on the server.

Param Type Description
onSuccess GetPriVersionSuccessCallback Called on success.
onError ErrorCallback Called on error.

GetPriVersionSuccessCallback: function

Properties

Param Type Description
version string Priority version number.


isUserConsent([onSuccess] , [onError])

This method can only be run on the LoginFunctions object, which is returned after a successful login. Use it to check whether the user has approved a new personal data consent policy.

isUserConsentSuccessCallback: function

Properties

Name Type Description
userConsent number Shows whether the user has provided consent for the latest personal data consent policy. 1: User has approved the latest version. 0: User has yet to provide consent to the latest version of the policy.
marketgateUrl string URL component used to construct URL to access the consent interface.

Checking User Consents

After a successful login, check the userConsent property of the LoginFunctions object. If the value is 1 (consent has been given), login can proceed as usual. If the value is 0, the user has not yet provided consent, and the consent interface should be called.

To call the consent interface, you must construct a URL based on the following instructions, and open it within a frame.

URL Structure

mg + "?" + "WWWUSERCONSENTS" + "&_tabulaini=" + TABULAINI + "&_uselang=" + LANGUAGE + "&_portal=1" + "&_html5=1";

Where:

Once the consent interface has been opened, call isUserConsent repeatedly (every second) to check whether the user has provided consent. If the returned value is 1, consent has been provided, and login can proceed as usual.