Skip to main content
Version: 1.22.3

SimpleGo

This client-side class provides methods that allow the system to perform various URL transitions. This class has no constructor; the methods can be accessed with the s_go global object.

s_go.open(url, target, callback)


Use this method to go through the URL.

note

It is not recommended to pass an absolute URL as a parameter value for this method, because it leads to scalability issues. Define the relative path, see the example below.

Not recommendedRecommended
https://instance.example.com/record/task/record/task

Parameter(s):

NameTypeMandatoryDefault value
urlStringYN
targetStringNN
callbackFunctionNN

Return:

TypeDescription
VoidThis method does not return a value.

Example:

s_go.open()
s_go.open('/list/user');

To open a URL in a new window, pass the '_blank' value to the target parameter. You also need to pass a newWindow object into your callback function.

Example:

s_go.open()
s_go.open('/list/user', '_blank');
s_go.open()
s_go.open('/record/task?field_parent_id=' + s_form.getUniqueValue(), '_blank', (newWindow) => {
s_i18n.getMessage('Create a new subtask', (response) => {
newWindow.s_widgets.getForm('Default').addInfoMessage(response, 5000);
});
});

s_go.openList(table, query)


Use this method to open the list of the specified table.

Parameter(s):

NameTypeMandatoryDefault value
tableStringYN
queryStringNN

Return:

TypeDescription
VoidThis method does not return a value.

Example:

s_go.openList()
s_go.openList('user', 'condition=(active=1)&view=Support');

s_go.openRecord(table, sys_id)


Use this method to open the form of the specified record.

Parameter(s):

NameTypeMandatoryDefault value
tableStringYN
sys_idStringYN

Return:

TypeDescription
VoidThis method does not return a value.

Example:

s_go.openRecord()
s_go.openRecord(s_user.user.essence, s_user.userID);

s_go.reloadWindow()


Use this method to refresh the current page.

Return:

TypeDescription
VoidThis method does not return a value.

Example:

s_go.reloadWindow()
s_go.reloadWindow();

s_go.getURL()


Use this method to get the current page URL.

Return:

TypeDescription
StringThis method returns the current page URL.

Example:

s_go.getURL()
const url = s_go.getURL();

s_go.back()


Use this method to verify whether the form has been changed. If the form has been changed but not saved, a pop-up window appears notifying that the changes will be lost. As a result of the method, the user is redirected to the previous page.

Return:

TypeDescription
VoidThis method does not return a value.

Example:

s_go.back()
s_go.back();