Hi!

 

I am currently working on a functionality that overrides and defines what needs to happen when clicking a button on a detail.

 

This means I am working on a "Source Code" type of file within the configuration, so only C# code involved.

 

I have some trouble debugging the code to see what's wrong besides this message that pops up:

 

I haven't found any debugging tips specifically for this type of "file"/task and I would like to display message boxes with values of variables and so on, just like the one above.

 

I know there is a way to achieve this using business processes and JS code inside the client module, but I haven't found any solution to programatically display this using C# code.

 

Can someone refer me to the class/library where this is located exactly?

 

Thanks,

Laurentiu

Like 1

Like

2 comments

Hello Laurentiu,

 

C# cannot be used to display the popup directly. What can be done is send a websocket message to the client side and display the popup when a websocket message is received. Like described here, but in the onNewMessage method you need to call this.showInformationDialog method (just check how it's called out-of-the-box) and pass the message to it.

If this is a local system you can use debugging with your C# code, see https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platfor…

If this is a cloud system, sending messages to the UI to display a message box isn't the best route since the message boxes aren't blocking, meaning if your code sends 3 messages, only the last one will show in the message box, plus it means you have to add client-side code to receive the message and display it. 

It would be far better to just create a lookup object to write your debug messages to, then you just check the lookup to see the messages. 

Ryan

Show all comments

We've got a requirement to run some async entity event listener code, but when following the academy article for that ( https://academy.creatio.com/docs/7-18/developer/back_end_development/ob… ) and trying to use the arguments.OldEntityColumnValues property of the EntityEventAsyncOperationArgs arguments parameter passed in, we get the following compilation error which we cannot seem to resolve:

 

From looking online for general resolutions, it looks like we maybe need to add this assembly to the web.config file, but we're on a cloud instance so presume this isn't a feasible resolution.

 

Any advice would be greatly appreciated.

 

Reduced version of the code (without usings etc shown) that throws the error below:

public class UsrAsyncSendLeadAssociation: IEntityEventAsyncOperation
{
    public void Execute(UserConnection userConnection, EntityEventAsyncOperationArgs arguments) {
        var oldModVal = arguments.OldEntityColumnValues;
    }
}

 

Like 0

Like

1 comments

Hello,

As a quick solution, you should disable the option "Compile into a separate assembly" in the package where the schema is located.

After this, the problem should be resolved.

Show all comments

New clio release 6.0.2.16 provide new feature for exploring file content on remote server.

clio files --package CrtBase
 
descriptor.json
src\css\driver.min.css
src\js\bootstrap.js
src\js\driver.min.js
 
clio files --package CrtBase --file descriptor.json
 
{
        "bootstraps": [
                "src/js/bootstrap.js"
        ]
}

P.S: Exploring features coming soon to clio explorer with edit mode

2 comments

This is fantastic. I assume this will eventually be available to view package file contents in Clio explorer as well?

Ryan

Ryan Farley,

Yes, we plan to do it in the near future and are already working on it.

Show all comments

New release Clio 6.0.2.11 provide support backend unit tests for Creatio package:

  • Create unit test project
  • Auto add package reference
  • Support run unit tests without Creatio environment for fast CI\CD pipelines

for details see article. Feature is a part of clio workspace and supported by clio explorer.

 

P.S: In this release also contains functionality of saving live logging into file and provide experimental functionality deactivate package for Creatio 8.1.1+

clio deactivate-package PACKAGE_NAME -e ENVIRONMENT_NAME
2 comments

Would love to see some tutorial videos, of have a training on how to maximise the use of Creatio - you guys are doing a lot of great updates recently 🙂

We already provided some video on youtube channel and this link already include in clio explorer and in future this will be grow

 

Show all comments
Idea
Discussion

For monitoring Creatio and debugging your code, Clio and Clio explorer provide Love Logging functionality. You can search and select the logger type to specify the concrete logs producer.

P.S: The latest update of Clio 6.0.2.9 and Clio explorer 2.0.49 provides extended functionality for quick locking and unlocking packages*

* update cliogate are required

0 comments
Show all comments

Hello,



I've made a page with Creatio Freedom UI and need to be able to have 1 button on the page that both adds a record and then redirects the user to a specific page.  It appears I can only have the button do 1 action or the other (save a record or open a specific page).  To do both actions with one button, I instead tried creating a business process for this.  It's adding the record fine but I am having trouble getting it to open a specific page afterwards.  Opening an edit page and choosing the home page I want the user to be directed to does not work and instead.  I think it's because edit pages on a business process are treated like tasks and are not simply a redirect. 



Should I use a script element instead to redirect the user to a specific page after the record is added in the business process or is there a more simple way to do this?

Like 1

Like

2 comments

This can be done with custom code on the Freedom UI page. You'd need to wire up the button to execute a custom request on the page: 

See https://customerfx.com/article/adding-a-button-to-execute-custom-code-o…

Then, in that custom request, you'd need to first save the page:

See https://customerfx.com/article/saving-a-page-before-some-action-on-a-cr…

And then open the other page: 

See (for opening an add or edit page): https://customerfx.com/article/opening-an-edit-page-to-add-or-edit-a-re…

Or (if the page isn't a record page): https://customerfx.com/article/navigating-to-a-page-via-code-in-a-creat…

Ryan

Ryan Farley, thank you so much for this detailed, thoughtful reply and all the articles you've written!  I was able to get the button to save a record and redirect to the desired page after with custom code. 

Show all comments

Hello,



I've made a page with Creatio Freedom UI and need to be able to have 1 button on the page that both adds a record and then redirects the user to a specific page.  It appears I can only have the button do 1 action or the other (save a record or open a specific page).  To do both actions with one button, I instead tried creating a business process for this.  It's adding the record fine but I am having trouble getting it to open a specific page afterwards.  Opening an edit page and choosing the home page I want the user to be directed to does not work and instead.  I think it's because edit pages on a business process are treated like tasks and are not simply a redirect. 



Should I use a script element instead to redirect the user to a specific page after the record is added in the business process or is there a more simple way to do this?

Like 0

Like

1 comments

Hello community!

When we create a Business Process is there C#  code generated automatically that relates to that process ?

If so where and how can I find it ?

I need the answer for debugging purposes.sa

Thank you

Sasori

Like 0

Like

2 comments

Good day,

 

Thank you for your question.

If you are using some custom methods or functions in the business processes, your code should be displayed in the source code of the process:

 

Thank you.

Thank you very much for the response Artem!

I can not see the code that is generated behind the Low-Code elements like 'Add Data' for example ?

Where is that code located , or is it generated during runtime ?

Sasori

Show all comments

Hello

I have this code that checks is a contact/account is inactive or has all the required fields filled in. If this is true, then the user is not allowed to create a new activity.

I need to add another condition for fields in account: if Customer type = "Related account" AND Customer code is not filled in -> the user is not allowed to create a new activity.

Does anybody know how I can do this?

I tried to write it like this but I think that it doesn't read my fields properly.

Thank you!

Like 0

Like

1 comments

Hello,

 

You can review the process in the Activity object from the Exchange package and the UpdateContactAndAccountByParticipant method in it:

If you need to compare actual IDs you can either specify them as new Guid("Id value here") or create a separate source code and specify values there and use this separate source code (like it's done in the DoCollectEmailParticipants method using ActivityConsts source code):

and

Show all comments

Hi guys,

I am working on a custom "ContactFieldConverter" [the thing that splits the Contact's FullName imported by excel/ webserveces etc] in order to split new contact's names into "GivenName" and "Surname", and preventing the OOTB function from filling in the "MiddleName" column.

In order to do so, I created a custom ContactGsFieldConverter in my package and inserted the value of the Separator and Converter in the Lookup "ShowNamesBy" and sysSetting "ContactFieldConverter".

[myContactGsFieldConverter code:]

 

 namespace Terrasoft.Configuration {
	using System;
	using System.Linq;
	using System.Text;
	using Terrasoft.Common;
	using Terrasoft.Configuration;
 
	#region Class: myContactGsFieldConverter
 
	/// <summary>
	/// Contact "Full name" field converter class.
	/// Separates "Full name" string using "Given name Surname" rule.
	/// </summary>
	public class myContactGsFieldConverter : IContactFieldConverter
	{
 
		#region Properties: Public
 
		/// <summary>
		/// Contact "Full name" separator characters array.
		/// </summary>
		private char[] _separator = { ' ' };
		public char[] Separator {
			get {
				return _separator;
			}
			set {
				_separator = value;
			}
		}
 
		#endregion
 
		#region Methdos: Public
 
		/// <summary>
		/// <see cref="IContactFieldConverter.GetContactSgm"/>
		/// </summary>
		/// <remarks>
		/// After splitting <paramref name="name"/> first element will be used as <see cref="ContactSgm.GivenName"/>,
		/// Everything else as <see cref="ContactSgm.Surname"/>.
		/// </remarks>
		ContactSgm IContactFieldConverter.GetContactSgm(string name) {
			var sgm = new ContactSgm();
			if (string.IsNullOrEmpty(name)) {
				return sgm;
			}
 
			var array = name.Split(Separator, StringSplitOptions.RemoveEmptyEntries);
			switch (array.Length) {
				case 0:
					return sgm;
				case 1:
					sgm.GivenName = array[0];
					break;
				case 2:
					sgm.GivenName = array[0];
					sgm.Surname = array[1];
					break;
				default:
					sgm.GivenName = array[0];
					StringBuilder sb = new StringBuilder();
					for (var i = 1; i <= array.Length - 1; i++) {
						sb.AppendFormat("{0} ", array[i]);
					}
					sgm.Surname = sb.ToString().Trim();
					break;
			}
			return sgm;
		}
 
		/// <summary>
		/// <see cref="IContactFieldConverter.GetContactName"/>
		/// </summary>
		/// <remarks>
		/// "Full name" string will be created using "Given name [Middle name] Surname" rule.
		/// </remarks>
		public string GetContactName(ContactSgm sgm) {
			var concatChar = Separator.FirstOrDefault();
			return new[] { sgm.GivenName, sgm.MiddleName, sgm.Surname }.ConcatIfNotEmpty(concatChar.ToString());
		}
		#endregion
	}
	#endregion	
}

The converter is not working. I tried to debug and noticed that my contact converter is returned as null to [this is a method in the Contact c# object]: 

public virtual void SetSgm(Contact contact) {
			if (contact == null) {
				return;
			}
			contact.FillSgmFields(GetContactConverter());
		}

Do you know if I need to do something specific in case of separate-assembly package?

ie: Using a different namespace for the converter/ setting the converter path in a different way within the system setting/ recreate the method on the Contact Object in my custom package.





Thank you in advance!

Like 0

Like

4 comments

Hello Federica,

 

I just completed the test - convertor works in the assembly package as well. The code (since we don't need middle name) was:

namespace Terrasoft.Configuration {
    using System;
    using System.Linq;
    using System.Text;
    using Terrasoft.Common;
    #region Class: UsrCustomContactFieldConverter
    /// &lt;summary&gt;
    /// Contact "Full name" field converter class.
    /// Separates "Full name" string using "Surname Given name" rule.
    /// &lt;/summary&gt;
    public class UsrCustomContactFieldConverter : IContactFieldConverter
    {
        #region Properties: Public
        /// &lt;summary&gt;
        /// Contact "Full name" separator characters array.
        /// &lt;/summary&gt;
        private char[] _separator = { ' ' };
        public char[] Separator {
            get {
                return _separator;
            }
            set {
                _separator = value;
            }
        }
        #endregion
        #region Methdos: Public
        /// &lt;summary&gt;
        /// &lt;see cref="IContactFieldConverter.GetContactSgm"/&gt;
        /// &lt;/summary&gt;
        /// &lt;remarks&gt;
        /// After splitting &lt;paramref name="name"/&gt; first element will be used as &lt;see cref="ContactSgm.Surname"/&gt;,
        /// second element as &lt;see cref="ContactSgm.GivenName"/&gt;
        /// &lt;/remarks&gt;
        ContactSgm IContactFieldConverter.GetContactSgm(string name) {
			var sgm = new ContactSgm();
			if (string.IsNullOrEmpty(name)) {
				return sgm;
			}
			var array = name.Split(Separator, StringSplitOptions.RemoveEmptyEntries);
			switch (array.Length) {
				case 0:
					return sgm;
				case 1:
					sgm.GivenName = array[0];
					break;
				default:
					sgm.GivenName = array[0];
					sgm.Surname = array[1];
					break;
			}
			return sgm;
		}
        /// &lt;summary&gt;
        /// &lt;see cref="IContactFieldConverter.GetContactName"/&gt;
        /// &lt;/summary&gt;
        /// &lt;remarks&gt;
        /// "Full name" string will be created using "Surname Given name" rule.
        /// &lt;/remarks&gt;
        public string GetContactName(ContactSgm sgm) {
            var concatChar = Separator.FirstOrDefault();
            return new[] { sgm.Surname, sgm.GivenName }.ConcatIfNotEmpty(concatChar.ToString());
        }
        #endregion
    }
    #endregion
 
}

and then this convertor was registered in the database (ShowNamesBy table). As a result newly created contacts where full name is Test 1 2 had the first (Test) and last (1) name only while middle name was skipped.

Hi Oleg Drobina,

Could you share with me the record registered in the database table ShowNamesBy for a separate assembly pkg?

Hence, in case the site receives a Contact "Name": "Federica Rose Cattani" I don't want to "lose" the "MiddleName" but I want it to be concat to the "Surname". That's what I did in the converter shared. 

Federica,

 

Hi,

 

Sorry, I guess I was wrong with the package. Tested the same approach today and it didn't work until I unchecked the "Compile into separate assembly" checkbox in the package settings. So in your case you need to also do the same to make the converter work.

 

The insert was:

INSERT INTO ShowNamesBy (Name, Separator, Converter) VALUES (N'UsrCustomContactFieldConverter', N' .,;', N'Terrasoft.Configuration.UsrCustomContactFieldConverter');

 

Oleg Drobina,

Ok! In my case I can't "undo" the separate assembly since it contains customer's implementation and separate assembly it's way faster to compile.

The actual possible workaround would be to implement a second package without separate assembly containing only the custom ContactGsFieldConverter, am I correct?

Show all comments