Symptoms

Bug report:

Type: Terrasoft.SourceCodeException

Message: TypeError: null is not an object (evaluating 'lookupModel.PrimaryColumnName')

AdditionalInfo: Script: file:///var/containers/Bundle/Application/xxxxxx-xxxx-xxxxx-xxxxx-xxxxxxxx/BPMonlineMobile.app/www/appV2/Common/Terrasoft.Mobile.Combined.js%0D%0A%09Line: 12183 Stack trace:

Terrasoft.core#showUncaughtException@file:///var/containers/Bundle/Application/xxxxxx-xxxx-xxxxx-xxxxx-xxxxxxxx/BPMonlineMobile.app/www/appV2/Common/Terrasoft.Mobile.Combined.js:2821:38

Terrasoft.core#onWindowError@file:///var/containers/Bundle/Application/xxxxxx-xxxx-xxxxx-xxxxx-xxxxxxxx/BPMonlineMobile.app/www/appV2/Common/Terrasoft.Mobile.Combined.js:2463:39

Cause

1. In the mobile application wizard, the primary column is not displayed.

2. In the object (for example, "Account") there is no primary column for display.

Solution

To solve the problem, go to the [Mobile Application Wizard] and re-save the List Settings, Page Settings, and Detail Settings. Save all changes in the mobile app wizard.

Like 0

Like

Share

0 comments
Show all comments

Question

We are trying to optimize the synchronization time of the mobile application (offline), and one of the steps is image optimization.

How can we set the target image size (for example 1280 x 800)?

For example, there is a feature in Appache Cordova for this exact scenario.

Is it possible to do this in the settings or is it necessary to change the code?

Answer

We already optimaze images in the app.

Below is the code used in the base version:

Terrasoft.Camera.captureFromCamera({
            quality: 70,//в процентах
            size: 1280,//по максимальной стороне
            success: function() {},
            failure: function() {},
            scope: this
        });

This code enables you to change the image size:

Terrasoft.sdk.RecordPage.configureColumn("Opportunity", "opportunityFilesDetail", "Data", {
    quality: 50
});

 

Like 0

Like

Share

0 comments
Show all comments

Symptoms

Bug report sample:

Terrasoft-Mobile":"true","Accept":"application/json","Content-Type":"application/json","Authorization":"Cookie"},"method":"GET","disableCaching":false},"performanceCounter":{"startDate":"2015-07-24T08:26:56.702Z"}},"headers":{"X-Terrasoft-Mobile":"true","Accept":"application/json","Content-Type":"application/json","Authorization":"Cookie"},"method":"GET","disableCaching":false},"async":true},"requestId":8,"status":500,"statusText":"Internal Server Error","responseText":"Terrasoft.Mobile.MobileModelLoopException: Models specified in the mobile application manifest have circular relationships\r\n   at Terrasoft.Mobile.MobileModelTopologicalSorter.Sort()\r\n   at Terrasoft.Mobile.MobileModelGraph.Build()\r\n   at Terrasoft.Mobile.MobileManifest.BuildModelGraph()\r\n   at Terrasoft.Mobile.MobileUtilities.GetAppMetadata(HttpContextBase context)\r\n   at Terrasoft.WebApp.Mobile.Services.MobileCodeService.ProcessRequest(HttpContext context)\r\nCycle: [Account,KnowledgeBase]","responseXML":null,"responseBytes":null} 

Calls sequence:

Solution

To solve, you must create (Add - Source code) a custom manifest (for example, MobileApplicationManifestCustom) and specify the "Javascript" language.

For version 7.6 and higher, if MobileApplicationManifest is not in Custom, you need to replace the parent manifest schema. To do this, in the mobile application wizard, select "Section settings" for the workplace and click the "Save" button.

If the custom manifest already exists, open it and add the following code:

{
    "Loops": [
        ["Account", "KnowledgeBase"],
    ]
}

where ["Account", "KnowledgeBase"] - links that must be specified.

The value is written from the value.

For example (from the bug report):

If

Cycle: [Invoice,Contract]","responseXML":null,"responseBytes":null}

Then

Specify the following code:

{
    "Loops": [
        ["Invoice”,”Contract "],                   
    ]
}

If the mobile app version is 7.5 and lower, you also need a manifest (for example, MobileApplicationManifestCustom) in the MobileApplicationManifest system setting:

And check the synchronization. If it ends with an error, then most likely it is still necessary to specify the connection in the custom manifest. As a result, add to the manifest until synchronization ends successfully.

Like 0

Like

Share

0 comments
Show all comments

1. Create Source Code:

Ext.define("Terrasoft.configuration.service.UsrYourService", {
    alternateClassName: "Terrasoft.UsrYourService",
    statics: {
 
        serviceUrl: "rest/UsrYourService/",  // Name of your Service
 
        yourAction: function(config) {
            var data = {
                recordId: config.id // Input parameter(s) of service
            };
            Terrasoft.RequestManager.issueRequest({
                supressRequestEvents: false,
                requestFn: Terrasoft.Ajax.request,
                requestFnConfig: {
                    url: Terrasoft.util.encodeServiceUrl(this.serviceUrl) + config.action,
                    method: "POST",
                    jsonData: data,
                    success: function(response) {
                        var decodedResponse = Ext.JSON.decode(response.responseText, true);
                        Ext.callback(config.success, config.scope, [decodedResponse]);
                    },
                    failure: function(response) {
                        var parser = Ext.create("Terrasoft.ServiceResponseParser", response);
                        var exception = parser.getServiceFailureException();
                        Ext.callback(config.failure, config.scope, [exception]);
                    },
                    scope: this
                },
                responseToStatusCodeFn: function(response) {
                    return response.status;
                },
                scope: Terrasoft.Ajax
            });
        }
    }
});

2. Add in MobileApplicationManifest your service into CustomSchemas block:

"CustomSchemas": [
    "UsrYourService"
]

3. Call service from your code:

yourFunction: function() {
    Terrasoft.UsrYourService.yourAction({
        id: this.record.getId(), // RecordId
        action: "Start", // Method of service
        success: this.serviceSuccess, // Success callback
        failure: this.serviceFailure, // Error callback
        scope: this
    });
},
serviceSuccess: function(response) {
    if (response.isSuccess) {
        ///TODO: do something
    } else {
        Terrasoft.MessageBox.showMessage(Terrasoft.LocalizableStrings.StartErrorMessage); // Error message
    }
},
serviceFailure: function(error) {
    var response = error.getResponse();
    Terrasoft.MessageBox.showMessage(response.statusText);
}

 

Like 0

Like

Share

0 comments
Show all comments

Question

How do I display another column in the "Accounts" list in the mobile app? For example, the "Address" coulmn?

Answer

Since the MobileAccountModuleConfig base schema cannot be changed, you need to create a custom UsrMobileAccountModuleConfig schema (in a custom package, create the page extension schema of the corresponding section). To do this, in the [Configuration] section, select Add > Source code. Fill in the schema properties ([Title], [Name], [Package]). Select JavaScript as a language for the schema, and connect it to the manifest.

 

"Models": {
"Account": {
"RequiredModels": [
. . .
],
"ModelExtensions": [
. . .
],
"ModelExtensions": [],
            "PagesExtensions": [
                "MobileAccountRecordPageSettingsDefaultWorkplace",
                "MobileAccountGridPageSettingsDefaultWorkplace",
                "MobileAccountActionsSettingsDefaultWorkplace",
                "MobileAccountModuleConfig",
                "UsrMobileAccountModuleConfig"
            ]

Paste the following code in the schema:

Terrasoft.sdk.GridPage.setSecondaryColumn("Account", {
    columns: ["Address"],
    convertFunction: function(values) {
        return values.Address;
    }
});

Register the necessary columns in the manifest:

{
            "Name": "Account",
            "SyncColumns": [
                "Address"
            ]
        }

Once done, we recommend regenerating the source code and compiling the configuration 

Like 0

Like

Share

0 comments
Show all comments

Question

Terrasoft.Geolocation.getCurrentCoordinates is used to determine GPS coordinates on an Android mobile device, which for some reason does not launch the GPS module (the GPS start indicator does not appear in the UI of the device). 

Is it possible to collect the coordinate information without enabling this module (maybe a coordinate cache?)

Answer

Yes, the GPS service can be disabled. The data can be collected based on mobile device settings (from Wi-Fi points), or it can be cached. 

In fact, the way bpm'online collects the coordinates can be controlled. Below is an example of the current implementation of the mentioned method:

getCurrentCoordinates: function(config) {
   var enableHighAccuracy = !Terrasoft.Connection.isOnline() ||
      Terrasoft.Connection.getType() !== Terrasoft.ConnectionTypes.WiFi;
   var geo = Ext.create("Ext.util.Geolocation", {
      autoUpdate: false,
      allowHighAccuracy: enableHighAccuracy,
      timeout: 60000,
      listeners: {
         scope: this,
         locationupdate: function(geo) {
            Ext.callback(config.success, config.scope, [geo.getLatitude(), geo.getLongitude()]);
         },
         locationerror: function(geo, timeout, permissionDenied, locationUnavailable, message) {}
      }
   });
   geo.updateLocation();
}

At the moment, if there is no Internet connection or if the device is not connected to Wi-Fi (for example, you're using EDGE or 3G), then the “accurate” positioning will be used (GPS), but otherwise the data will be obtained using Wi-Fi, caching, etc., providing less accurate location information, but sufficient for given business tasks.

Nevertheless, if you need to receive data using GPS in all cases, you can create your own implementation of the action, similar to how it is implemented in bpm'online:

getCurrentCoordinates: function(config) {
   var geo = Ext.create("Ext.util.Geolocation", {
      autoUpdate: false,
      allowHighAccuracy: true,
      timeout: 60000,
      listeners: {
         scope: this,
         locationupdate: function(geo) {
            Ext.callback(config.success, config.scope, [geo.getLatitude(), geo.getLongitude()]);
         },
         locationerror: function(geo, timeout, permissionDenied, locationUnavailable, message) {}
      }
   });
   geo.updateLocation();
}

This method has a number of problems:

- despite the fact that the GPS method is more accurate, the time for receiving such data can be quite long (up to 10-15 minutes).

- the waiting time for receiving the response should be increased, i.e. the timeout parameter in the code above will need to be set to more than 1 minute (60,000 ms).

- this method may decrease your Android device's battery life.

Like 0

Like

Share

1 comments

hi Kirill Potapkin,



Could you please assist with where to add this schema?

1. When does this schema gets triggered?

2. what is geo.updatelocation method performs?

3. How to capture the GPS co-ordinates and store it in a field in custom section.

 

 

BR,

Bhoobalan Palanivelu.

Show all comments

Symptoms

BPM 7.6.0.838 onSite mobile application does not work

Solution

Most likely you have not updated the database structure.

To update the database structure in the browser, you must:

- Close all instances of Chrome;

- Go to the folder in which Chrome stores local data: C:\Users\[USERNAME]\AppData\Local\Google\Chrome\User Data\Default;

- Delete the contents of the following folders:

C:\Users\[USERNAME]\AppData\Local\Google\Chrome\User Data\Default\File System

C:\Users\[USERNAME]\AppData\Local\Google\Chrome\User Data\Default\databases

- Restart Chrome using startchrome.bat (in the Mobile folder with the source code of the mobile application);

- Run the mobile application in the browser.

As a result, Chrome will create a local database with all the necessary tables from scratch (including new columns).

Additionally, please ensure that the latest Framework is installed on the server.

Like 0

Like

Share

0 comments
Show all comments

Question

How can I get into the local database of a mobile application emulator?

For example, to see what data is exchanged during offline synchronization.

Answer

Physically, the file is here - ... \7.11.7\ChromeUserData\Default\databases\file__0, but you will not be able to open it with custom tools due to encryption. 

There are two options:

Open the console in the browser (after synchrobnization), go to the "Application" tab, expand the list of databases in Web SQL and select the bpm'online database. As a result, you'll be able to write SQL queries and see a list of all tables.

More information can be found in a separate article - https://developers.google.com/web/tools/chrome-devtools/manage-data/loc…

- find an extension for Firefox that can work with SQLlite (you can find it on third-party resources).

Like 0

Like

Share

0 comments
Show all comments

Symptoms 

Type: Terrasoft.SyncException%0D%0AСообщение: В процессе синхронизации произошла ошибка%0D%0A%0D%0AТип: Terrasoft.ServerException%0D%0AMessage: Request for server returned an erro%0D%0AAdditional information: %0D%0A%09{"request":{"id":6,"headers":{"X-Terrasoft-Mobile":"true","Accept":"application/json","Content-Type":"application/json","Authorization":"Cookie","X-Requested-With":"XMLHttpRequest"},"options":{"url":"http://xxx.xxx.xxx.xxx/0/Services/ProfileService.asmx/Logout","method":"POST","jsonData":{"customData":"","doLogout":"true"},"headers":{"X-Terrasoft-Mobile":"true","Accept":"application/json","Content-Type":"application/json","Authorization":"Cookie"},"disableCaching":false,"scope":{"initialConfig":{"url":"http://xxx.xxx.xxx.xxx/0/Services/ProfileService.asmx/Logout","method":"POST","jsonData":{"customData":"","doLogout":"true"},"headers":{"X-Terrasoft-Mobile":"true","Accept":"application/json","Content-Type":"application/json","Authorization":"Cookie"},"disableCaching":false},"performanceCounter":{"startDate":"2015-06-08T12:11:51.319Z"}}},"async":true},"requestId":6,"status":500,"statusText":"Internal Server Error","responseText":"System.InvalidOperationException: Request format is invalid: application/json.\r\n   at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()\r\n   at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()\r\n","responseXML":null,"responseBytes":null}%0D%0A%0D%0A

Cause

A problem in IIS settings.

Solution

Go to the IIS settings - Handler Mappings module

Find the rules for files with * .asmx extension with the following names:

"WebServiceHandlerFactory-Integrated"

"WebServiceHandlerFactory-ISAPI-2.0_32bit"

"WebServiceHandlerFactory-ISAPI-2.0_64bit"

and delete all of them.

Like 0

Like

Share

0 comments
Show all comments

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