mobile
mobile application

Hi Team,

 

I'm trying to extend a base function in my custom controller. And the code is loading once I open the page but is not triggering the function. Is this the correct way? What I'm doing wrong in this case?

So I have the custom controller created in this way:

Ext.define("Terrasoft.configuration.controller.SMAgilizExpenseManagementGridPage", {
	extend: "Terrasoft.controller.BaseGridPage",

	statics: {
		Model: AgilizExpenseManagement
	},

	config: {
		refs: {
			view: "#AgilizExpenseManagementGridPage"
		}
	},

	/**
	 * @inheritdoc
	 * @protected
	 * @overridden
	 */
		getChangeModeOperations: function() {
		var detailConfig = this.getDetailConfig();
		if (detailConfig) {
			var parentRecord = detailConfig.parentRecord;
			if (parentRecord.get("IsNonActualEmail") === false) {
				return {
					canCreate: false,
					canUpdate: false,
					canDelete: false
				};
			}
		}
		return this.callParent(arguments);
	},
	initializeQueryConfig: function() {
		this.callParent(arguments);
		var gridQueryConfig = this.getQueryConfig();
		gridQueryConfig.addColumns(this.startDateColumnName, this.endDateColumnName);
		if (Terrasoft.FeatureUtils.isHybridMode()) {
			gridQueryConfig.setIsBatch(false);
		}
	},

});

And is added in the MobileApplicationManifestDefaultWorkplace as well:

 

 

Like 0

Like

7 comments
Best reply

 Hi Oscar, I solve it with this code. We change the extend for override. Of course this override for the entire app but works for me :)

Ext.define("Terrasoft.controller.AgilizExpenseManagement", {
	override: "Terrasoft.controller.BaseModelPage",

	statics: {
		Model: AgilizExpenseManagement
	},
	/**
	 * @inheritdoc
	 * @protected
	 * @overridden
	 */
		getChangeModeOperations: function() {
		var detailConfig = this.getDetailConfig();
		if (detailConfig && detailConfig.parentRecord.data.AgilizExpenseStatus.id) {
			var parentRecord = detailConfig.parentRecord;
			if ( parentRecord.data.AgilizExpenseStatus.id && parentRecord.data.AgilizExpenseStatus.id !== "f50b9fd6-21ed-47ff-8450-e7f5f9c82c5f") {
				
				return {
					canCreate: false,
					canUpdate: false,
					canDelete: false
				};
			}
		}
		return this.callParent(arguments);
	}

});

 

​Hi Federico,



This method is a part of the BaseModelPage controller:

Try extending the Terrasoft.controller.BaseModelPage. Also please check if the extended module is added to the CustomSchemas sync option in the manifest.

Best regards,

Oscar

Hi Oscar Dylan,

I try to add the BaseModelPage in extended but still is calling the base one. The schema is loading in the debbuger but is not trigged the function. I added in the customschemas as well.

 

Something is missing in my code?

 

Ext.define("Terrasoft.controller.SMAgilizExpenseManagement", {
	extend: "Terrasoft.controller.BaseModelPage",

	statics: {
		Model: AgilizExpenseManagement
	},
	/**
	 * @inheritdoc
	 * @protected
	 * @overridden
	 */
		getChangeModeOperations: function() {
			window.alert("Test");
		var detailConfig = this.getDetailConfig();
		if (detailConfig) {
			var parentRecord = detailConfig.parentRecord;
			if (parentRecord.get("IsNonActualEmail") === false) {
				
				return {
					canCreate: false,
					canUpdate: false,
					canDelete: false
				};
			}
		}
		return this.callParent(arguments);
	}

});

 

 

I tried to extend the controller in many ways but looks is not working. Somebody have a example to share?

Federico Buffa ...,

 

Hi,

 

I am studying the base AccountPreviewPage code to give you an example of the controller extension. Please give me a couple of days and I will return to you with an update.

 

Meanwhile if someone has an example - it would also help us much!

 

Best regards,

Oscar

 Hi Oscar, I solve it with this code. We change the extend for override. Of course this override for the entire app but works for me :)

Ext.define("Terrasoft.controller.AgilizExpenseManagement", {
	override: "Terrasoft.controller.BaseModelPage",

	statics: {
		Model: AgilizExpenseManagement
	},
	/**
	 * @inheritdoc
	 * @protected
	 * @overridden
	 */
		getChangeModeOperations: function() {
		var detailConfig = this.getDetailConfig();
		if (detailConfig && detailConfig.parentRecord.data.AgilizExpenseStatus.id) {
			var parentRecord = detailConfig.parentRecord;
			if ( parentRecord.data.AgilizExpenseStatus.id && parentRecord.data.AgilizExpenseStatus.id !== "f50b9fd6-21ed-47ff-8450-e7f5f9c82c5f") {
				
				return {
					canCreate: false,
					canUpdate: false,
					canDelete: false
				};
			}
		}
		return this.callParent(arguments);
	}

});

 

Looks the function is working for the fields but no for the button edit. I can't find the logic for that.

this solutions works to hide the edit button if the permission canUpdate is false

Ext.define("Terrasoft.controller.AgilizExpenseManagementPreviewPage", {
	override: "Terrasoft.controller.BasePreviewPage",


	initNavigationButtons: function() {
		this.callParent(arguments);
		let view = this.getView();
		if (this.getChangeModeOperations().canUpdate && view.getEditButton()) {
			let editButton = view.showEditButton(true);
			editButton.on("tap", this.onEditButtonTap, this);
		} else {
			view.showEditButton(false);
		}
	}

});

 

Show all comments
mobile
mobile application
Mobile app

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
mobile
mobile application
Mobile app
Sales_Creatio_enterprise_edition
7.17

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 1

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

Hi Community,

 

In mobile, I found this sample below in Academy on how to add filter to dropdown field. My question is how to add mulitple filter to dropdown field. I tried below syntax but it is not working

 

addFilter: [

             {

                      property: "IsChief",

                     value: true

             },

             

             {

                      property: "IsChief2",

                     value: true

             },

]



 

Like 0

Like

1 comments

Hi Fulgen, 

 

Please try to use it in this way : 

 

addFilter: {

type: Terrasoft.FilterTypes.Group,

subfilters: [{...}, {...}]

}

 

Best Regards, 

 

Bogdan L.

Show all comments
mobile application
Studio_Creatio_enterprise_edition
7.17

Hello Team,

 

There is any way to edit the fields to display in the mobile section? In the web I change the behavior of the field in the object and is hidden but didn't work on the mobile.

 

 

Like 0

Like

3 comments

Hello Federico, 

 

Actually this is the out-of-the box logic and it's not possible to hide these columns. Nevertheless, you are welcome to use the "Search for filter column" option that was developed to find the needed filter column fast.

 

Best Regards, 

 

Bogdan L.

Bogdan Lesyk,

 

Thanks Bogdan.

 

Would be great if the mobile is taking the behavior configuration of the object like in the web version. 

Federico Buffa ...,

 

For sure! 

 

That's a great idea and will be definitely passed to our Core R&D team.

 

Thanks!

 

Regards, 

 

Bogdan L.

Show all comments
mobile
mobile application
Mobile app
Mobile_Creatio
mobile sdk

Hello Team!

I'm wondering if there is possible create a virtual column in mobile, like we are doing in the web version with attributes. There is any way to replicate that?

 

Regards,

 

Like 0

Like

1 comments

Hello Federico,

 

Hope you're doing well.

 

At the moment, the mobile application doesn't support interaction with virtual columns. We have created a request to the R&D team so they could review the possibility of further implementation of this functionality in the future versions of the mobile application. 

 

Thank you for helping us to provide better services!

 

Best regards,

Roman

Show all comments
mobile
mobile application
Studio_Creatio_enterprise_edition
7.17

 Hello Team.

 

There is any way to get the value of the record in the store.loadPage?

I can access to the record parameter inside of the callback.

Terrasoft.sdk.Model.addBusinessRule("ExpensesDetail", {
	name: "GetRoleFromtheUser",
	ruleType: Terrasoft.RuleTypes.Custom,
	triggeredByColumns: ["Subcategory"],
	events: [Terrasoft.BusinessRuleEvents.ValueChanged, Terrasoft.BusinessRuleEvents.Save],
	executeFn: function(record, rule, column, customData, callbackConfig) {
		
		
		var myrecord = record;
 		var passedTheTestAndIsValid = true;
		
		var currentUser =Terrasoft.CurrentUserInfo.userId;
		var store = Ext.create('Terrasoft.store.BaseStore', {
			model: 'SMVwUserRoles'
		});
		var queryConfig = Ext.create('Terrasoft.QueryConfig', {
			columns: ['SMId', 'SMUserName', 'SMRoleName'],
			modelName: 'SMVwUserRoles'
		});
		store.loadPage(1, {
			queryConfig: queryConfig,
			
			filters: Ext.create('Terrasoft.Filter', {
				property: 'SMId',
				value: currentUser
			}),
			callback: function(records, operation, success) {
				var loadedRecord = records[0];
				if (loadedRecord) {
					var contact = loadedRecord.get('SMRoleName');                                                                                                    
					if (contact) {                                                                                                                   
						console.log(contact);
					}
					}
				},
					scope: this
			});
		
	},
	position: 3
});

 

Like 0

Like

2 comments
Best reply

Hello Federico,

 

You have the myrecord variable and it's accessible inside the loadPage method:

So you can access the record parameters if needed there.

 

Best regards,

Oscar

Hello Federico,

 

You have the myrecord variable and it's accessible inside the loadPage method:

So you can access the record parameters if needed there.

 

Best regards,

Oscar

Oscar Dylan,

 Thanks Oscar, I my case sending the scope: this was not working but changing the scope works.

Show all comments
mobile
Mobile app
mobile application
Studio_Creatio_enterprise_edition
7.17

Hello Team!

Somebody know if there is a save validation in mobile like the method in web version:

			asyncValidate: function(callback, scope){
				this.callParent([function(resultObject){

						resultObject.success = false;
						resultObject.message = scope.get("Resources.Strings.SummitionNoAcepted");
						
					
					callback.call(scope, resultObject);
				}], scope);
			},

I need to validate if a detail has records added before save the record.

Like 0

Like

4 comments

Hello Federico,

 

There is an onSaveButtonTap method in the base edit page controller schema that is triggered when the record is saved. There is no async validator there, but in case you need to check something for the saved record upon saving then you need to look at that method call.

 

Best regards,

Oscar

Oscar Dylan,

 Thanks Oscar. I need to create a page controller for a custom section? There is some documentation about that?

Federico Buffa ...,

 

No we don't have such an instruction unfortunately.

 

Best regards,

Oscar

Oscar Dylan,

 Thank you so much. Just wondering if that method can be use in the module config or needs to be in another schema. I don't have much information about mobile structure.

Show all comments
mobile application
multiline
text
Sales_Creatio_enterprise_edition
7.17

Hello,

 

I am trying to view Notes field as multi-line text in Activity section in mobile application, but it is appearing in single line as a result of which, the long texts are not visible properly.

 

 

This field is multi-line in web application but I need this multi-line in mobile application also.

 

Please suggest me a way to make this field multi-line.

 

Regards,

Malay

Like 0

Like

6 comments
Best reply

Hello Malay,

I have an article covering how to do this in mobile here https://customerfx.com/article/adding-a-multiline-text-field-in-the-cre…

Note, the code is added to a module in the mobile client, you can see how to create that here https://customerfx.com/article/creating-modules-for-the-creatio-mobile-…

Ryan

Hello Malay,

I have an article covering how to do this in mobile here https://customerfx.com/article/adding-a-multiline-text-field-in-the-cre…

Note, the code is added to a module in the mobile client, you can see how to create that here https://customerfx.com/article/creating-modules-for-the-creatio-mobile-…

Ryan

Thanks Ryan, It works.

 

I just have another query that how to put a placeholder in the http link field in mobile so that it does not show the full real link, instead of this it shows some meaningful string.

 

For example, for "www.google.com", I want to show the link as "Google Search".

 

And also, how to make read only field text color as black. (The address field in above screenshot of mobile is read only but it is appearing as grey text).

 

It would be helpful if this can be done.

 

Thank you in advance.

 

Regards,

Malay

Malay Garg,

There is a way to change the color of read-only fields. You can do this using the utility method Terrasoft.util.writeStyles.

 

By default the style of the disabled fields looks something like this:

 

Terrasoft.util.writeStyles (

 

.x-field.x-item-disabled input,

.x-field.x-item-disabled textarea {

color: rgba(0, 0, 0, 0.26);

-webkit-text-fill-color: rgba(0, 0, 0, 0.26);

-webkit-opacity: 1;

}

 

);

 

So you will need to change the alpha value of rgba from 0.26 to 1.

 

You can do the changes in the existing schema in LESS like in the desktop Creatio. You can also do this in the existing schema declared in the manifest in the CustomSchemas section. Or you can create a new schema and declare it in the CustomSchemas section.

 

 

As for the question about a placeholder in the http link field. As far as I understand you want to use hyperlinks in some fields. Could you please explain where you want to put them? Which fields exactly? I hope I understood you correctly.

 

 

Best regards,

Max.

Max,

 

I will try this.

Yes, I want to put the placeholder for the following string field which is a link:

 

Regards,

Malay

Malay Garg,

 

Unfortunately, there is no out of the box solution to do this. It can theoretically be implemented via development but you will have to contact your manager about it.

 

Best regards,

Max.

Max,

 

Thanks for confirming.

 

The previous code I have tried putting in the LESS in a module after changing the value 0.26 to 1 and included module in activity section page extensions in workplace manifest . Still it does not make the field color black.

 

I have restarted the application pool and synchronized also but still it does not work.

 

regards,

Malay

Show all comments
mobile application
mobile
Field validation
phonevalidator
emailvalidator
Sales_Creatio_enterprise_edition
7.17

Hello

 

I was trying to validate email format and phone number format in activity section in mobile application but could not find anything.

Please provide me a way to validate these fields in mobile application.

 

Regards,

Malay

Like 0

Like

5 comments

Hello Malay,



Could you please provide us more detailed information on your business task? Could you share screenshots?



Thank you in advance!

 

Best regards,

Bogdan

Hello Bogdan,

 

Hello I want to apply validation for mobile number and email in activity section. For example, the phone number should be of 10 digits and only contain numbers and email format should be of the form abc@xyz.com.

 

I have used JavaScript for lead section to do it for the web version but how to do it for the mobile application?

 

Below is the screenshot of the mobile activity page where I want to apply this validation.

 

Regards,

Malay

Hello Malay,

You can use a custom business rule for this task. See here for an example: https://academy.creatio.com/docs/developer/mobile_development/mobile_ap…

For using the custom rule for validation, you can pass a third parameter to the callback function with a message (the validation message) and value (true or false indicating if validation passed or not).

For example:

var result = {};
if (passedTheTestAndIsValid) {
    result = {
        value: true
    };
}
else {
    result = {
        value: false,
        message: "The entered value is invalid"
    }
}

// now include the result in the callback
Ext.callback(callbackConfig.success, callbackConfig.scope, [result]);

Ryan

Ryan Farley,

 Thanks for share it. You have any example using esq query in custom business rules for validations?

Christian Kern,

 

1. File will be stored in configurations.

 

2. The main rule - the first word of business rule name should be the section name. Like "Contact", "Case", "Account". 

 

Best regards, 

 

Bogdan L.

Show all comments