Question

How to add a standard detail to a mobile application and display a specific column in it?

Answer

1. Go to the "Mobile application wizard" (/0/Nui/ViewModule.aspx#SectionModuleV2/SysMobileWorkplaceSection)

2.  Open the required workplace ("DefaultWorkplace" by default) and click the "Set up sections" button.

3. Select the desired section, for example, "Contacts", and press the "Details setup" button

4. Add a detail:

5. Go to the "Configuration" section (/0/WorkspaceExplorerModule.aspx)

6. Add a new "Module" schema type with the name "UsrContactCareerModuleConfig"

7. Write a similar code:

Terrasoft.sdk.GridPage.setPrimaryColumn("ContactCareer", "JobTitle");
Terrasoft.sdk.RecordPage.addColumn("ContactCareer", {
        name: "JobTitle",
        position: 1
    }, "primaryColumnSet");
Terrasoft.sdk.RecordPage.removeColumn("ContactCareer", "Contact", "primaryColumnSet");

Where ContactCareer is the name of the table that corresponds to our detail;

JobTitle - the name of the column you want to display

8. Connect this schema in the "MobileApplicationManifestDefaultWorkplace" mobile application manifest: Find the block of the ContactCareer model and add our UsrContactCareerModuleConfig module to PagesExtensions.

Like that:

 

 

Like 0

Like

Share

0 comments
Show all comments

Symptoms

Bpm'online mobile bug report:

Type: Terrasoft.ServerException

Message: Request for server returned error

Additional info:

{"request":{"id":4,"headers":{"X-Terrasoft-Mobile":"true","Accept":"application/json","Content-Type":"application/json","Authorization":"Cookie","X-Requested-With":"XMLHttpRequest"},"options":{"url":"http://xxxxx.xxxxxxx.xxxxx/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://xxxxx.xxxxxxx.xxxxx/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},"performanceCounterKey":"86e101ce-533b-4802-941b-56bf73c7b609"}},"async":true},"requestId":4,"status":500,"statusText":"Internal Server Error","responseText":"{\r\n  \"Code\": -1,\r\n  \"Exception\": \"Terrasoft.Core.LicException: The license has expired or inactive\\r\\n  at Terrasoft.Core.UserConnection.CheckLicense()\\r\\n  at Terrasoft.Core.UserConnection.InitializeCurrentUser(String userName, TimeZoneInfo timeZone, String clientIP, String agent, Boolean logSessionStart)\\r\\n  at Terrasoft.Core.UserConnectionFactory.CreateUserConnection(AppConnection appConnection, AuthData authData, String sessionId, String clientIP, String agent, Boolean checkPasswordExpiry)\\r\\n  at Terrasoft.Web.Common.SessionHelper.RecreateUserConnection(AuthData authData)\"\r\n}","responseXML":null,"responseBytes":null}

Cause

The user does not have an active license.

Solution

For correct authorization in the mobile application, it is necessary to distribute the license to the user.

Like 0

Like

Share

0 comments
Show all comments

Question

How do views work in a mobile application? When importing data in offline mode, views are saved to the database as regular tables. It is necessary to filter the field for which the lookup is a view. The view uses records from two sections (Accounts and a custom Construction Objects section). It turns out that when a new account is added in the desktop version, it shows up in the view and can be filtered by it. When creating a new account in the offline mode of the mobile application in the view, it shows up only after synchronization, which complicates the user's experience. As far as I understand, SQL-Lite has the ability to work with views. Is it possible to implement the functionality of views?

Bpm'online application version 7.9.2 2410. Mobile application version 7.11.7.

Answer

SQLite has the ability to create a view. To do this, you need to run the script to create a view in the configuration module. Create the module itself and add it to the manifest in the CustomSchemas block.

Code example:

var sqls = [“CREATE VIEW IF NOT EXISTS AccountView (Id, Name) AS  SELECT Id, Name FROM Account”];
Terrasoft.Sql.DBExecutor.executeSql({
   isCancelable: false,
   sqls: sqls,
   success: function() {},
   failure: function() {}
});

It will be quite difficult to implement filtering by view in the card, so you will still have to write a custom business rule that will make a request for the view.

By default, we do not work with SQLite views. It makes no sense, because the representation in MSSQL or Oracle may not be the same as the SQLite implementation. A view in a mobile application is a regular table, therefore you need to work with it accordingly.

This means that if you want a value to appear there, you should add it. To do this, you can implement business rules for the “Account” and “Construction Objects” objects, so that when adding or updating a record, a copy of this record will be made in the desired view.

Like 0

Like

Share

0 comments
Show all comments

Question

By default, the mobile application wizard allows you to add only two fields to the section list.

Is it possible to increase the number of displayed fields?

Answer

The list can show not only the displayed columns but also display values generated based on the values of several columns. If complex formatting is used, or if it required to display different values depending on certain conditions, column values can be specified as functions (using the Terrasoft.sdk.GridPage.setPrimaryColumn() and Terrasoft.sdk.GridPage.setSecondaryColumn() methods):

Terrasoft.sdk.GridPage.setPrimaryColumn('Account', {
	columns: ['Name', 'PrimaryContact'],
	convertFunction: function(values) {
		if (!Ext.isEmpty(values.PrimaryContact)) {
			return values.Name + ' (' + values.PrimaryContact + ')';
		} else {
			return values.Name;
		}
	}
});

You can also specify additional columns when selecting the value of the lookup field. This is done similarly to a grid, but only the Terrasoft.sdk.LookupGridPage class is used:

Terrasoft.sdk.LookupGridPage.setSecondaryColumn ("Account", "PrimaryContact");

The alternative option for expanding the capabilities of the grid is to change the template of the grid elements:

Terrasoft.util.writeStyles(
	".div-table {",
		"display:table;",
		"width:100%;",
	"}",
	".div-table-row {",
		"display:table-row;",
		"width:100%;",
		"clear:both;",
	"}",
	".div-table-col {",
		"float:left;",
		"display:table-column;",
		"min-width:50%;",
	"}",
	".div-table-col-button {",
		"float:right;",
		"display:table-column;",
	"}"
);
Ext.define("MyCustomList", {
	override: "Ext.Terrasoft.List",
 
	initializeItemTpl: function() {
		this.callParent(arguments);
		var store = this.getStore();
		var model = store.getModel();
		var modelName = model.getName();
		if (modelName === "Account") {
			var tpl = this.getItemTpl();
			tpl.html =
			"<div class=\"x-list-item-tpl div-table\">" +
				"<div class=\"div-table-row\">" +
					"<div class=\"div-table-col\">{[this.applyPrimaryColumn(values)]}</div>" +
					"<div class=\"div-table-col-button\">{Phone}</div>" +
				"</div>" +
				"<div class=\"div-table-row\">" +
					"<div class=\"div-table-col\">{[this.applySecondaryColumn(values)]}</div>" +
					"<div class=\"div-table-col-button\">{Web}</div>" +
				"</div>" +
			"</div>";
		}
	}
 
});

 

Like 0

Like

Share

0 comments
Show all comments

Symptoms

Bpm'online mobile bug report

Type: Terrasoft.SourceCodeException

Message: TypeError: undefined is not an object (evaluating 'columnConfig.columnType')

Cause

The error occurs due to the fact that you have not configured the parameters of the embedded details correctly, e.g., in the "Leads" section.

Solution

You have to correctly configure all the details. For example, to set up the “Files and Attachments” detail in the “Leads” section:

- To display the details in the mobile application, you must select the “Lead attachments” detail

- Select "Lead" in the "Detail column" field

- In the “Object column” field specify “Id”

Like 0

Like

Share

0 comments
Show all comments

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