Article

How to remove the action (Terrasoft.sdk.Actions) in the mobile application and how to sort actions (Terrasoft.sdk.Actions.setOrder)

Question

How to remove the action in the mobile application and how you can sort the actions?

Answer

Approximate algorithm.



1. You need to create your own module (for example,"TestOrderRemoveMobileAccountModuleConfig")

2. To delete an action, use the following method - Terrasoft.sdk.Actions.remove: function (model, actionName)

For example:

Terrasoft.sdk.Actions.remove("Account", "addAccountAnniversary");

3. Use the following code to sort:

Terrasoft.sdk.Actions.setOrder("model ", {
    "actionName1": 0,
    "actionName2": 1,
    …,
    "actionName5": 4
});

For example:

Terrasoft.sdk.Actions.setOrder("Account", {
    "Phone": 0,
    "Email": 1,
    "Meeting": 2,
    "Terrasoft.ActionCopy": 3,
    "Terrasoft.ActionDelete": 4
});
 

4. Then connect it in the user manifest of the mobile application (available on our SDK) in the “Models” section for the “Account” object (if they are accounts) in the “PagesExtensions” section. For example:

 

"Models": {
    "Account": {
        "RequiredModels": [],
        "ModelExtensions": [],
        "PagesExtensions": [
            "TestOrderRemoveMobileAccountModuleConfig"
        ]
    },
 

Where TestOrderRemoveMobileAccountModuleConfig is an arbitrary schema name.

 

You can see the implementation of the add address logic in the MobileAccountModuleConfig schema (the action is called addAccountAddress).

Like 0

Like

Share

0 comments
Show all comments