Question

I have the "Automatic Synchronization - Only through Wifi" enabled in the mobile app. How often does automatic data synchronization occur?

Answer

Each time the application is minimized, it synchronizes after 30 seconds. And if the user activates the application again, the synchronization stops.

Note. Due to the specifics of the iOS operating system, it can stop all processes in the background in about 3 minutes, i.e., if the synchronization did not occur in the background, then it actually did not occur at all. 

Like 0

Like

Share

0 comments
Show all comments

Question

The user creates a visit in the mobile application and syncs. Then removes a visit to the web version of the app.

The user is synchronized in the mobile application, visits are not deleted. User clears the cache - visits are deleted.

Is it possible to synchronize (to delete the records already deleted in the web version) without clearing the cache?

Answer

The mobile application does not implement the termination of deleted records in the desktop application. This is explained by the fact that no logging is performed by default on the server; accordingly, the mobile application does not know that the termination has occurred.

If you want to terminate the records, then you need to enable an additional option in the manifest for the necessary models (for example, the Activity model):

{
   "SyncOptions": {
      "ModelDataImportConfig": [
         {
            "Name": "Activity",
            "IsAdministratedByRights": true
         }
      ]
   }
}

This option adds an additional step to the synchronization, in which the sample of data from the server is selected and compared with the sample of the data in the mobile application.

All "extra" records will be deleted, and the synchronization time might increase (depending on the number of records).

Like 0

Like

Share

0 comments
Show all comments

Question

How do I hide the "Dashboards" section in the mobile app?

Answer

Create a custom schems (Source Code) (for example, "MobileUtilitiesCustom")

/* Hiding the "Dashboards" section */
 
Terrasoft.ApplicationUtils.initializeSystemData({
    success: function() {
        Terrasoft.ApplicationConfig.moduleGroups.get("sales").modules.splice(0, 1);
    }
});

In the mobile application manifest (for example, "UsrMobileApplicationManifestCustomMobile") specify the custom schema

{
    "CustomSchemas": [
        "MobileUtilitiesCustom"
    ]
}

 

Like 0

Like

Share

0 comments
Show all comments

Question

Mobile app. How to add the "Add" button to the lookup field which does not have its own section?

Answer

According to the base logic of the mobile application, you can only add new values in the lookup fields only if there is a section for this field with an edit page (for example, the “Owner” field and the “Contacts” section). In order to implement the "Add" button, you need to add a separate edit page and all necessary columns.

To do this:

Create a page schema with an Edit type for the Usrnomberoflid object (for example, the name of the UsrnomberoflidEditPage schema (page)). Quick page code generation mechanisms are described in the "How to quickly generate a page code for the mobile application" article:

Terrasoft.LastLoadedPageData = {
    controllerName: "Terrasoft.configuration.UsrnomberoflidEditPageController",
    viewXClass: "Terrasoft.configuration.UsrnomberoflidEditPageView"
};
 
Ext.define("Terrasoft.configuration.view.UsrnomberoflidEditPage", {
    extend: "Terrasoft.view.BaseEditPage",
    alternateClassName: "Terrasoft.configuration.UsrnomberoflidEditPageView",
    config: {
        id: "UsrnomberoflidEditPage"
    }
});
 
Ext.define("Terrasoft.configuration.controller.UsrnomberoflidEditPage", {
    extend: "Terrasoft.controller.BaseEditPage",
    alternateClassName: "Terrasoft.configuration.UsrnomberoflidEditPageController",
    statics: {
        Model: Usrnomberoflid
    },
    config: {
        refs: {
            view: "#UsrnomberoflidEditPage"
        }
    }
});

Create a schema and register the columns that we want to display on the page (for example, the name of the UsrMobileUsrnomberoflidModuleConfig schema (setting up columns in a new page)):

Terrasoft.sdk.GridPage.setPrimaryColumn("Usrnomberoflid", "Name");
Terrasoft.sdk.RecordPage.addColumnSet("Usrnomberoflid", 
    {
        name: "primaryColumnSet",
        isPrimary: true
    }, 
    [
        {
            name: "Name"
        }
    ]);
Terrasoft.sdk.RecordPage.addColumn("Usrnomberoflid", {
    name: "CreatedOn"
}, "primaryColumnSet");

Connect these schemas to the manifest. For example, "UsrMobileApplicationManifestOpportunities":

"Usrnomberoflid": {
    "Edit": "UsrnomberoflidEditPage",
    "RequiredModels": [
        "Usrnomberoflid"
    ],
    "PagesExtensions": [
        "UsrMobileUsrnomberoflidModuleConfig"
    ]
},

Now if you click on a record, all its information will be displayed; if you swipe across the field from right to left, you will see a list of available values with a quick filter.

Like 0

Like

Share

0 comments
Show all comments

Question

Due to special characters, or because of the long file name, synchronization does not take place.

It is necessary to change the name of the file so that it is displayed.

Answer

To customize the display of the file name, you need to make the following changes in the manifest (example in the Activities section on the ActivityFile details): set the UseRecordIdAsFileName flag to true for the binary column Data. Thus, file names will be generated based on the record ID.

"SyncOptions": {
    "ModelDataImportConfig": [
        {
            "Name": "ActivityFile",
            "SyncColumns": [
                "Id",
                "Name",
                {
                    "Name": "Data",
                    "UseRecordIdAsFileName": true
                },
                "Activity",
                "Type"
            ]
        }
    ]
},

 

Like 0

Like

Share

0 comments
Show all comments

Question

Required "Organization"  field is affixed to the contact object "at the application level"

In the mobile app:



- Create a new contact

- Fill in the "Organization" field (created earlier in the web app)

- Save

- Synchronize

- An error occurs

Call Stack:

Contact (9d6652ba-5062-45d2-a7f2-1fb6c3ba1978) at Wed May 16 2018 11:13:07 GMT + 0300 (MSK). Error text: Type: Terrasoft.ODataRequiredColumnsEmptyValuesException

Message: The Organization field is a required field.

AdditionalInfo: {"position": 0, "error": {"code": "3", "message": {"value": "The Organization field is required"}, "innererror": {"message": "Organization field is required", "type": "Terrasoft.Core.Entities.RequiredColumnsEmptyValuesException", "stacktrace": "in Terrasoft.Core.Entities.Entity.ValidateRequiredColumns () \ r \ n in Terrasoft.Core.Entities .Entity.InternalSave (Boolean validateRequired, Boolean setColumnDefValue) \ r \ n in Terrasoft.Core.Entities.Entity.Save (Boolean validateRequired, Boolean setColumnDefValue) \ r \ n in Terrasoft.Core.Entti.SerathiraADe.V. \ r \ n in Terrasoft.Core.Entities.Services.ServiceContext.SaveChanges () "," internalexception ": null}}}

Everything works correctly if the field is not required.

Answer

Contact and Account objects are bound by cyclic links (for example, in a mobile application, both a contact and an account (as well as the connection between them) can be added).

Therefore, when synchronizing records, requests are split for correct storage: 

First, creating a contact record, then creating an account, then the lookup fields of the connections between them are updated with the necessary values of the newly created data. Thus, the binding will not work.

As a workaround, we can propose making it required at the card level using business rules:

Terrasoft.sdk.Model.addBusinessRule('Contact', {
    ruleType: Terrasoft.RuleTypes.Requirement,
    triggeredByColumns: ['Name']
});

Then add the required module to the manifest in the ModelExtensions section.

An example implementation can be found in the "MobileActivityModelConfig" schema.

Like 0

Like

Share

0 comments
Show all comments

Symptoms

An error occurs during synchronization:

The element with the "90a3e9f6-........................-7c4aadb41f28" identifier is not found.

Cause

The SysLookup table is not used in desktop versions 7.5 and 7.6, but is used in the mobile application below version 7.7.1.

In the SysLookup table, there are records that refer to nonexistent schemas, for example:

90A3E9F6-12D4-45B5-9122-7C4AADB41F28

A85932A3-30A5-49D7-9627-7F749A055AB7

CCF7D813-FC83-47AD-BE61-8F3B3B98A54F

E0AA5FA2-0910-478D-943B-E9C2579AD7B4

Solution

Run script:

UPDATE [SysLookup]
SET IsSimple = 0
WHERE IsSimple = 1
AND NOT EXISTS (select 1 from SysSchema ss WHERE ss.[UId] = SysEntitySchemaUId)

 

Like 0

Like

Share

0 comments
Show all comments

Symptoms

An error occurs during synchronization: The element with the identifier "90a3e9f6 -........................- 7c4aadb41f28" was not foundю

Cause

The SysLookup table is not used in desktop versions 7.5 and 7.6, but is used in the mobile application below version 7.7.1.

There are records in the SysLookup table that refer to nonexistent schemas, e.g., with such UIDs:

90A3E9F6-12D4-45B5-9122-7C4AADB41F28

A85932A3-30A5-49D7-9627-7F749A055AB7

CCF7D813-FC83-47AD-BE61-8F3B3B98A54F

E0AA5FA2-0910-478D-943B-E9C2579AD7B4

Solution

Run the following script:

UPDATE [SysLookup]
SET IsSimple = 0
WHERE IsSimple = 1
AND NOT EXISTS (select 1 from SysSchema ss WHERE ss.[UId] = SysEntitySchemaUId)

Necessary conditions and possible restrictions

Some versions of BPMonline 7.6

Mobile app version is lower than 7.7.0

Like 0

Like

Share

0 comments
Show all comments

Symptoms

While accessing one of the section in the mobile app, the following error is displayed:

Terrasoft.SourceCodeException

Сообщение: TypeError: undefined is not an object (evaluating 'Terrasoft.sdk.RecordPage.getColumns(model, columnSetName).

get(columnName).columnOriginalConfig')

Additional information:

Script: file:///private/var/mobile/Containers/Bundle/Application/4C00C070-499C-4318-9653-8938B2A3B608/bpm'online.app/www/Common/Terrasoft.Mobile.Combined.js%0D%0A%09Line: 7698"

Cause

The user deleted the base column via the designer

Solution

1. In the configuration, create a new "module" with the name UsrMobileOverrideUtilities

Add the following text:

Ext.define("Terrasoft.sdk.RecordPage.Override", {
    override: "Terrasoft.sdk.RecordPage",
    configureColumn: function(model, columnSetName, columnName, columnConfig) {
        if (!Terrasoft.sdk.RecordPage.getColumns(model, columnSetName).get(columnName)) {
            return;
        }
        this.callParent(arguments);
    }
});

2. Change the custom manifest (usually called UsrMobileApplicationManifestCustom)

Add the following block:

"CustomSchemas": [
    "UsrMobileOverrideUtilities"
],

Necessary conditions and possible restrictions

The base column was used in one of the base mobile application scripts.

Like 0

Like

Share

0 comments
Show all comments

Question

1. Is it possible to use filterMethod for a detail (similarly to the main application), or in any way use an arbitrary filter and not just a filter based on the column of the parent page?

2. How to disable the ability to add, delete and edit detail records, depending on the values on the parent page?

Answer

1. For details, you can specify filters using the configure() method of the corresponding sdk-class:

Terrasoft.sdk.Details.configure("Contact", "ActivityDetailV2StandartDetail", {
   filters: Ext.create("Terrasoft.Filter", {
      type: Terrasoft.FilterTypes.Group,
      subfilters: [
         Ext.create("Terrasoft.Filter", {
            compareType: Terrasoft.ComparisonTypes.NotEqual,
            property: "Type",
            value: Terrasoft.GUID.ActivityTypeEmail
         })
      ]
   })
});

2. In general, changing the mode of detail operation is done like this:

Terrasoft.sdk.Details.setChangeModes("Contact", "ActivityDetailV2StandartDetail", [Terrasoft.ChangeModes.Read]);

But if you need to change the mode of operation based on the condition, then there is a getChangeModes() method for this purpose in the page controllers. In the controllers of the corresponding pages (grid, view, edit) you need to expand the following method:

getChangeModeOperations: function() {
   var detailConfig = this.getDetailConfig();
   if (detailConfig) {
      var parentRecord = detailConfig.parentRecord;
      if (parentRecord.get("IsNonActualEmail") === false) {
         return {
            canCreate: false,
            canUpdate: false,
            canDelete: false
         };
      }
   }
   return this.callParent(arguments);
}

 

Like 0

Like

Share

0 comments
Show all comments