Question

I need to place a button under or next to one of the fields on the edit page, clicking on which will display the lookup list.

I need to open a lookup that is not related to the page, and I may need additional operations before that. This cannot be done by just adding a lookup field.

Is it possible to place a button somewhere in the middle of the page? The manual action will be quite inconvenient for the user.

Answer

In the config view, define the required control + a method to display it, and in the controller, assign a handler:

Ext.define("...view...", {
    config: {
       refreshButton: {
            id: 'usr_order_refresh_btn',
            cls: "x-button-primary-blue",
            text: 'Update'
        }
    },
    showRefreshButton: function (isShow) {
        var navigationPanel = this.getNavigationPanel(); /*a component in which the controll will be displayed*/
        var refreshButton = this.getRefreshButton();
        if (isShow) {
            this._refreshButton = navigationPanel.addButton(refreshButton);
        } else {
            navigationPanel.removeButton(refreshButton);
        }
        return this._refreshButton;
    }
});
Ext.define("...controller...", {
    initializeView: function (view) {
        this.callParent(arguments);
        var btn = view.showRefreshButton(true);
        btn.on("tap", this.onRefreshButtonTap, this);
    },
    onRefreshButtonTap: function() {
        /* subject */
    }
});

If you need to open a picker to select a value, then look in the MobileActivityGridPageControllerV2.  For example, there are pickers that enable you to select the "Responsible" employee (the "getEmployeePicker()" method) or select the schedule mode (the "getGridModePicker()" method).

Like 0

Like

Share

5 comments

Hi,

I am given with the requirement to create a button in Account Edit page section in Mobile application. The above code seems difficult to understand. Can you please explain How create/add a button in mobile application.

Please help/guide me to acheive this.

Sriraksha KS,

Hello, to add the button to the edit page you can follow the instructions from the article: 

https://community.bpmonline.com/articles/adding-custom-user-action-mobi…



Best regards,

Alex

Alex_Tim,

The link you gave displays

"You are not authorized to access this page."

 

Please help !!

Sriraksha KS,

It looks fine from my side. I recommend opening this link in another browser or incognito mode.

Seems like when you are logged into community, the link is not working; i was not logged in and it opened for me; but once i logged into my community profile, the link didn't open.

Show all comments

Question

At the moment, the synchronization does not complete successfully, due to the fact that the application (in the "Activities" section) contains a large number of files that the mobile application is trying to synchronize and as a result ends with a timeout error.

The analysis revealed that the main file type is mostly images used in email signatures (have the name "image").

Is it possible to set up the filtering mechanism in such a way that does not upload the extra files?

Answer

Add a filtering mechanism, which will ignore files related to the signature during synchronization. Add the following code to the mobile application manifest (MobileApplicationManifestDefaultWorkplace):

{
    "SyncOptions": {
        "SysSettingsImportConfig": [],
        "ModelDataImportConfig": [
            {
                "Name": "ActivityFile",
                "SyncFilter": {
                    "property": null,
                    "valueIsMacros": false,
                    "value": null,
                    "isNot": true,
                    "type": "Terrasoft.FilterTypes.Group",
                    "logicalOperation": "Terrasoft.FilterLogicalOperations.Or",
                    "subfilters": [
                        {
                            "property": "Name",
                            "funcType": "Terrasoft.FilterFunctions.SubStringOf",
                            "funcArgs": ["image"] //the word used to filter the images
                        },
                        {
                            "property": "Activity.Owner",
                            "isNot": true,
                            "valueIsMacros": true,
                            "value": "Terrasoft.ValueMacros.CurrentUserContact"
                        }
                    ]
                }
            }
        ]
    },
    "Modules": {},
    "Models": {}
}

If this is a FieldForce product, then you also need to add the same code to the "MobileApplicationManifestFieldForceWorkplace" manifest.

Like 0

Like

Share

0 comments
Show all comments

Symptoms

Terrasoft.ServerException

{Terrasoft.PerformanceCounterManager.startCounter(\"onReady\");Ext.BLANK_IMAGE_URL=\"/0/terrasoft.axd?rm=Terrasoft.UI.WebControls&r=s.gif\";\r\n\r\nthis.ErrorIcon=new Terrasoft.ImageBox({\r\n  id: \"ErrorIcon\",\r\n  cls: \"application-ico-error\",\r\n  renderTo: \"ErrorIcon_Container\"\r\n});\r\nthis.ErrorOccures=new Terrasoft.Label({\r\n  id: \"ErrorOccures\",\r\n  cls: \"x-label-black\",\r\n  renderTo: \"ErrorOccures_Container\",\r\n  caption: \"В работе приложения bpm'online возникла ошибка. Приносим извинения за неудобства.\"\r\n});\r\nthis.ErrorSupportInfo=new Terrasoft.Label({\r\n  id: \"ErrorSupportInfo\",\r\n  cls: \"x-label-black\",\r\n  renderTo: \"ErrorSupportInfo_Container\",\r\n  caption: \"Please contact bpm'online regarding this error.\"\r\n});Terrasoft.PerformanceCounterManager.stopCounter(\"onReady\");}});Terrasoft.ScriptManagerUniqueID=\"ScriptManager\";\n\t//]]>\n\t\n\r\n\r\n\t\r\n\r\n\r\n\r\nМы гарантируем полную конфиденциальность и анонимность.
\r\n\t\t\t
\r\n\t\t\t\r\n\t\t\t
\r\n\t\t\t
\r\n\t\t\tПоказать детальную информацию об ошибке

\r\n\t\t\tDate: 07.11.2015 8:12:22\r\nDate (UTC): 07.11.2015 6:12:22\r\n\r\nException Message: Memory gates checking failed because the free memory (107479040 bytes) is less than 1% of total memory.  As a result, the service will not be available for incoming requests.  To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.\r\nException Type: System.InsufficientMemoryException\r\nException Source: System.ServiceModel.Activation\r\n\r\nException Stack Trace:\r\n  at System.ServiceModel.Activation.ServiceMemoryGates.Check(Int32 minFreeMemoryPercentage, Boolean throwOnLowMemory, UInt64& availableMemoryBytes)\r\n  at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CheckMemoryCloseIdleServices(EventTraceActivity eventTraceActivity)\r\n  at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)\r\n\r\nSessionID: w0l0muum2dgm2vmlxyszxo0j\r\nRequest URL: /0/ServiceModel/EntityDataService.svc/MobileDataCollection?$select=Id,CreatedById,CreatedOn,ModifiedById,ModifiedOn,Key&%24skip=0&%24top=-1\r\nRequest Path: /0/ServiceModel/EntityDataService.svc/MobileDataCollection\r\nRequest Type: GET\r\nUser Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13B143 (5048248176)\r\nUser Host Address: 37.147.161.229\r\nUser: Xxxxxxxxxxx\r\nIs Authenticated: True\r\nAuthentication Type: Forms\r\nIs Secure Connection: True\r\n\r\nApplication Version: 7.6.0.1148\r\nApplication Path: D:\\App\\peremenatrade\\Terrasoft.WebApp\\\r\nApplication Virtual Path: /0\r\nApplication Trust Level: Full\r\nMachine Name: RU2-C004-WEB01\r\nIs Local: False\r\n\r\nProcess ID: 9124\r\nProcess Name: w3wp.exe\r\nProcess Account Name: RU\\iis-peremenatrade\r\nThread Account Name: RU\\iis-peremenatrade\r\nOS Version: Microsoft Windows NT 6.3.9600.0\r\nNet Framework Version: 4.0.30319.34209\r\nDBExecutor Type: MSSqlExecutor\r\n\r\n\t\t\r\n\t\r\n\r\n\r\n"}

Cause

According to the mobile application error:

Exception Message: Memory gates checking failed because the free memory (107479040 bytes) is less than 1% of total memory.  As a result, the service will not be available for incoming requests.  To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.\r\nException Type: System.InsufficientMemoryException\r\nException Source: System.ServiceModel.Activation\r\n\r\nException Stack Trace:\r\n  at System.ServiceModel.Activation.ServiceMemoryGates.Check(Int32 minFreeMemoryPercentage, Boolean throwOnLowMemory, UInt64& availableMemoryBytes)\r\n  at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CheckMemoryCloseIdleServices(EventTraceActivity eventTraceActivity)\r\n  at 

Connected with a memory jump on the server where the application is deployed.

Solution

Restart the site in IIS.

Like 0

Like

Share

0 comments
Show all comments

Symptoms

Bug report:

Type: Terrasoft.SourceCodeException

Message: TypeError: undefined is not an object (evaluating 'ruleConfig.rule')

Cause

BusinesRuleManager in the edit card executes the rules at the same time, in parallel.

Solution

1. In Configuration, add a custom schema with the “Source code”  type, e.g., with the “UsrMobileUtilities” name;

2. Paste the following code in the schema:

Ext.define("Terrasoft.BusinessRulesManager.Override", {
    override: "Terrasoft.BusinessRulesManager",
    /** * @private */
    doExecuteRules: function(config) {
        this.executionConfig = config;
        this.allRulesAreValid = true;
        this.executeRulesForNextRecord();
    },
    executeRules: function(config) {
        if (this.rulesToExecute > this.rulesExecuted) {
            this.waitRulesInProgressId = setInterval(function() {
                if (this.rulesToExecute === this.rulesExecuted) {
                    clearInterval(this.waitRulesInProgressId);
                    this.doExecuteRules(config);
                }
            }.bind(this), 500);
        } else {
            this.doExecuteRules(config);
        }
    }
});

3. Save changes.

4. Connect this schema in the mobile application manifest (for example, “MobileApplicationManifestDefaultWorkplace”) in the “CustomSchemas” section:

"CustomSchemas": [
    "UsrMobileUtilities"
]

5. Save changes.

Alternative solution: fill out the City, Regions and Countries lookups (connected fields must also be populated).

Like 0

Like

Share

0 comments
Show all comments

Question

What are the features of the camera API in the mobile application? (v 5.4)

Answer

BPMonlineMobile 5.4 uses PhoneGap 2.8.

You can read about the camera features here: http://cordova.apache.org/docs/en/2.8.0/cordova_camera_camera.md.html#C…

Like 0

Like

Share

0 comments
Show all comments

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