Question

How can we store URL (what should be the field?) and how can we make (if possible at all) this field clckable in the form?

Answer

You can store URL in a text field.

Add the following properties to values of the diff array element:

"showValueAsLink": true,
"href": {
        "bindTo": "UsrFieldName",
        "bindConfig": {"converter": "getUsrFieldNameLink"}
},
"controlConfig": {
        "className": "Terrasoft.TextEdit",
        "linkclick": { bindTo: "onUsrFieldNameLinkClick"}
}

UsrFieldName is the name of the field we want to display as a hyperlink.

Implement two methods that we bound to our field:

getUsrFieldNameLink: function(value) {
    return {
        "url": value,
        "caption": value
    };
},
onUsrFieldNameLinkClick: function(url) {
    if (url != null) {
        window.open(url, "_blank", "height=" + this.get("WindowHeight") + ",width=" + this.get("WindowWidth"));
        return false;
    }
}

Make sure the field value starts with http or https, otherwise the system will add application  path to the content. You can also analyze the value incoming parameter in the first method and add this prefix if needed.

A full example of the diff element:

{
    "operation": "insert",
    "name": "UsrURLpage22872546-f334-4b46-a445-112b532455c4",
    "values": {
        "layout": {
            "colSpan": 12,
            "rowSpan": 1,
            "column": 0,
            "row": 3,
            "layoutName": "Header"
        },
        "labelConfig": {},
        "enabled": true,
        "bindTo": "UsrURLpage",
        "showValueAsLink": true,
        "href": {
            "bindTo": "UsrURLpage",
            "bindConfig": {"converter": "getUsrURLpageLink"}
        },
        "controlConfig": {
            "className": "Terrasoft.TextEdit",
            "linkclick": { bindTo: "onUsrURLpageLinkClick"}
        }
    },
    "parentName": "Header",
    "propertyName": "items",
    "index": 6
}

 

Like 0

Like

Share

4 comments

How do you set the url and caption from different fields, so that it looks and functions like most links, which don't display the URL?

Janine White,

Please draw your attention to the "getUsrFieldNameLink" method. It is returning an object with two parameters, which are responsible for the caption and URL getUsrFieldNameLink. respectively. 

getUsrFieldNameLink: function(value) {
    return {
        "url": value,
        "caption": value
    };
},

The value of the caption is taken from the function argument. However, before returning an object, you can create a new variable and set its value to needed field. Afterwards, set caption parameter to the created variable.

Regards,

Anastasia

Hello,

how can I make same on Mobile Application? 

Found it



Show all comments

Question

The list of orders is not displayed correctly in the mobile app. How should I set up the application to sort the orders by registration date (the latest added order should be at the top)?

Answer

To sort by a specific column, you need to implement additional logic in the mobile app manifest. For example:

Terrasoft.sdk.GridPage.setOrderByColumns("Order", {
    column: "CreatedOn",
    orderType: Terrasoft.OrderTypes.DESC
});

This happens because there was no default sorting mechanism in this mobile application section. Below is an example:

 

- Add the “UsrTestOrderMobile” object with the required columns

- Register the detail in the detail wizard

- Add detail in the mobile application wizard

- Configure the sorting mechanism. Create a new custom schema, e.g., “UsrMobileUsrTestOrderMobileModuleConfig” with the following code:

Terrasoft.sdk.GridPage.setOrderByColumns("UsrTestOrderMobile", {
    column: "UsrName",
    orderType: Terrasoft.OrderTypes.DESC
});

- Save changes

- Connect it to the manifest in the “Models” section of the required “PagesExtensions” detail object

- clear the cache and re-synchronize (to get the most recent settings)

Important:



- make sure all the necessary columns are synchronized in the import settings (ModelDataImportConfig)



- make sure there was a primary column (which is used for sorting) for display in an object or at the code level (below is an example):

Terrasoft.sdk.GridPage.setPrimaryColumn("UsrTestOrderMobile", "UsrName");
Terrasoft.sdk.RecordPage.addColumn("UsrTestOrderMobile", {
        name: "UsrName",
        position: 1
    }, "primaryColumnSet");

 

Like 0

Like

Share

0 comments
Show all comments

Case

Added a custom "Project" field to the activity, which is required. Because of this, I can not now create an activity in the mobile application. Is it possible to fix this by leaving the “Project” field required?

Cause

Setting up fields in the [Mobile Application Wizard] for the Activities / Accounts sections does not work correctly. Fixed in the latest release versions.

Goal

Add a custom field to the Activity section for the mobile application.

Necessary conditions

Access to the system with administrator rights.

Solution

1. Update the system to the latest release version (released after 05/01/2015).

2. In the [Mobile Application Wizard] set up the appropriate columns.

During set up, it is important to:

1. Save the changes on the section page.

2. Save changes for the mobile application as a whole.

Like 0

Like

Share

0 comments
Show all comments

Symptoms

In the sales outlet card, when populating the "Delivery time from" and "Delivery time to" fields from a tablet, the time is converted to a different time zone during synchronization with a desktop application. For example, if you populate the fields with 17:00 and 18:00 respectively, the desktop app will display the time as 14:00 and 15:00. Moreover, once synchronized, the fields on the mobile app will display 14:00 and 15:00 as well.

Cause

Fixed in version 7.8

Solution

The fix (which avoids transferring any server changes from version 7.8) is provided below:

Step 1

Create the UsrSyncExtension ("Module" type) schema in a custom package.

Step 2

Add the following code to the schema:

var sysAdminUnitStore = Ext.create("Ext.data.Store", {model: "SysAdminUnit"});
sysAdminUnitStore.setProxy("odata");
sysAdminUnitStore.load({
    queryConfig: Ext.create("Terrasoft.QueryConfig", {
        modelName: "SysAdminUnit",
        autoSetProxy: false,
        columns: ["TimeZoneId"]
    }),
    filters: Ext.create("Terrasoft.Filter", {
        property: "Contact",
        value: Terrasoft.CurrentUserInfo.contactId
    }),
    callback: function(records, operation, success) {
        if (success === true && records.length > 0) {
            var firstRecord = records[0];
            var timeZoneCode = firstRecord.get("TimeZoneId");
            if (!Ext.isEmpty(timeZoneCode)) {
                var timeZoneStore = Ext.create("Ext.data.Store", {model: "TimeZone"});
                timeZoneStore.setProxy("odata");
                timeZoneStore.load({
                    queryConfig: Ext.create("Terrasoft.QueryConfig", {
                    modelName: "TimeZone",
                    autoSetProxy: false,
                    columns: ["Offset"]
                }),
                filters: Ext.create("Terrasoft.Filter", {
                    property: "Code",
                    value: timeZoneCode
                }),
                callback: function(timeZoneRecords, timeZoneOperation, timeZoneSuccess) {
                    if (timeZoneSuccess === true && timeZoneRecords.length > 0) {
                        var timeZoneRecord = timeZoneRecords[0];
                        var offset = timeZoneRecord.get("Offset");
                        var offsetValue = 0;
                        if (!Ext.isEmpty(offset)) {
                            offset = offset.replace("GMT", "");
                            if (!Ext.isEmpty(offset)) {
                                var sign = (offset.substring(0, 1) === "-") ? 1 : -1;
                                var hours = parseInt(offset.substr(1, 2));
                                var minutes = parseInt(offset.substr(4, 2));
                                offsetValue = sign * (hours * 60 + minutes);
                            }
                        }
                        Terrasoft.Configuration.CurrentUserTimeZoneOffset = offsetValue;
                    }
                },
                scope: this
            });
        }
    }
},
scope: this
});
 
if (!Terrasoft.Configuration.processColumn) {
                Terrasoft.Configuration.processColumn = Terrasoft.OData.ResponseParser.processColumn;
}
 
Terrasoft.OData.ResponseParser.processColumn = function(data, queryConfig, record, columnName) {
                var model = record.self;
                var columnConfig = model.ColumnConfigs.get(columnName);
                var columnValue = data[columnName];
                if ((columnConfig.columnType === Terrasoft.ColumnTypes.date ||
                               columnConfig.columnType === Terrasoft.ColumnTypes.datetime) &&
                               !Ext.isEmpty(Terrasoft.Configuration.CurrentUserTimeZoneOffset)) {
                               if (columnValue.indexOf("/") !== -1) {
                                               var timeZoneOffset = Terrasoft.Configuration.CurrentUserTimeZoneOffset;
                                               columnValue = new Date(parseInt(columnValue.substr(6)));
                                               columnValue = new Date(columnValue.getTime() + timeZoneOffset * 60 * 1000);
                               } else {
                                               columnValue = Terrasoft.util.convertISOStringToDate(columnValue);
                               }
                               record.set(columnName, columnValue);
                } else {
                               Ext.callback(Terrasoft.Configuration.processColumn, Terrasoft.OData.ResponseParser, arguments);
                }
};

Step 3

Add the manifest of the mobile application to the current package (the manifest of the corresponding workplace) and add the UsrSyncExtension schema to it (namely, add it to SyncExtensions and CustomSchemas):

"SyncExtensions": [
                               "UsrSyncExtension"
                ],
                "CustomSchemas": [
                               "UsrSyncExtension"
                ],

The code gets the current user's time zone from SysAdminUnit, and uses the received time zone during synchronization and input.

Like 0

Like

Share

0 comments
Show all comments

Question

When I select the necessary items, they are not displayed in the lookup, although I can retrieve them from this.get('ResponsibleLookUp').

Kindly advise how I can display them in the lookup for the user to see what he has selected.

Answer

Below is an example of a lookup with multiple choice, whose selection display is bound to the string, the selection key storage is bound to the array.

define("CasePage", ["CasePageResources", "terrasoft", "LookupUtilities"],
    function(resources, Terrasoft, LookupUtilities) {
        return {
            entitySchemaName: "Case",
            details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
            attributes: {
                "UsrVirtualCity": {
                    dataValueType: Terrasoft.DataValueType.TEXT,
                    type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN
                },
                "UsrVirtualCityArray": {
                    dataValueType: Terrasoft.DataValueType.CUSTOM_OBJECT,
                    type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN
                }
            },
            diff: /**SCHEMA_DIFF*/[
                {
                    "operation": "insert",
                    "name": "Number",
                    "values": {
                        "layout": { "colSpan": 24, "rowSpan": 1, "column": 0, "row": 4 },
                        "bindTo": "UsrVirtualCity",
                        "caption": "virtual city",
                        "controlConfig": {
                            "className": "Terrasoft.TextEdit",
                            "rightIconClasses": ["custom-right-item", "lookup-edit-right-icon"],
                            "rightIconClick": {
                                "bindTo": "testClick"
                            }
                        }
                    },
                    "parentName": "SolutionTab_gridLayout",
                    "propertyName": "items",
                    "index": 6
                }
            ]/**SCHEMA_DIFF*/,
            methods: {
                onEntityInitialized: function() {
                    this.callParent(arguments);
                    // just for debug:
                    document.scope = this;
                },
                testClick: function() {
                    var config = {
                        entitySchemaName: "City",
                        multiSelect: true
                    };
                    LookupUtilities.Open(this.sandbox, config, this.onTestClickComplete, this, null, false, false);
                },
                onTestClickComplete: function(cities) {
                    if (cities.selectedRows.getCount() > 0) {
                        var citiesItems = cities.selectedRows.getItems();
                        var displayValue = "";
                        for (var i = 0; i < citiesItems.length; i++) {
                            displayValue = displayValue + citiesItems[i].displayValue + "; ";
                        }
                        displayValue = displayValue.substring(0, displayValue.length - 2);
                        this.set("UsrVirtualCity", displayValue);
                        var citiesKeys = cities.selectedRows.getKeys();
                        this.set("UsrVirtualCityArray", citiesKeys);
                    }
                }
            },
            rules: {}
        };
});

 

Like 0

Like

Share

4 comments

Dear S.Kobizka,

This works fine but the data that are selected are not obtained when the right-Icon is pressed.. How can we re-pass the selected values to the lookup?

Plus, is there any idea on how to pass for the dropdown a filter? For example giving the lookup a countryId and then only the cities in this country will be shown..

Mohammad Yahfoufi,

Firstly, there is no currently an option to pass already selected items to the second lookup opening of lookup window. We will pass your suggestion on to the developers for them to take such option into consideration for future product updates.

Secondly, regarding filtration for the lookup. You can use business rules in the Section Wizard, so to specify the filtration rules. For example here I have specified exact country to filter my custom field by. You can set any other, which would suit your business task.

http://prntscr.com/mw8mb4

https://academy.bpmonline.com/documents/administration/7-13/business-ru…

Regards,

Anastasia

Anastasia Botezat,

Thank you for your reply. I noticed in Business Process that the selected items can be passed to the lookup but I couldnt follow up the code. Here is a sample:

Mohammad Yahfoufi,

This functionality was additionally developed specifically for the process design elements.

In case you decide to replicate this functionality, please take a look at ProcessLookupPageMixin and EntityColumnLookupPage schemas. Particularlly, DataGrid diff. It has an onclick event handler method, which updates selected entity column property "selected" to true. Therefore, next time you decide to select other columns, the columns having selected property on will be displayed. Though, this requires advanced development skills to implement such functionality.

Regards,

Anastasia

Show all comments

Question

It is necessary to open external access to bpm'online only for mobile application services.

Please specify which services the mobile application uses for its operation?

Answer

Integration is carried out through O'Data on the site port.

Services used by the mobile application in version 7.8.2:

http://server/ServiceModel/AuthService.svc

http://server/0/Services/ProfileService.asmx

http://server/0/Mobile/Services/MobileDataService.ashx

http://server/0/Mobile/Services/MobileCodeService.ashx

http://server/0/ServiceModel/EntityDataService.svc

The list of services in subsequent updates of the mobile application may be different.

Like 0

Like

Share

0 comments
Show all comments

Question

How is the [Origin] field set when a new case is created on the portal?

Answer

The origin setup is executed in PortalCasePage of the following method:

setPortalColumnValues: function() {
    if (this.isAddMode() || this.isCopyMode()) {
        if (this.Terrasoft.SysValue.CURRENT_USER_ACCOUNT.value !== this.Terrasoft.GUID_EMPTY) {
            this.set("Account", this.Terrasoft.SysValue.CURRENT_USER_ACCOUNT);
        }
        this.set("Contact", this.Terrasoft.SysValue.CURRENT_USER_CONTACT);
        this.Terrasoft.SysSettings.querySysSettingsItem("PortalCaseOriginDef", function(value) {
            this.set("Origin", value);
        }, this);
        this.set("Owner", null);
    }
}

As you can see from the code, the field value is determined by the "PortalCaseOriginDef" system setting ("Default portal case source").

Like 0

Like

Share

0 comments
Show all comments

Question

How to set up a filter in a mobile application so that the data is loaded only by a certain parameter (for example, only Opportunities at a certain stage)?

Answer

You must configure the following parameters:

LEADS: Only show leads with the LEAD STAGES: Registration and Qualification.

OPPORTUNITIES: Only show opportunities with the OPPS STAGES: Presentation, Proposal, Negotiation and Pending.

Use the following code (for Leads):

Terrasoft.sdk.Module.addFilter("Lead", Ext.create("Terrasoft.Filter", {
    type: Terrasoft.FilterTypes.Group,
    logicalOperation: Terrasoft.FilterLogicalOperations.Or,
    subfilters: [
        {
            property: "QualifyStatus",
            value: "d790a45d-03ff-4ddb-9dea-8087722c582c"
        },
        {
            property: "QualifyStatus",
            value: "14cfc644-e3ed-497e-8279-ed4319bb8093"
        }
    ]
}));

First, we need to create new modules with a filtering code separately for Leads, and separately for Opportunities:

Then, in the configuration, select a workplace (if you have several) to which we will apply the filter, in our case MobileApplicationManifestOn_the_Road

We need to add created modules with filters in those sections that include filters, in this case in Lead and Opportunity in PageExtentions:

Save.

Like 0

Like

Share

2 comments

Code helped me. But If I search with other status(other than statuses mentioned in subfilters) in Lead, records do not list. For by On load this subfilters should work. But if I search with other than status , those also should list upon searching.

Is it possible. Please help me

Sriraksha KS,

If I understood you correctly, you want the subfilters, which described above to be displayed when you click on quick filter option on the section.

Unfortunately, there is no way to transfer the on load filters to the quick filters. If using on load filters, the records will be initially filtered and quick filters would be added to them.

In case I have misunderstood your task, please describe it more detailed, a screenshot would be appreciated.

Regards,

Anastasia

Show all comments

Question

I can't sync my Customer Engagement Center demo site with mobile application. The error I am getting contains - },"requestId":20,"status":200,"statusText":"OK","responseText":"{\"Code\":1,\"Message\":\"Either invalid login or password specified, or your user account is inactive.Verify that you have entered correct data or contact support service.\"

Answer

For bpm'online 7.5 mobile application is available in Sales editions (Team, Commerce, Enterprise, Omnichannel) only.

Like 0

Like

Share

0 comments
Show all comments

Question

How to sort records by date of modification in EntitySchemaQuery?

Answer

If the question concerns client logic, sorting can be set as follows:

var entitySchemaQuery = Ext.create("Terrasoft.EntitySchemaQuery", {
        rootSchemaName: entitySchemaName
});
var modifiedOnColumn = entitySchemaQuery.addColumn("ModifiedOn", "ModifiedOn");
modifiedOnColumn.orderPosition = 0;
modifiedOnColumn.orderDirection = Terrasoft.OrderDirection.ASC;
...

For the server logic:

var query = new EntitySchemaQuery(entitySchema);
var modifiedOnColumn = query.AddColumn("ModifiedOn");
modifiedOnColumn.OrderByAsc(0);
...

 

Like 1

Like

Share

0 comments
Show all comments