Question

When I paste a RICH_TEXT element, its toolbar looks as follows:

Could you clarify what might be wrong with it?

Answer

The reason might be that some of the base styles  in your configuration might be overridden, e.g., the .t-btn-image style.

Like 0

Like

Share

0 comments
Show all comments

Case

We need to create users of an "Our company" type for the employees of any company, and not only for those belonging to the "Our company" that exists out-of-the-box.

Solution

Change the PrepareEmployeeEditFilter method in the UserEditPage  schema as follows:

var filters = e.Filters;
filters.Add(new Dictionary<string, object> {
    {"comparisonType", FilterComparisonType.Equal},
    {"leftExpressionColumnPath", "[SysAdminUnit:Contact].Id"},
    {"aggregationType", AggregationTypeStrict.Count},
    {"useDisplayValue", false},
    {"rightExpressionParameterValues", new object[] {0}}});
filters.Add(new Dictionary<string, object> {
    {"comparisonType", FilterComparisonType.Equal},
    {"leftExpressionColumnPath", "Account.Type"},
    {"useDisplayValue", false},
    {"rightExpressionParameterValues", new object[] { new Guid("57412fad-53e6-df11-971b-001d60e938c6")}}});
e.ParametersValue.Add("hideButtons", true);

where "57412fad-53e6-df11-971b-001d60e938c6" is the ID of the AccountType table that corresponds to the "Our company" value.

Necessary conditions

For version 7.4 only

Like 0

Like

Share

0 comments
Show all comments

Question

When creating a case through the portal, the user sets the case Assignee using a code. Though, the [Assignee] field remains blank after saving the record.

Answer

When you save a Case object (the Portal package), you basically run the event sub-process defined in the CaseInserting event of the object. If you meet the UserType = SSP condition in this process,  the [Assignee] field is cleared.

Like 1

Like

Share

0 comments
Show all comments

Case

I need to create a widget

Solution

You can use widgets to display data from in-built modules. It enables displaying data in non-standard views.

Example of implementing a widget:

define('SxClientUnitTable', ['ext-base', 'terrasoft', 'sandbox', "BaseFiltersGenerateModule", 'SxClientUnitTableResources', "ChartModuleHelper", "css!SxClientUnitTableCss", "ServiceHelper"],
	function(Ext, Terrasoft, sandbox, BaseFiltersGenerateModule, resources, ChartModuleHelper, css, ServiceHelper, ConfigurationConstants) {
 
		function getViewModel() {
					return Ext.create('Terrasoft.BaseViewModel', {
				//todo SysModuleAnalyticsChart deleted
						entitySchema: 'Order',
						methods: {
							getChart: function(key) {
							debugger
								sandbox.publish('GenerateChart', key);
								var filters = this.getReportFilters();
							},
							load: function() {
 
							}
						}
					});
				};
		var result = "";
		function generateMainView(renderTo) {
 
			var resultConfig = Ext.create('Terrasoft.Container', {
				id: 'tableOtchetMetkiParamContainer',
				selectors: {
					wrapEl: '#tableOtchetMetkiParamContainer'
				},
				renderTo: renderTo
			});
			return resultConfig;
		}
		function getInfoMetki(parameters) {
 
			var serviceData = {
				site: parameters[0].toString(),
				ownerId: parameters[1].toString(),
				startDate: parameters[2].toString(),
				dueDate: parameters[3].toString(),
				countryId: parameters[4].toString()
			};
 
			ServiceHelper.callService("UsrOtchetMetkiGetCollectionConfigurationService", "GetCollectionOtchetMetki",
				function (response) {
				debugger
					if (response.status == 404) {
						this.showInformationDialog("\t Error: \n" + response.message);
					}
					else if(response.GetCollectionOtchetMetkiResult.length > 0){
						result = response.GetCollectionOtchetMetkiResult;
						var arrR = result.split(":");
						var htmlAdded = "<table><tr><th>Mark</th><th>Number of orders</th><th>Being specified</th><th>% Specified.</th><th>Confirmed</th><th>% Conf.</th><th>Completed</th><th>% Compl.</th><th>Canceled</th><th>% Canc.</th></tr>";
						for(var i = 0; i < arrR.length - 1; i++){
							//get items
							var strArr = arrR[i].split(" ");
							var metkaOne = strArr[0].replace("{","");
							var metka = metkaOne.replace("}","");
 
							htmlAdded += "<tr><td>" + metka + "</td><td>" + strArr[1].toString() + "</td><td>"  + strArr[2].toString() + "</td><td>" + strArr[3].toString() + "</td><td>" + strArr[4].toString() + "</td><td>" + strArr[5].toString() + "</td><td>" + strArr[6].toString() + "</td><td>" + strArr[7].toString() + "</td><td>"  + strArr[8].toString() + "</td><td>" + strArr[9].toString() + "</td></tr>";
						}
						//end table
						htmlAdded += "</table>";
						var el = Ext.get('tableOtchetMetkiParamContainer').setHTML(htmlAdded);
						var elemV = Ext.get('Module1');
						elemV.toggleCls('my-table');
					}
					else
						result = null;
				}, serviceData, this);
		}
		function getReplaceString(str, separator){
		debugger
		var arSt = str.split(separator);
			var res = arSt[2] + separator + arSt[1] + separator + arSt[0];
			while(res.indexOf(separator) > 0){
				res = res.replace(separator,"-");
			}
			return res;
		}
 
		var render = function(renderTo) {
 
 
			debugger
			var viewConfig = generateMainView(renderTo);
			var viewModel = getViewModel();
			var getStartD = Ext.get("fixedFilterDateView-wrap").dom.innerText;
			var getEndD = Ext.get("fixedFilterDateDueView-wrap").dom.innerText;
 
			var startD = getStartD.indexOf("Начало") > 0 ? "2016-05-01" : getReplaceString(getStartD, ".");
			var endD = getEndD.indexOf("Завершение") > 0 ? "2016-07-04" : getReplaceString(getEndD, ".");
			var ar = [];
			ar.push("all");
			ar.push("all");
			ar.push(startD);
			ar.push(endD);
			ar.push("a570b005-e8bb-df11-b00f-001d60e938c6");
			getInfoMetki(ar);
 
 
			viewConfig.bind(viewModel);
			//viewConfig.render(renderTo);
		};
		return {
			schema: 'Order',
			methods: {
				onLookupChange: function(newValue, columnName) {
 
                                this.callParent(arguments);
                                if (columnName === "UsrCityFilter") {
                                        this.set("UsrCityFilter", newValue);
                                        this.onUsrCityFilterChanged();
                                }
                        },
 
                        onUsrCityFilterChanged: function() {
                                this.reloadGridData();
                        },
				getOrdersForFilter: function(){
					var items = [];
					var selOrders = Ext.create("Terrasoft.EntitySchemaQuery", {
						rootSchemaName: "Order"
					});
					selOrders.addColumn("SxMark.Name");
					selOrders.addColumn("SxCountry.Name");
					var filterByUser = Terrasoft.createColumnFilterWithParameter(
					Terrasoft.ComparisonType.EQUAL, "SxCountry.Name", "Россия");
					selOrders.filters.addItem(filterByUser);
					selOrders.getEntityCollection(function (response) {
					debugger
						if (response.collection.collection.length > 0)
							items = result.collection.getItems();
						else
							items = null;
					}, this);
					return items;
				}
 
			},
			userCode: function() {
 
			},
			init: function() {
 
			},
			filterChanged: function( filter, eOpts ){
				debugger
				var c = [];
			},
			render: render
		};
	}
)
;

 

 

Like 0

Like

Share

0 comments
Show all comments

Case

Access to section disappeared for all users, except for the Supervisor. Standard script for granting access permissions works but does not add records.

Solution

The [CreatedById] field in the user's database table is not populated. To solve the issue, populate the field and specify "Supervisor" as a creator:

Update Account --change the object
SET CreatedById = (SELECT id FROM Contact c WHERE c.Name = 'Supervisor')
where CreatedById is null;

 

Like 0

Like

Share

0 comments
Show all comments

Question

We cannot add contacts. The page freezes when doing so.

Answer

The details "Detail: Contact address" and "Detail: Contact communication options" have been deleted from the contact page. That is the reason why you cannot add new contacts.

Restore the details and you will receive no errors.

To do this, add the below code to the ContactPageV2 schema:

details: {
    "AccountAddress": {
        "schemaName": "AccountAddressDetailV2",
        "entitySchemaName": "AccountAddress",
        "filter": {
            "detailColumn": "Account",
            "masterColumn": "Account"
        },
        "useRelationship": true,
        "filterMethod": "accountAddressFilter"
    },
    "AccountCommunication": {
        "schemaName": "AccountCommunicationDetail",
        "entitySchemaName": "AccountCommunication",
        "filter": {
            "detailColumn": "Account",
            "masterColumn": "Account"
        },
        "useRelationship": true,
        "filterMethod": "accountAddressFilter"
    }
},
/**......*/
methods: {
    accountAddressFilter: function() {
        var account =  this.get("Account");
        var accountId = this.Terrasoft.GUID_EMPTY;
        if (account && account.value) {
            accountId = account.value;
        }
 
        var filterGroup = new this.Terrasoft.createFilterGroup();
        filterGroup.logicalOperation = this.Terrasoft.LogicalOperatorType.AND;
        filterGroup.add("AccountFilter", this.Terrasoft.createColumnFilterWithParameter(
        this.Terrasoft.ComparisonType.EQUAL, "Account", accountId));
        return filterGroup;
    }
},
/**......*/

 

Like 0

Like

Share

0 comments
Show all comments

Symptoms

When creating details via the "Detail wizard" and switching to the "Page" tab, the browser fails and provides the below error:

message: The 7f889822-86af-4b53-bd7d-b8b153f0a5c4 key element Does not exist

Solution

Find an element with the necessary CardSchemaUId in the SysModuleEdit table of the database and delete it.

Necessary conditions and restrictions

Occurred in version 7.7

Like 1

Like

Share

0 comments
Show all comments

Case

When I click "Add" on the [Products] detail in an order, I get an error that the total payment sum per order does not correspond the sum of products.

The same happens when I do it for the installment plan.

Answer

When you add a product, bpm'online saves the page. Though the "OrderStatus" base lookup has been changed in this case. During saving, the system checks the correspondence of the sums and the OrderPageV2 page code of the Passport package fails:

validateOrderStatus: function(callback, scope) {
    var result = {
        success: true
    };
    var status = this.get("Status");
    var primaryAmount = this.get("PrimaryAmount");
    var OrderStatus = OrderConfigurationConstants.Order.OrderStatus;
    if (status && (status.value === OrderStatus.InPlanned || status.value === OrderStatus.Canceled)) {
        callback.call(scope || this, result);
        return;
    }
    var esq = Ext.create("Terrasoft.EntitySchemaQuery", {
        rootSchemaName: "SupplyPaymentElement"
    });
    esq.addAggregationSchemaColumn("PrimaryAmountPlan", Terrasoft.AggregationType.SUM,
"PrimaryAmountPlanSum");
    var filters = Terrasoft.createFilterGroup();
    filters.addItem(Terrasoft.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL,
"Order", this.get("Id")));
    filters.addItem(Terrasoft.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL,
"Type", OrderConfigurationConstants.SupplyPaymentElement.Type.Payment));
    esq.filters = filters;
    esq.getEntityCollection(function(response) {
        if (response.success) {
            var collection = response.collection;
            if (collection.getCount() > 0 && primaryAmount !==
collection.getByIndex(0).get("PrimaryAmountPlanSum")) {
                result.message = this.get("Resources.Strings.ValidateOrderStatus");
                result.success = false;
            }
        } else {
            return;
        }
        callback.call(this, result);
    }, scope);

Instruction

var status = this.get("Status"); - returns undefined

collection.getByIndex(0).get("PrimaryAmountPlanSum"))  - returns 0

This causes the verification failure and provides notifications for the "Planned" status.

To solve the issue, replace the OrderConfigurationConstant module and specify the correct Ids in it. This way, the below code:

if (status && (status.value === OrderStatus.InPlanned || status.value === OrderStatus.Canceled)) {
    callback.call(scope || this, result);
    return;
}

will be performed successfully.

 

Like 0

Like

Share

0 comments
Show all comments

Symptoms

Implementation of the case:

  1. In the schedule, open an activity with the following fields populated on the "Connected to" detail: [Lead], [Invoice] and [Project/task];
  2. click the link to open the page of the connected object;
  3. open the "History" tab -> "Activities";
  4. add a new activity to the detail.

As a result, you receive a console error with the following message: 

message: Cannot read property 'replaceCls' of null.

The page of the new activity opens, but when you save and close all of the opened pages, you get back to the schedule displayed in a vertical list and see a blank space with inactive action buttons where the activity page should be. 

Cause

The openCardInChain method is blocked in ActivitySectionV2 as follows:

openCardInChain: function(config) {
   if (this.isSchedulerDataView() && (config.operation === ConfigurationEnums.CardStateV2.ADD)) {
      var historyStateInfo = this.getHistoryStateInfo();
      if (historyStateInfo.workAreaMode === ConfigurationEnums.WorkAreaMode.COMBINED) {
         this.closeCard();
      }
   }
   return this.callParent(arguments);
},

This code is available starting from version 7.3.0.

Solution

In version 7.7.0 this behavior must be corrected. To quickly correct it in the configuration, replace the ActivitySectionV2  schema and override the openCardInChain method in it as follows:

openCardInChain: function(config) {
   if (config.isLinkClick) {
      return false;
   }
   this.saveCardScroll();
   this.scrollCardTop();
   this.showBodyMask();
   var historyState = this.sandbox.publish("GetHistoryState");
   var stateObj = config.stateObj || {
            isSeparateMode: config.isSeparateMode || true,
            schemaName: config.schemaName,
            entitySchemaName: config.entitySchemaName,
            operation: config.action || config.operation,
            primaryColumnValue: config.id,
            valuePairs: config.defaultValues,
            isInChain: true
 };
   this.sandbox.publish("PushHistoryState", {
      hash: historyState.hash.historyState,
      silent: config.silent,
      stateObj: stateObj
   });
   var moduleName = config.moduleName || "CardModuleV2";
   var moduleParams = {
      renderTo: config.renderTo || this.renderTo,
      id: config.moduleId,
      keepAlive: (config.keepAlive !== false)
   };
   var instanceConfig = config.instanceConfig;
   if (instanceConfig) {
      this.Ext.apply(moduleParams, {
         instanceConfig: instanceConfig
 });
   }
   this.sandbox.loadModule(moduleName, moduleParams);
   return true;
}

 

Like 0

Like

Share

0 comments
Show all comments

Question

How do I minimize the help section? It takes up 1/3 of the page...

Answer

Orange color means that this tab is active. In order to hide communication panel, please click to the orange element once again.

Like 0

Like

Share

0 comments
Show all comments