SDK
support
mobile
Q&A

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

Question

How do I make all elements of the [Addresses] detail on an account page uneditable? Version 7.2.0.

Answer

Below you can find an example of implementing the function for the AddressDetail schema:

1) You can add a new enableDetailControls method:

this.methods.enableDetailControls = function(viewConfig, enabled) {
    if (!viewConfig.items) {
        return;
    }
    viewConfig.items.forEach(function(item) {
        item.enabled = enabled;
    }, this);
};

2) Call this method within the "getCustomItemView" method after complete generation of the view configuration and add the necessary conditions. For example, in front of the "return viewConfig" string:

this.methods.getCustomItemView = function(viewModel, itemKey, action, types, itemViewModel) {
    var viewConfig = {};
    ...
    var enableControls = (action === "edit") && (/*любые другие условия*/);
    this.enableDetailControls(viewConfig, enableControls);
    return viewConfig;
};
It is recommended to receive the values of the necessary conditions before this, since after you execute getCustomItemView, the control function will be passed to the base detail module (DetailModule), where the model connection to the view and detail rendering are performed. 
Like 0

Like

Share

0 comments
Show all comments

Case description:

In agent desktop group queue item tabs by queue (see Figure 1).

 

Figure 1. Agent desktop

Algorithm of realization:

  1. Create replacing client schema of OperatorQueues (must be inherited from "Schema - Agent queues")
  2. Override loadQueues, queueTabChange and createQueuesTabs methods as following:

    define("OperatorQueues", ["terrasoft"],
        function (Terrasoft) {
            return {
                attributes: {},
                methods: {
                    loadQueues: function (callback) {
                        var esq = Ext.create("Terrasoft.EntitySchemaQuery", {
                            rootSchemaName: "Queue"
                        });
                        esq.isDistinct = true;
                        esq.addColumn("Id");
                        esq.addColumn("Name");
                        esq.addColumn("QueueEntitySchema");
                        esq.addColumn("[SysSchema:UId:QueueEntitySchema].Name", "EntitySchemaName");
                        esq.addColumn("[QueueObject:EntitySchemaUId:QueueEntitySchema].IsClosedQueue", "IsClosedQueue");
                        this.appendOperatorFilters(esq);
                        this.addQueueInProgressFilters(esq);
                        esq.getEntityCollection(function (result) {
                            if (!result.success) {
                                callback();
                            }
                            callback(result.collection);
                        });
                    },
                    queueTabChange: function (activeTab) {
                        var queueId = activeTab.get("Id");
                        var entitySchemaUId = activeTab.get("EntitySchemaUId");
                        var entitySchemaName = activeTab.get("EntitySchemaName");
                        var isClosedQueue = activeTab.get("IsClosedQueue");
                        var loadModuleCallback = function () {
                            this.sandbox.loadModule("QueueModule", {
                                renderTo: "operatorQueueEntityContainer",
                                parameters: {
                                    QueueId: queueId,
                                    EntitySchemaUId: entitySchemaUId,
                                    EntitySchemaName: entitySchemaName,
                                    IsClosedQueue: isClosedQueue
                                }
                            });
                        }.bind(this);
                        var profile = this.get("Profile");
                        if (profile.activeEntitySchemaUId !== entitySchemaUId) {
                            profile.activeEntitySchemaUId = entitySchemaUId;
                            this.saveProfileData(loadModuleCallback);
                        } else {
                            loadModuleCallback.call();
                        }
                    },
                    createQueuesTabs: function (collection) {
                        var activeQueueTabName = null;
                        if (!collection) {
                            return;
                        }
                        var profile = this.get("Profile");
                        var savedActiveEntitySchemaUId = profile.activeEntitySchemaUId;
                        var queues = this.get("Queues");
                        queues.clear();
                        collection.each(function (item) {
                            var queueId = item.get("Id");
                            var queueName = item.get("Name");
                            var queueEntitySchema = item.get("QueueEntitySchema");
                            var queueEntitySchemaName = item.get("EntitySchemaName");
                            var isClosedQueue = item.get("IsClosedQueue");
                            if (queueEntitySchema) {
                                var queueUId = queueEntitySchema.value;
                                var queueCaption = queueName;
                                var name = this.getQueueTabName(queueId);
                                queues.add(queueId, Ext.create("Terrasoft.BaseViewModel", {
                                    values: {
                                        Id: queueId,
                                        Caption: queueCaption,
                                        Name: name,
                                        EntitySchemaUId: queueUId,
                                        EntitySchemaName: queueEntitySchemaName,
                                        IsClosedQueue: isClosedQueue
                                    }
                                }));
                                if (queueId === savedActiveEntitySchemaUId) {
                                    activeQueueTabName = this.getQueueTabName(savedActiveEntitySchemaUId);
                                } else if (Ext.isEmpty(activeQueueTabName)) {
                                    activeQueueTabName = name;
                                }
                            }
                        }, this);
                        this.set("ActiveQueueTabName", activeQueueTabName);
                    }
                },
                diff: []
            };
        }
    );

     

Like 0

Like

Share

0 comments
Show all comments
SDK
support
cases

Example override class SummaryModule

SummaryModuleV2.js

define("UsrSummaryModuleV2", ["SummaryModuleV2"],
    function() {
        Ext.define("Terrasoft.SummaryModuleOverrided", {
            override: "Terrasoft.SummaryModule",
 
           /*
            * @override
            */
            getESQ: function() {
                var esq = this.callParent(arguments);
                esq.queryKind = Terrasoft.QueryKind.LIMITED;
                return esq;
            }
        });
    }
);

On the page, which use base class you need to add dependency to overridden class:

BaseSectionV2

define("BaseSectionV2", ["UsrSummaryModuleV2"], function() {
    return {
        methods: {},
        details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
        diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/
    };
});

 

Like 0

Like

Share

0 comments
Show all comments

Question

How can I set a value for an active record from section module in edit mode (vertical list)?

Answer

If the column, for which the value must be set, is among the active string columns, you can try saving the active string:

var activeRow = this.getActiveRow();
activeRow.set("YourColumnName", columnValue);
activeRow.saveEntity();

To make this code work, make sure the activeRow.columns collection contains a column with the YourColumnName name and the Terrasoft.ViewModelColumnType.ENTITY_COLUMN type (this constant equals 0).

You can also implement updating the value via a request, as follows:

var updateQuery = this.Ext.create("Terrasoft.UpdateQuery", {
        rootSchemaName: "EntitySchemaName"
});
var filters = updateQuery.filters;
filters.addItem(this.Terrasoft.createColumnFilterWithParameter(
        this.Terrasoft.ComparisonType.EQUAL, "Id", currentRecordId));
updateQuery.setParameterValue("YourColumnName", columnValue);
updateQuery.execute(callbackFunction, this);

 

Like 1

Like

Share

0 comments
Show all comments
knowledge base
SDK
Q&A
support

Question

In the [Contacts] section, I created a [Driver's documents] detail, the UsrSchema6Detail schema. I need to display it, if the selected job title is [Driver]. If the job title is different or not selected at all, the detail is hidden.

 I added a business rule to the contact schema, but it does not work.

rules: {
   "UsrSchema6Detail": {
      BindParametrVisibilePlaceByType: {
         // Rule type: BINDPARAMETER.
         ruleType: BusinessRuleModule.enums.RuleType.BINDPARAMETER,
         // Rule is regulated by the VISIBLE field value.
         property: BusinessRuleModule.enums.Property.VISIBLE,
         conditions: [{
            // Expression of the left part of the condition.
            leftExpression: {
               //The ATTRIBUTE expression type indicates, that
               // the view model attribute (column)acts as the expression.
               type: BusinessRuleModule.enums.ValueType.ATTRIBUTE,
               // Name of the view model column, whose value was compared in the expression.
               attribute: "Job"
            },
            // Compare operation type.
            comparisonType: Terrasoft.ComparisonType.EQUAL,
            // Expression of the right part of the condition.
            rightExpression: {
               type: BusinessRuleModule.enums.ValueType.CONSTANT,
               value: "703e34d6-4113-43b5-84dc-2e1f8635c6d4"
            }
         }]
      }
   }
}

If I apply this rule to the [Department] column, it works OK.

Answer

Using business rules is not a good solution for your business case.

Below is an example of code for hiding the [Communication options] detail on the edit page of an [Account]. Create the AccountPagev2 replacing module, the following code is added in the diff property:

{
    "operation": "merge",
    "name": "Communications",
    "values": {
        "visible" : {
            "bindTo": "communicationsVisibility"
        }
    }
}

Declare the method responsible for detail visibility in the methods property:

communicationsVisibility: function(){
    var type = this.get("Type");
    return !!type && type.displayValue === "Our company";
}

As a result, the detail will be visible only in case the type is specified as "Our company". You can hide any detail similarly.

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
knowledge base
SDK
Q&A
support

Question

How can I get a link to a picture added in the Images module section?

Answer

To receive the link to an image added into a module:

1. Add a dependency for the Terrasoft  library into define

2. Receive the picture config:

var imageConfig = resources.localizableImages.ImageListSchemaItem1;

The image name will be different.

3. Convert the config into a link:

var link = Terrasoft.ImageUrlBuilder.getUrl(imageConfig);

 

Like 0

Like

Share

0 comments
Show all comments