Question

How can I add a button in the Communication Panel?

Answer

1. Replace the "CommunicationPanel" module, where the new button will be described.

define("CommunicationPanel", ["terrasoft", "CommunicationPanelHelper"],
	function(Terrasoft, CommunicationPanelHelper) {
		return {
			messages: {
				"SelectCommunicationPanelItem": {
					"mode": Terrasoft.MessageMode.PTP,
					"direction": Terrasoft.MessageDirectionType.SUBSCRIBE
				}
			},
			attributes: {
				"UsrMyMenuActive": {
					"dataValueType": Terrasoft.DataValueType.BOOLEAN,
					"type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
					"value": false
				},
				"UsrMyMenuCounter": {
					"dataValueType": Terrasoft.DataValueType.TEXT,
					"type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
					"value": ""
				},
				"UsrMyMenuVisible": {
					"dataValueType": Terrasoft.DataValueType.BOOLEAN,
					"type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
					"value": true
				}
			},
			methods: {
				getPanelItemConfig: function(moduleName) {
					var config = this.callParent(arguments);
					if (moduleName !== "UsrMyMenuModule") {
						return config;
					}
					return Ext.apply(config, {
						keepAlive: false
					});
				},
				selectItem: function(config) {
					this.set("SelectedMenuItem", config.selectedItem);
				},
				getUsrMyMenuImageConfig: function(itemTag) {
					return this.get("Resources.Images.VisaMenuIcon");
				},
				getUsrMyMenuCaption: function(itemTag) {
					return "test";
				}
			},
			diff: [
				{
					"operation": "insert",
					"index": 0,
					"parentName": "communicationPanelContent",
					"propertyName": "items",
					"name": "usrMyMenu",
					"values": {
						"tag": "UsrMyMenu",
						"visible": {"bindTo": "UsrMyMenuVisible"},
						"imageConfig": {"bindTo": "getUsrMyMenuImageConfig"},
						"caption": {"bindTo": "getUsrMyMenuCaption"},
						"generator": "CommunicationPanelHelper.generateMenuItem"
					}
				}
			]
		};
	});

2. Create the panel module. The module should contain required messages, as in ESNFeedModule:

RerenderModule – subscription, address.

InitModuleViewModel – subscription, address.

	Ext.define("Terrasoft.configuration.UsrMyMenuModule", {
 
		extend: "Terrasoft.BaseSchemaModule",
		alternateClassName: "Terrasoft.UsrMyMenuModule",
 
		generateViewContainerId: false,
 
		initSchemaName: function() {
			this.schemaName = "UsrMyMenu";
		},
 
		initHistoryState: Terrasoft.emptyFn,
 
		init: function() {
			this.callParent(arguments);
			this.initMessages();
		},
 
		initMessages: function() {
			this.sandbox.subscribe("RerenderModule", function(config) {
				if (this.viewModel) {
					this.render(this.Ext.get(config.renderTo));
					return true;
				}
			}, this, [this.sandbox.id]);
		},
 
		createViewModel: function() {
			var viewModel = this.callParent(arguments);
			return viewModel;
		}
 
	});
	return Terrasoft.UsrMyMenuModule;
});

3. Create the page view schema

define("UsrMyMenu", [], function() {
		return {
			mixins: {
			},
			messages: {
			},
			attributes: {
			},
			methods: {
				init: function(callback, scope) {
					this.callParent([function() {
						callback.call(scope);
					}, this]);
				},
				onTestClick: function() {
					alert(1);
				}
			},
			diff: [
				//MyMenu
				{
					"operation": "insert",
					"name": "MyMenu",
					"propertyName": "items",
					"values": {
						"generateId": false,
						"itemType": Terrasoft.ViewItemType.CONTAINER,
						"items": []
					}
				},
				//ShowNewMessagesButton
				{
					"operation": "insert",
					"name": "ShowNewMessagesButton",
					"parentName": "MyMenu",
					"propertyName": "items",
					"values": {
						"generateId": false,
						"itemType": Terrasoft.ViewItemType.BUTTON,
						"caption": "Test!",
						"click": {bindTo: "onTestClick"}
					}
				}
			]
		};
	});

 

Like 1

Like

Share

2 comments

I have tried adding this code but did not got any such button in the communication panel. Can you guide through the way to it?

Siddharth Miglani,

Hello,

We recommend using freedom UI components and the button element: https://academy.creatio.com/docs/8.x/no-code-customization/customization-tools/ui-and-business-logic-customization/element-setup-examples/components/set-up-button-components
You can add a custom button to the page via the OOTB tools without dev tools.

Show all comments

Question

How to quickly generate a page code for a mobile application.

Can be used for:

  • Edit
  • Grid
  • Preview

Answer

Run the following code in the emulator browser console:

(new Terrasoft.CodeGeneration.PageCodeGenerator({
    modelName: "Contact", 
    pageType: Terrasoft.PageTypes.Edit
})).generate()

In modelName, specify the desired object.

In pageType, specify the page type:

pageType: Terrasoft.PageTypes.Grid
pageType: Terrasoft.PageTypes.Edit
pageType: Terrasoft.PageTypes.Preview

The result is:

Terrasoft.LastLoadedPageData = {
    controllerName: "Terrasoft.configuration.ContactEditPageController",
    viewXClass: "Terrasoft.configuration.ContactEditPageView"
};
 
Ext.define("Terrasoft.configuration.view.ContactEditPage", {
    extend: "Terrasoft.view.BaseEditPage",
    alternateClassName: "Terrasoft.configuration.ContactEditPageView",
    config: {
        id: "ContactEditPage"
    }
});
 
Ext.define("Terrasoft.configuration.controller.ContactEditPage", {
    extend: "Terrasoft.controller.BaseEditPage",
    alternateClassName: "Terrasoft.configuration.ContactEditPageController",
    statics: {
        Model: Contact
    },
    config: {
        refs: {
            view: "#ContactEditPage"
        }
    }
});

 

Like 0

Like

Share

0 comments
Show all comments

Symptoms

Bug mobile report:

Type: Terrasoft.SyncException 
Message: Error during synchronization
Stack trace: 
 
Type: Terrasoft.FileException 
Message: An error occured during the file writing process
AdditionalInfo: Name: BPMonline700/Downloads/6005bfc5-5ea7-42da-82e6-15f5f4c9e80a/invoice for payment #6.pdf
 
Type: Terrasoft.FileSystemException 
Message: undefined 
AdditionalInfo: Code: undefined 
Data: 4 
Model Name: iPhone8,2 (0x0)
Platform: iOS
Platform Version: 9.2.1
IsOnlineMode: false
UIVersion: 2
ApplicationVersion: 7.7.8
ApplicationMajorVersion: 7.7
ContactId: c41b4784-a414-438c-a846-c5bf418f0056
CultureName: en-US
ApplicationRevision: 0
BackgroundSyncMode: 3
WorkplaceCode: DefaultWorkplace

Cause

This error occurs due to the fact the file on the “Attachments” detail incudes a special character in its name (for example, the "#" symbol) - the iOS platform restricts the use of special characters when sending requests/files.

Solution

Rename the file and remove the “#” symbol. To do this, either:

- find the file and rename it manually;

- Find the parent object in the database using its ID (for example, «6005bfc5-5ea7-42da-82e6-15f5f4c9e80a») and determine its exact location in the application. Either use the database tools to rename it, or rename the located file on the application level. The following script can be used to locate the object in which the file is stored on the database:

-- Incoming parameters - coulmn name and value:
DECLARE @COLUMN_NAME NVarChar(100) = 'Id'
DECLARE @COLUMN_VALUE NVarChar(100) = '6005bfc5-5ea7-42da-82e6-15f5f4c9e80a'
DECLARE @tableName VARCHAR(50)
DECLARE tablesCursor CURSOR LOCAL FORWARD_ONLY STATIC FOR
    -- The request returns the names of the database tables which include the @COLUMN_VALUE column:
    SELECT table_name = sysobjects.name
    FROM sysobjects
    JOIN syscolumns ON sysobjects.id = syscolumns.id         
    WHERE sysobjects.xtype='U'
    and syscolumns.name = @COLUMN_NAME
OPEN tablesCursor
FETCH NEXT FROM tablesCursor INTO @tableName
WHILE @@FETCH_STATUS = 0
BEGIN  
    -- If a table @COLUMN_NAME has a @COLUMN_VALUE value -
    -- display the table name, query, and the number of rows in the EXEC request ('DECLARE @recordCount INT;
        DECLARE @quotesChar CHAR = char(39);
        DECLARE @tabChar CHAR = char(9);
        BEGIN TRY
            SET @recordCount =
                (SELECT COUNT(*)
                FROM [' + @tableName + '] where ' + @COLUMN_NAME + ' = ''' + @COLUMN_VALUE + ''')
                IF @recordCount > 0
                    BEGIN                                                 
                        PRINT ''''
                        PRINT ''-- ' + @tableName + ':''
                        PRINT ''     SELECT * FROM ' + @tableName + ' WHERE ' + @COLUMN_NAME + ' = '' + @quotesChar + ''' + @COLUMN_VALUE + ''' + @quotesChar + ''''                                          
                        PRINT ''     -- Number of rows in request: '' + CAST(@recordCount as VARCHAR(5))
                    END
        END TRY        
        BEGIN CATCH                                   
        END CATCH;                      
    '); FETCH NEXT FROM tablesCursor INTO @tableName END CLOSE tablesCursor DEALLOCATE tablesCursor

 

Like 0

Like

Share

0 comments
Show all comments

Symptoms

"Online help" does not work. The following error is displayed:

The error occurs when, e.g., trying to access Customer Engagement Centre in 7.7., which is now Customer Centre, the document is thus not found.

Cause

The "Product" or "Configuration version" system settings are incorrect.

Solution

Change the "Product" system setting value (write the correct name of the used bpm'online product).

Make sure, that the "Configuration version" system setting has the "7.7.0" version value.

Like 0

Like

Share

0 comments
Show all comments

Question

I have the "Automatic Synchronization - Only through Wifi" enabled in the mobile app. How often does automatic data synchronization occur?

Answer

Each time the application is minimized, it synchronizes after 30 seconds. And if the user activates the application again, the synchronization stops.

Note. Due to the specifics of the iOS operating system, it can stop all processes in the background in about 3 minutes, i.e., if the synchronization did not occur in the background, then it actually did not occur at all. 

Like 0

Like

Share

0 comments
Show all comments

Question

How can I add a button to the detail list for an active string?

Answer

You can implement this as follows:

In the script of a detail, to the diff block, add additional properties to DataGrid (the button name and caption are provided as an example):

{
        "operation": "merge",
        "name": "DataGrid",
        "values": {
                "activeRowAction": {"bindTo": "onActiveRowAction"},
                "activeRowActions": [
                        {
                                "className": "Terrasoft.Button",
                                "style":this.Terrasoft.controls.ButtonEnums.style.BLUE,
                                "markerValue": "myButtonAction",
                                "tag": "myAction",
                                "caption": "MyButton"
                        }
                ]
        }
}

After this, when you highlight the active string in the detail, a blue button with the "MyButton" caption should appear.

You can add several buttons to the activeRowActions array, they all will be displayed in the highllighted string as you can see it work in the section list.

Afterwards, implement the onActiveRowAction method in the methods of the same detail. This method takes the button tag and the key column value of the highlighted string as arguments. If you need to receive any other values of the highlighted string, you can call the this.getActiveRow() method, which returns the whole model of the highlighted string:

methods: {
        onActiveRowAction: function(buttonTag, primaryColumnValue) {
                if (buttonTag === "myAction") {
                        // the whole code below can be removed, it demonstrates that the
                        // primaryColumnValue and activeRowId values are equal
                        var activeRow = this.getActiveRow();
                        var activeRowId = activeRow.get("Id");
                        console.log(primaryColumnValue);
                        console.log(activeRowId);
                        // your implementation follows here
                        ...
                }
        },
        ...
}

 

Like 1

Like

Share

0 comments
Show all comments

Question

The user creates a visit in the mobile application and syncs. Then removes a visit to the web version of the app.

The user is synchronized in the mobile application, visits are not deleted. User clears the cache - visits are deleted.

Is it possible to synchronize (to delete the records already deleted in the web version) without clearing the cache?

Answer

The mobile application does not implement the termination of deleted records in the desktop application. This is explained by the fact that no logging is performed by default on the server; accordingly, the mobile application does not know that the termination has occurred.

If you want to terminate the records, then you need to enable an additional option in the manifest for the necessary models (for example, the Activity model):

{
   "SyncOptions": {
      "ModelDataImportConfig": [
         {
            "Name": "Activity",
            "IsAdministratedByRights": true
         }
      ]
   }
}

This option adds an additional step to the synchronization, in which the sample of data from the server is selected and compared with the sample of the data in the mobile application.

All "extra" records will be deleted, and the synchronization time might increase (depending on the number of records).

Like 0

Like

Share

0 comments
Show all comments

Symptoms

Error while loading the presentation.

Type: Terrasoft.FileException

Message: Error while reading the file

Additional information:

Name: https://ourcompany.bpmonline.com/0/ServiceModel/EntityDataService.svc/ActivityFileCollection(guid'71fff37b-3e84-4042-a7bb-ec1b49876e1b')/Data?ForceUseSession=true&X-Terrasoft-Mobile=true

Call chain:

failure@file:///var/mobile/Applications/12072E52-5AC6-48DB-B608-A61D72AA7758/Documents/BPMonline700/AppStructure/rev_1/src/MobileUtilities.js?hash=b1e737c2-e66b-4a95-b823-bab46756b5b5:278:38

callback@file:///var/mobile/Applications/12072E52-5AC6-48DB-B608-A61D72AA7758/bpm'online.app/www/appV1/Common/lib/SenchaTouch/sencha-touch-all-debug.js:10397:31

Terrasoft.File.callFailure@file:///var/mobile/Applications/12072E52-5AC6-48DB-B608-A61D72AA7758/bpm'online.app/www/appV1/Common/Terrasoft.Mobile.Combined.js:4418:16

failure@file:///var/mobile/Applications/12072E52-5AC6-48DB-B608-A61D72AA7758/bpm'online.app/www/appV1/Common/Terrasoft.Mobile.Combined.js:4463:20

callback@file:///var/mobile/Applications/12072E52-5AC6-48DB-B608-A61D72AA7758/bpm'online.app/www/appV1/Common/lib/SenchaTouch/sencha-touch-all-debug.js:10397:31

file:///var/mobile/Applications/12072E52-5AC6-48DB-B608-A61D72AA7758/bpm'online.app/www/appV1/Common/Terrasoft.Mobile.Combined.js:4788:18

file:///var/mobile/Applications/12072E52-5AC6-48DB-B608-A61D72AA7758/bpm'online.app/www/plugins/org.apache.cordova.file/www/DirectoryEntry.js:112:22

callbackFromNative@file:///var/mobile/Applications/12072E52-5AC6-48DB-B608-A61D72AA7758/bpm'online.app/www/cordova.js:288:57

file:///var/mobile/Applications/12072E52-5AC6-48DB-B608-A61D72AA7758/bpm'online.app/www/cordova.js:1098:35

nativeEvalAndFetch@file:///var/mobile/Applications/12072E52-5AC6-48DB-B608-A61D72AA7758/bpm'online.app/www/cordova.js:1106:13

nativeCallback@file:///var/mobile/Applications/12072E52-5AC6-48DB-B608-A61D72AA7758/bpm'online.app/www/cordova.js:1095:38

global code@file:///var/mobile/Applications/12072E52-5AC6-48DB-B608-A61D72AA7758/bpm'online.app/www/appV1/MobileApp/MobileMainPage.html:1:47

Type: Terrasoft.FileSystemException

Message: URL to the object is incorrectly formed

Additional information:

Code: 5

Data: {

"code": 5

}

Cause

Bpm'online does not support working with files that contain the slash symbol (“/”) in the title. Since a link to a knowledge base article is, in fact, a link to a file, the application ignored this link and did not load anything locally.

Solution

What needs to be done:

- Rename the necessary knowledge base article;

Like 0

Like

Share

0 comments
Show all comments

Question

Contact search does not work, if I enter the first name and the last name in the order that differs from the database order..

Answer

The search by the [Full name] field is performed based on comparing strings. If you change the order of the first name and the last name, the string will be absolutely different and bpm'online will not be able to identify it as the initial contact. Besides, depending on the above mentioned order of the first and last names in the [Full name] field as well as in some system settings, bpm'online automatically populates contact fields that correspond to the first and last names separately.

If you are not sure what the order of the first and last names of a contact is, you can leave only the first or the last name in the serach string with adding the "%" character in front of the name. In this case, bom'online will search for all the strings that start with or contain the specified value. For example, if you specify the "%Best" value in the search field, bpm'online will display the "John Best" and "Best John" contacts (if such contacts are available in the database).

You can also select the "First name" or "Last name" field as a search parameter.

Like 0

Like

Share

0 comments
Show all comments

Question

How do I hide the "Dashboards" section in the mobile app?

Answer

Create a custom schems (Source Code) (for example, "MobileUtilitiesCustom")

/* Hiding the "Dashboards" section */
 
Terrasoft.ApplicationUtils.initializeSystemData({
    success: function() {
        Terrasoft.ApplicationConfig.moduleGroups.get("sales").modules.splice(0, 1);
    }
});

In the mobile application manifest (for example, "UsrMobileApplicationManifestCustomMobile") specify the custom schema

{
    "CustomSchemas": [
        "MobileUtilitiesCustom"
    ]
}

 

Like 0

Like

Share

0 comments
Show all comments