Hi Team, 

Im trying to show all the fields specially the Notes in the Activity Preview Page. I have the same code in other entity working but in Activities seams not to be working.

The function is triggered but no others fields are showing. Something have any idea why?

 

Thanks,

 

/* globals Activity: false */
Terrasoft.LastLoadedPageData = {
	controllerName: "ActivityPreviewPage.Controller",
	viewXType: "activitypreviewpageview"
};
 
Ext.define("ActivityPreviewPage.View", {
	extend: "Terrasoft.view.BasePreviewPage",
	xtype: "activitypreviewpageview",
	config: {
		id: "ActivityPreviewPage"
	}
});
 
Ext.define("ActivityPreviewPage.Controller", {
	extend: "Terrasoft.controller.BasePreviewPage",
	statics: {
		Model: Activity
	},
	config: {
		refs: {
			view: "#ActivityPreviewPage"
		}
	},
 
		/**
	 * @inheritdoc
	 * @protected
	 * @overridden
	 */
	doChangeField: function(field, newValue, executeRulesCallback) {
		this.callParent(arguments);
		field.show();
	}
});

Like 0

Like

3 comments

Hi Federico,

 

I've added the same code on my side and the Notes field appeared in the preview page:

Not sure why this is not working on your side at all. Try recreating a module with the controller from scratch and recycle the app pool after that.

 

Best regards,

Oscar

Hi Oscar, I have the notes fileds as a multiline. Can this affect?

Federico Buffa ?,

 

Try disabling the multiline attribute for the column and see what happens. Probably it can be the issue.

 

Best regards,

Oscar

Show all comments

Hi Team, 

I'm getting an error in a custom section when I try to apply a filter in the mobile app.

 

Any ideas? The object is in the manifest to sync and the rest is working perfect. Only the filters can not be apply. 

 

Like 0

Like

3 comments

Hi,

 

According to the trace of an error there is a problem with the getColumnsSetColumns method execution. Please debug the method execution and share the iteration of the method call that results in the error message.

 

Best regards,

Oscar 

Hi Oscar Dylan,

 

The function is trigger first time with the primaryColumnSet and then the variable columnSetName is empty. You know from where is comming from this? I have a button in the edit page. that is a problem?

 

Federico Buffa ?,

 

It seems that columns for some model were not received. You need to check which model is called in this method and which model doesn't have the columns. As for the place from which the getColumnsSetColumns want's to receive the columns - it should be checked in the call stack. Also sometimes it helps to resave all the settings of the section (of the correspondent workplace) in the mobile application wizard and restart the main app and then relogin to the mobile app, maybe it will help in your case.

 

Best regards,

Oscar

Show all comments

Hi Team, I have a amount field in the mobile up that is update by business process once the details are modified. Something like Order and Products, once the product is added or modified the total of the order is updated. 

The problem is once the detail is modified and the process impact the changes, the main page is not refresh until I change the section and go back. 

There is any way to force the refresh of that controller/preview from the detail controller?

Like 0

Like

6 comments

Hello Federico,



If I understood your request correctly, the next examples should be helpful for resolving your business task:

Kind regards,

Bogdan

Thanks Bogdan, is the same funtionality  but for the mobile app.

Dear Federico, 



Could you please your product (Sales, Service, Marketing, etc.)? 

And the name of the Workplace in the mobile application (Main workplace, etc.)? 

 

Thanks in advance!



Kind regards,

Bogdan

The product is sales 7.18.5 and the workspaces is the main workspaces.

Federico Buffa,

 

Unfortunately, there is no such functionality for the mobile application to avoid additional loading.



Best regards,

Bogdan

Refreshing the view page is not enough.

It is still necessary to wait for the completion of data synchronization with the server, which can take a long time or even stop due to a bad connection.

If the business logic is not very complicated, then as an option you can repeat it in a mobile application. But, for this you have to write JS code 

Show all comments

Hi Team. I have a code to save a change in the record. The change is impact in the database but the lookup is stay in until the next sincronization. There is a way to refresh or push the sync for that particular record in the mobile app?

onClickMeButtonClick: function() {
		var record = this.getRecord();
		var recordId = record.getId();
		if (record.data.AgilizExpenseStatus.data.Id != "0bbc321a-77cd-4d20-a929-b5bbb34c74bc") {
 
			Terrasoft.ServiceHelper.issueRequest({
				serviceName: "SMExpensesManagmentValidator",
				methodName: "AttachmentsValidation",
				data: {
					Id: recordId
				},
				success: function(response) {
					if (response.AttachmentsValidationResult == "") {
						record.set("AgilizExpenseStatus", "0bbc321a-77cd-4d20-a929-b5bbb34c74bc", true);
 
						record.save({ 
							queryConfig: Ext.create('Terrasoft.QueryConfig', { 
								modelName: record.self.modelName,
								columns: ['AgilizExpenseStatus']
							}),
							success: function() {
 
//here I need to refesh the record.
								Terrasoft.MessageBox.showMessage(LocalizableStrings.SummitForApproval); 
 
							},
							failure: function(exception) { 
								Terrasoft.MessageBox.showException(exception); 
							}
						}, this);
					} else {						
 
					}
				},
				failure: function(response) {
					Terrasoft.MessageBox.showMessage("Error in webservice");
				},
				scope: this
			});
		} 
	}

 

 

Like 0

Like

5 comments
Best reply

Federico Buffa ?,

 

Ok, got it. You need to somehow call the refreshDirtyData method inside your method. As stated in the base page controller module:

/**
	 * Refreshes obsolete data on page.
	 * @internal
	 * @virtual
	 * @param {Object} operationConfig Configuration of operation.
	 */
	refreshDirtyData: function(operationConfig) {
		if (operationConfig) {
			this.refreshDirtyDataByOperationConfig(operationConfig);
		} else {
			this.loadData();
		}
	},

An example of a call of this method can be found in the FieldMobileVisitActions module (FieldMobile package):

onCheckInOutSucceeded: function(isCheckIn) {
        var record = this.getActivityRecord();
        var statusId = isCheckIn
            ? Terrasoft.Configuration.ActivityStatus.InProgress
            : Terrasoft.Configuration.ActivityStatus.Finished;
        record.set("Status", ActivityStatus.Store.getById(statusId));
        var queryConfig = Ext.create("Terrasoft.QueryConfig", {
            columns: ["Status"],
            modelName: record.self.modelName
        });
        record.save({
            isCancelable: false,
            queryConfig: queryConfig,
            success: function() {
                this.complete(function() {
                    var pageController = Terrasoft.PageNavigator.getLastPageController();
                    pageController.refreshDirtyData();
                    Terrasoft.PageNavigator.markPreviousPagesAsDirty();
                    var message = isCheckIn ? Terrasoft.LocalizableStrings.VisitActionDesignerCheckInOk :
                        Terrasoft.LocalizableStrings.VisitActionDesignerCheckOutOk;
                    this.callSuccess(message);
                    Terrasoft.Mask.hide();
                });
            },
            failure: function(exception) {
                this.callFailure(exception);
                Terrasoft.Mask.hide();
            }
        }, this);
    },

Hi Federico,

 

It can be the result of the missing lookup object in the SysLookupsImportConfig array of the mobile application manifest. You need to check if the object of your lookup is present there.

Hi Oscar, the lookup is there and is working with the manual selection just when I set the id in the button is showing like that's like if the sync is missing or something is not refresh.

Federico Buffa ?,

 

Ok, got it. You need to somehow call the refreshDirtyData method inside your method. As stated in the base page controller module:

/**
	 * Refreshes obsolete data on page.
	 * @internal
	 * @virtual
	 * @param {Object} operationConfig Configuration of operation.
	 */
	refreshDirtyData: function(operationConfig) {
		if (operationConfig) {
			this.refreshDirtyDataByOperationConfig(operationConfig);
		} else {
			this.loadData();
		}
	},

An example of a call of this method can be found in the FieldMobileVisitActions module (FieldMobile package):

onCheckInOutSucceeded: function(isCheckIn) {
        var record = this.getActivityRecord();
        var statusId = isCheckIn
            ? Terrasoft.Configuration.ActivityStatus.InProgress
            : Terrasoft.Configuration.ActivityStatus.Finished;
        record.set("Status", ActivityStatus.Store.getById(statusId));
        var queryConfig = Ext.create("Terrasoft.QueryConfig", {
            columns: ["Status"],
            modelName: record.self.modelName
        });
        record.save({
            isCancelable: false,
            queryConfig: queryConfig,
            success: function() {
                this.complete(function() {
                    var pageController = Terrasoft.PageNavigator.getLastPageController();
                    pageController.refreshDirtyData();
                    Terrasoft.PageNavigator.markPreviousPagesAsDirty();
                    var message = isCheckIn ? Terrasoft.LocalizableStrings.VisitActionDesignerCheckInOk :
                        Terrasoft.LocalizableStrings.VisitActionDesignerCheckOutOk;
                    this.callSuccess(message);
                    Terrasoft.Mask.hide();
                });
            },
            failure: function(exception) {
                this.callFailure(exception);
                Terrasoft.Mask.hide();
            }
        }, this);
    },

Thanks Oscar. works!

Oleg Drobina,

Will this also refresh embedded details associated with the record?

Show all comments

Hi team. There is a option to make this message multiline?

 

Terrasoft.MessageBox.showMessage("asdasf \r\n sdfs")

Like 0

Like

2 comments
 onMyMainButtonClick: function(){
  this.showInformationDialog(" clicked \r\n new line here");
}

Works for me to add a new line. Could you browser be caching something? 

 

keith schmitt,

Is for the mobile schema no for web. Your function is in a web schema.

Show all comments

Hi Community,

 

I've this situation where I need to hide a detail based on condition, however i didn't find any example of this, only with filelds on the page, like i show on the image below with the custom business rule that I applied.

 

 

Any suggestions how to apply this condition in a detail?

 

 

Thanks in Advance,

Daniel Longo

Like 0

Like

3 comments

Hi Daniel, 

 

Actually, it is not possible to do with the detail, like the example with the fields you sent.

 

In order to achieve such implementation, you need to extend the controller and add the additional logic manually. 

 

Unfortunately, we don't have such examples. 

 

But here you can check my colleague answer, where to find the controller which you can modify: 

 

https://community.creatio.com/questions/there-way-make-detail-read-only…

 

Hopefully, it will be useful for you!

 

Best Regards, 

 

Bogdan L.

 

 

Bogdan Lesyk,

Are there any updates regarding hiding a detail in mobiel based on a condition please ?

developer,

 

Let's discuss it in terms of a thread created by you here https://community.creatio.com/questions/how-hide-detail-mobile-based-co…. I will check internal notes and will let you know about the possible ways of achieving this.

Show all comments

Hi Team, Somebody know how to update data from the button in the mobile app?

 

Like 0

Like

5 comments
Best reply

Federico Buffa ?,

 

Hi,

 

Try using the following code to save the record value (for example using the following code I've renamed a contact):

 

var name = record.get("Name");
var columnName = record.self.PrimaryDisplayColumnName;
record.set("Name", name + " renaming method");
record.save({
			queryConfig: Ext.create("Terrasoft.QueryConfig", {
				modelName: record.self.modelName,
				columns: [columnName]
			}),
			failure: this.onViewError
		}, this);

Please note that columns from the queryConfig is an array and you can pass an array of column names here (and column names are stored inside the record.self.ColumnConfigs.keys).

 

As for refreshing the page - not sure if it's possible in the context of the button click handler function execution.

 

Best regards,

Oscar

Hello Federico,



Could you please elaborate more on this question? 



Best regards,

Bogdan 

Hi Bogdan, Sure. I have a button created in the preview page and I want to change a value of that record once the button is press, in this case is to change the status to pending to approval. I have my button like this but I don't know how to save the update record and refresh the page.

 Ext.define("Terrasoft.controls.CustomRecordPanelItem", {
    extend: "Terrasoft.RecordPanelItem",
    xtype: "cftestrecordpanelitem",
    config: {
        items: [
            {
                xtype: "container",
                layout: "hbox",
                items: [
                    {
                        xtype: "button",
						cls: "btn",
                        id: "clickMeButton",
                        text: '<div style="color: white; background-color: #8ecb60;  padding-top: 2%;  padding-bottom: 2%;">SUMMIT FOR APPROVAL</div>',
                        flex: 5
                    }
                ]
            }
        ]
    },
    initialize: function() {
        var clickMeButton = Ext.getCmp("clickMeButton");
        clickMeButton.element.on("tap", this.onClickMeButtonClick, this);
    },
    onClickMeButtonClick: function() {
        var record = this.getRecord();
 
	// I need to update here the record.
        Terrasoft.MessageBox.showMessage(record.getPrimaryDisplayColumnValue());
    }
});

 

Federico Buffa ?,

 

Hi,

 

Try using the following code to save the record value (for example using the following code I've renamed a contact):

 

var name = record.get("Name");
var columnName = record.self.PrimaryDisplayColumnName;
record.set("Name", name + " renaming method");
record.save({
			queryConfig: Ext.create("Terrasoft.QueryConfig", {
				modelName: record.self.modelName,
				columns: [columnName]
			}),
			failure: this.onViewError
		}, this);

Please note that columns from the queryConfig is an array and you can pass an array of column names here (and column names are stored inside the record.self.ColumnConfigs.keys).

 

As for refreshing the page - not sure if it's possible in the context of the button click handler function execution.

 

Best regards,

Oscar

Thanks Oscar. Is working perfect.

var record = this.getRecord();
if (record.data.AgilizExpenseStatus.data.Id != "0bbc321a-77cd-4d20-a929-b5bbb34c74bc") {
			record.set("AgilizExpenseStatus", "0bbc321a-77cd-4d20-a929-b5bbb34c74bc");
			record.save({ 
				queryConfig: Ext.create('Terrasoft.QueryConfig', { 
					modelName: record.self.modelName,
					columns: ['AgilizExpenseStatus']
				}),
				success: function() {
					Terrasoft.MessageBox.showMessage(LocalizableStrings.SummitForApproval); 
				},
				failure: function(exception) { 
					Terrasoft.MessageBox.showException(exception); 
				}
			}, this);
		}

 

Show all comments

Hi Team,

Would be great to have the possibility to add the business rules from the Mobile application wizard like we can do right now in the edit pages on web,

 

Thanks,

 

1 comments

Hello Federico,



Thank you so much for your idea. We've registered it in our R&D team backlog for consideration and implementation in the future application releases.

 

Thank you for helping us to improve our product. 

 

Best regards,

Bogdan

Show all comments

Hi Team!

In mobile fields by default in the section list or view page mode is only showing the fields completed or not null. There is a way to change that? Show all the fields even if are null?

 

For example here in activities is not showing call notes, only when you are in edit mode.

 

Like 0

Like

3 comments
Best reply

Hello Federico,

 

Hope you're doing well.

 

This is default mobile application behavior. Empty fields always remain invisible in case they are not filled in. This logic can be changed with the help of development only. It would be necessary to override the Terrasoft.controller.BasePreviewPage of the method doChangeField in all pages like this:

doChangeField: function(field, newValue, executeRulesCallback) {
                       this.callParent(arguments);
                       field.show();
}

Best regards,

Roman

Hello Federico,

 

Hope you're doing well.

 

This is default mobile application behavior. Empty fields always remain invisible in case they are not filled in. This logic can be changed with the help of development only. It would be necessary to override the Terrasoft.controller.BasePreviewPage of the method doChangeField in all pages like this:

doChangeField: function(field, newValue, executeRulesCallback) {
                       this.callParent(arguments);
                       field.show();
}

Best regards,

Roman

Roman Rak, Thanks, that can be apply only for a specific object?

I just create a new controller for the specific schema and works. Thanks

 

Show all comments

Hello,

I'm setting up the Mobile App with VERY FEW sections (contact, accounts, activities)

 

Since we have areas with no connection....I need to set the OFFLINE mode (using 7.17).

 

When I first start the APP, it seems to be loading ALL objects (orders, products, etc...) which take a lot of time/resources.

 

Can we RESTRICT some objects to be loaded when I don't use the section in the App ?

 

Hope I'm clear enough.

Thanks

 

Like 0

Like

2 comments

Hi Francois,

 

This usually happens if there are more than 1 workplace set for the Mobile App. The best way is to check your Mobile wizard and see if any of those sections linked to any of the workplaces.

I double checked and nothing is refering to the order. (I only kept Account/Contact/Activity/Lead.  The data that I'm showing does not call ORDERs or Products in Orders) 



But I still see :  Importing data (OrderProduct) = over 2 Millions records.

 

Can we limit the amount of Order records  (Today's data ONLY) ?

 

Show all comments