Hello,

We would like to add the City of an Account in the Visit Scheduler container. How can that be achieved ?

Thank you

Sasori

Like 0

Like

8 comments

Hello team,

Any update on this ?

Sasori Oshigaki,

Hello,

This title is composed in the schema ActivitySectionGridRowViewModel and its method getScheduleItemTitle and if you want to change the title, you need to modify this method. Keep in mind that you cannot simply override schema ActivitySectionGridRowViewModel, you need to write a new nodule with a code similar to ActivitySectionGridRowViewModel with the exception of the needed method and connect your new schema to the base schemas similar to an old ActivitySectionGridRowViewModel

Hi Creatio,

I have managed to retreive the City Valye.

My last hurdle is how to set the retrieved city string value to a global attribute inside the ESQ, because as you know ESQ is aysnc.

 

This is the Global attribute:

attributes: {
		"CityNameEsq": {
		dataValueType: this.Terrasoft.DataValueType.TEXT,
		type: this.Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN
		}	
	},

This is the method:

getScheduleItemTitle: function() {
		    this.callParent(arguments);
			var title = this.get("Title");
			var account = this.get("Account");
			var accountGuid = this.get("Account").value;
 
				var recordId = this.get("Account").value;
					var esq = Ext.create("Terrasoft.EntitySchemaQuery", {
						rootSchemaName: "Account"
					});
					esq.addColumn("City.Name", "CityName");
					esq.getEntity(recordId, function(result) {
						if (!result.success) {
							// For example, error processing/logging.
							this.showInformationDialog("Data query error");
							return;
						}
						this.set("CityNameEsq", result.entity.get("CityName"));

Sasori Oshigaki,



Here is a sample to get the result of an asynchronous function using Terrasoft.chain

getMyEntity: function(callback) {
    var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {
        rootSchemaName: schemaName
    });
    ...
    esq.getEntity(recordId, function(response) {
        ...
        if (callback) {
            callback.call(this);
        }
    }, this)
},
globalMethod: function() {
    Terrasoft.chain(
        function(next) {
            this.getMyEntity(function() {
                next();
            });
        },
        function() {
            this.doAfterGettingEntity();
        },
        this
    );
}

Also, please check this article's getentity method to synchronous!



 

 

BR,

Bhoobalan Palanivelu.

Bhoobalan Palanivelu,

Thank you very much Bhoobalan. As always you help is much appreciated.

I am still not getting the wanted result.

Here is the entire module code

define("SasActivitySectionGridRowViewModel", ["ActivitySectionGridRowViewModel","ActivitySectionGridRowViewModelResources"
	],
		function() {
 
	/**
	 * @class Terrasoft.configuration.ActivitySectionGridRowViewModel
	 */
	Ext.define("Terrasoft.configuration.SasActivitySectionGridRowViewModel", {
		alternateClassName: "Terrasoft.SasActivitySectionGridRowViewModel",
        override: "Terrasoft.ActivitySectionGridRowViewModel",
	    attributes: {
					"CityNameEsq": {
						dataValueType: this.Terrasoft.DataValueType.TEXT,
						type: this.Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN
					}
 
				},
		/**
		 * ########## ######## ######### ######## # ##########.
		 * @return {String} ######## ######### ######## # ##########.
		 */	
		getScheduleItemTitle: function() {
			Terrasoft.chain(
			function(next) {
				this.GetCityName(function() {
					next();
				});
			},
				function() {
				this.getTitleInfo();
			},
			this
		);
		},
 
		GetCityName: function(callback)
		{
			debugger;
			var recordId = this.get("Account").value;
			var esq = Ext.create("Terrasoft.EntitySchemaQuery", {
				rootSchemaName: "Account"
			});
			esq.addColumn("City.Name", "CityName");
			esq.getEntity(recordId, function(response) {
				if (!result.success) {
					this.showInformationDialog("Data query error");
					return;
				}
				this.set("CityNameEsq", result.entity.get("CityName"));
			}, this);
		},
 
		getTitleInfo: function()
		{
			var title = this.get("Title");
			var account = this.get("Account");
			var accountDisplayValue = (account) ? account.displayValue + ": " : "";
			return Ext.String.format("{0}{1}", accountDisplayValue, title,this.get("CityNameEsq"));
		}
 
	});
 
	return Terrasoft.SasActivitySectionGridRowViewModel;
});

What am in doing wrong here. Because i get

Sasori Oshigaki,



Can you please try to add in this method  getScheduleItemTitle: function()

 this.callParent(arguments);

 

Hi Bhoobalan,

Still getting the same result

after applying 

this.callParent(arguments);
	getScheduleItemTitle: function() {
			this.callParent(arguments);
			Terrasoft.chain(
			function(next) {
				this.GetCityName(function() {
					next();
				});
			},
				function() {
				this.getTitleInfo();
			},
			this
		);
 
		},

 

The esq async logic may be pretty complicated. if you have a debug mode enabled, please turn it off, this may fix the issue. If it, not the case, try to change the title in the method getScheduleItemTitle without using ESQ by setting some test value, maybe the problem isn't in the async logic but in the method itself.

Show all comments

Hi Team,

 

My requirement is to run a scheduler job on monthly basis, Which would retrieve all employee and then group by a specific conditions and do some calculations and update them.

 

To do calculation we need to retrieve the few more objects.

So that we can do this using C# in console application i can run in task scheduler as i am using OnPremise Creatio CRM.

Like 0

Like

1 comments

Hi Nagaraju,

 

To run this action once per month a business process with a timer can be created that will create a scheduler task. And then you can either add a script task to the process, or use read data and read a collection of records or implement any other logic required.

 

Best regards,

Oscar

Show all comments

Hello community!



I have a use case where I need to send a reminder email to all users of a certain organization role at 9 AM their morning as per the timezone they have chosen.

 

I cannot use the Start timer element in the business process as it only lets you choose one timezone and not the user's timezone. 

Like 0

Like

3 comments

Dear Shrikanth,

 

If for example organization role contains 50 users and each user has different timezone (not all of them have the same timezone) you will need to start the process 50 times and distinct "processed" users from "unprocessed". Since the amount of timezones is limited it will be easier for you to tag users who should receive an email by some role or other method and create a separate process for sending emails for each time zone instead of each user. 

 

Best regards,

Angela

Angela Reyes,

Hi Angela. Users can belong to any time zone (There are 110 in total) and new users will get added dynamically with maybe new time zones. Also, the time zone's of users can change depending on the user's global travel. 



Adding one BP per time zone is not maintainable down the line. Can I have one BP which will send Emails as per the time zone of the user?

Is there a way we can write code or use the Quartz.Net scheduler to achieve this?

M Shrikanth,

Usually, it is achievable by timer event but since you have many emails that can be sent in 1 day this cannot be done via one process - only several, according to main time zones (for example). Main timezones are 

From east to west they are Atlantic Standard Time (AST), Eastern Standard Time (EST), Central Standard Time (CST), Mountain Standard Time (MST), Pacific Standard Time (PST), Alaskan Standard Time (AKST), Hawaii-Aleutian Standard Time (HST), Samoa standard time (UTC-11) and Chamorro Standard Time (UTC+10). 

 

If you want to create task in quartz for each timezone it will greatly impact system performance due to the huge amount of data. 

 

Best regards,

Angela

Show all comments