Hi community !

 

In a custom object, I have a list of contact objects. On a specific signal, I need to loop over these contacts and change the attributes of each contact based on other attributes found in the contact object. How can I achieve the for loop with a business process?



If the only way is to use the Scripts element, where can I find proper documentation to start using Scripts in Creatio?

 

Like 0

Like

5 comments
Best reply

Dear Julien,

 

Thank you for your question!

 

The best way to create a Business Process with a for loop you would need to create a sub-process:

 

 

Signal "Contact Added" element: 

Read Data "Read Contact" element:

 

 

For the sub-process, you would need to specify the [Parameters] of it:

 

 

And make a filter of the element within the sub-process based on the ID:

And finally, you would need to specify this parameter in the parent Business Process:

 

This is it. The business process here would trigger upon a Contact being added, then it would fetch 50 top Contacts in the system and transfer them to the sub-process, which will do some required magic within it, and then would end.

You may customize this example in any way you would like.

 

You may also find these academy Articles useful:

 

https://academy.creatio.com/docs/user/bpm_tools/process_elements_refere…

 

https://academy.creatio.com/docs/user/bpm_tools/bpm_process_examples/us…

 

Hope this helps!

 

Thank you!

 

Regards,

 

Danyil 

Hello Julien,

A common way to loop through records in a process is to use a flag field to mark the records to loop through and then un-flag them to move to the next record in the loop. See https://customerfx.com/article/how-to-loop-through-records-in-a-process…

Another method to do this is to read a collection of records that get passed to a sub-process. The sub process gets called for each record in the collection. See https://customerfx.com/article/working-with-a-collection-of-records-in-…

Ryan

Dear Julien,

 

Thank you for your question!

 

The best way to create a Business Process with a for loop you would need to create a sub-process:

 

 

Signal "Contact Added" element: 

Read Data "Read Contact" element:

 

 

For the sub-process, you would need to specify the [Parameters] of it:

 

 

And make a filter of the element within the sub-process based on the ID:

And finally, you would need to specify this parameter in the parent Business Process:

 

This is it. The business process here would trigger upon a Contact being added, then it would fetch 50 top Contacts in the system and transfer them to the sub-process, which will do some required magic within it, and then would end.

You may customize this example in any way you would like.

 

You may also find these academy Articles useful:

 

https://academy.creatio.com/docs/user/bpm_tools/process_elements_refere…

 

https://academy.creatio.com/docs/user/bpm_tools/bpm_process_examples/us…

 

Hope this helps!

 

Thank you!

 

Regards,

 

Danyil 

Thank you very much !

 

Danyil Onoprienko,

I tried creating a for loop by using a flag but there the process stops after 100 records because there is a limit to each element.

If I'll create the subprocess option, will that resolve the problem?

Thanks,

Chani

Hi Chani,

In the process parameter you can specify the maximum repetition number for the process. If you put nothing, it will read the all collection.

 

Late answer !

nico

Show all comments

Hi,

 

I have added Aspose.PDF plugin to convert the Word to PDF printables. I have generated the 'Client ID' and 'Client Secret' as suggested in the guide.

Where do I key in these Client ID and Client Secret in System Settings? I am getting this notification -  'Please fill in the system settings for converting files to PDF'

 

Thanks,

Madhuri

 

Like 0

Like

1 comments

Hello Madhuri,

 

 

Log in to Creatio, go to 'System Designer' → 'System settings' section, find and fill out the respective system settings. Log out and log back in to apply the changes.

Show all comments

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

Dear community,

We have a lookup table with 4 columns -A,B,C,D

Once a lookup record is added and saved, columns B & C must not be editable. Is there a way to achieve this for this specific lookup?

In latest versions, I see that read only setup has been removed from object configuration.

 

Thanks in advance!

Like 0

Like

1 comments

Hello Shivani,

 

Making a (lookup) column editable on the record page only under specific conditions is possible with a help of business rules for a specific section. 

 

As for the lookup (lookup object) itself it's possible to set column permissions for a specific user or roles as on the screenshot 1:



However, as of now, it's not possible to lock columns for a specific lookup dynamically (after adding the record to a lookup itself) with a help of basic system tools. 



We have registered a corresponding query for our R&D team and will be awaiting for the implementation of the mentioned functionality in the upcoming versions. 

 

Best regards, 

Anastasiia

Show all comments

Hello,

 

I'm currently dealing with an issue similar to the one outlined in this post:

https://community.creatio.com/questions/searching-user-fields

 

I have been able to confirm that checking the "Indexed" box on a custom field will allow me to search on that column in the global search. However, the column that I actually need to be able to search is an Unlimited length text field. When I attempt to publish the entity, I receive the following error:

 

I believe the reason for this error is that it's attempting to add the new index to some table using the above stored procedure, but the index wasn't created due to the size constraints on non-clustered indexes outlined at the Microsoft link below. It's a fairly large page and the relevant part is this: "The maximum allowable size of the combined index values is 900 bytes for a clustered index, or 1,700 for a non-clustered index"

https://docs.microsoft.com/en-us/sql/t-sql/statements/create-index-transact-sql?redirectedfrom=MSDN&view=sql-server-ver15

 

Is there a way to index an unlimited length text field in the global search results?

Or can I bypass having to create an index on the field but still have the Elastic Search pick it up?

 

Thanks.

Like 0

Like

1 comments

Hello Daniel,

 

We have received a reply from our R&D that indexing unlimited length text fields by checking the 'indexed' box will not work. To do this you will need to do the following:



1. Add a column

2. Compile the appllication

3. Run the following script in the browser console under the Supervisor user:

require(["ServiceHelper"], (ServiceHelper) => { ServiceHelper.callService("IndexingConfigService", "SendIndexationConfigs"); });



Then create a new record and after some time the record will be indexed by the created column.

 

Best regards,

Max.

Show all comments

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

Hello Community,

I have a use case where Creatio App needs to be connected to a 3rd party system always. Please help with following questions



1. How to trigger source code that establishes the connection with the 3rd party system? Its possible to run a Business Process, but if there is any other way, it could help.



2. How to get AppConnection/ Userconnection? Since the code is not triggered from client/Business process or API service (no inheritance from BaseService), how can I get the AppConnection?



Would much appreciate your help!

Like 0

Like

4 comments

Hello Shivani, 

 

1. Usually such operations performing with Business Processes and script tasks and honestly we don't have much convenient options for that. 

 

2. Script tasks exist for this kind of operations. You may use next code to achieve your requirements: 

 

var userConnection = Get<UserConnection>("UserConnection");

 

Also please check out this link with web-services it might be useful: 

 

https://academy.creatio.com/docs/developer/back-end_development/configu…

 

Thank you!

Regards, 

Bogdan L.

Thank you Bogdan. I found a post: https://community.creatio.com/questions/esq-application-access-rights

 

and it advices to get systemUserConnection as follows :

private SystemUserConnection _systemUserConnection;
private SystemUserConnection SystemUserConnection {
	get {
	     return _systemUserConnection ?? (_systemUserConnection = 
        (SystemUserConnection)AppConnection.SystemUserConnection);
	}
}

 

But looks like AppConnection is not a static class and I get the error in IDE as below. Please advice if I am doing something wrong or if the above suggestion does not work





In short passing the user connection from script task to call a source code or using BaseService for Web APIs is the only way to get userconection? 

 

Shivani Lakshman,

 

Please use User Connection from the script task to achieve the task desired.

 

Best regards,

Oscar

Update : One can create a new source code schema with a class that inherits from AppEventListenerBase.

The class has UserConnection as a property.  The UserConnection can be set using methods given in the code below. The onAppStart is called everytime IIS (webserver) is restarted or after compilation. 

// Property
protected UserConnection UserConnection	{
	get;
	private set;
	}
 
public override void OnAppStart(AppEventContext context) {
            base.OnAppStart(context);
            UserConnection = GetUserConnection(context);
            SetupConsumerJob();
        }
 
 
protected UserConnection GetUserConnection(AppEventContext context)    {
            var appConnection = context.Application["AppConnection"] as AppConnection;
            if (appConnection == null) {
                throw new ArgumentNullOrEmptyException("AppConnection");
            }
            return appConnection.SystemUserConnection;
        }







 

Show all comments

Hello Team!

 

I need to hide one filed based of the selection of one category lookup. I follow the academy  with the steps for the rule type. But my question is whats happend when you have more values in a OR condition. I tried to placed all the conditions in the same rule and didn't work and as well like in the example separate, but only the last one is working. How is the correct process in this case?

 

Thanks,

 

Like 0

Like

1 comments

Hello Federico, 

 

We performed some tests in order to achieve your requirement, but it seems like such implementation is not possible for now. The only one business rule will be active in this case. We already informed our Core R&D team and we will work to add such functionality in our next releases. Thank you for understanding!



Best Regards, 

 

Bogdan L.

Show all comments

I need to add a fax field on contact object but have that synchronized with ContactCommunication detail (Communication Options). Just like, when a mobile number is added to communication options it automatically updates contact.mobile and vice versa. 

Ideas on how to do it? 

Like 0

Like

6 comments

Hello kumar,

First of all, you'll need to enable the fax communication type for contacts in the Communication option types lookup. See https://share.customerfx.com/GGuWjxy7

Then, once you've added the contact field for Fax on the contact, you can keep it in sync with a process or use an entity event sub-process in the Contact and ContactCommunication objects. The process route is pretty straight forward, however, in order to see it update in the other place right away, you'll want to send a message from the process to the page so you can reload the page and see the change. See https://customerfx.com/article/how-to-refresh-a-page-from-a-process-in-…

Hope this helps

Ryan

Ryan Farley,

Thank you for your reply. 

In the case of contact's phone or email field change on the contact page, the add/edit in contact communication details happen even before save button is clicked. Can such thing be implemented for Fax field as well? 

On account page, unlike contact object, fax field came with out of the box and behaves intuitively, change in account.fax changes right account communiction option right there even before save button is clicked. 

 

Do you think that is not possible with Fax field on Contact? 

Hello Kumar, 

 

The Account object has a base lookup "Fax" field, which can be added to the left panel of the record page and for which the "connection" with the "Communications options"  detail is implemented in a base code, so while changing the value in the column on the left panel the corresponding value will be reflected in the detail (same as for "Email" or "Phone"). However, you can use the "Fax" option for the Contacts record after it's added to the lookup "Communication option types" in the "Communications options"  detail but it won't create "Fax" field for the Contact object. Even after such field is added to the Contact object manually, it still requires the "connection" between field and detail to be implemented by code. As of now, there is no way to implement such functionality only with basic system tools and development is needed.

As a workaround suggestion,  you can proceed with a variant provided by Ryan. 

From our side, we have already registered the corresponding query for our R&D team and will be awaiting for the implementation of the mentioned functionality in the upcoming versions. 

 

Should you have any questions, please let us know!



Best regards,

Anastasiia 

kumar,

Hello kumar. I've not tested this yet, so not 100% sure this will work, but I believe you could do the following and it should work the same as the account page does.

  1. Create a replacing view module for "ContactCommunicationDetail"
  2. Add the following code:
define("ContactCommunicationDetail", ["ConfigurationConstants"], function(ConfigurationConstants) {
	return {
		methods: {
			initMasterDetailColumnMapping: function() {
				this.callParent(arguments);
 
				var mappings = this.get("MasterDetailColumnMapping");
				mappings.push({
					"CommunicationType": ConfigurationConstants.CommunicationTypes.Fax,
					"MasterEntityColumn": "UsrFax" // change this to whatever your Fax column is called on Contact
				});
				this.set("MasterDetailColumnMapping", mappings);
			}
		}
	};
});

That should handle the value getting updated from the communication options detail to the Contact.

Then, on the ContactPageV2 code,

  1. Wire up a change event for the Fax column - see https://customerfx.com/article/triggering-an-event-when-a-field-is-chan…
  2. In the methodName for the change event use the method name "syncEntityWithCommunicationDetail"

Ryan

Thank you Ryan, I actually did the change very close to what you suggested. It works for the UI part of the logic as expected but the Fax field isn't getting saved in the contact object when 'Save' is clicked. 

 

Can't figure out why. 

 

Fax on ContactCommunication is getting updated but fax on contact object is not. The fax field is not passed to the UpdateQuery for contact when Save is clicked. 

Show all comments

Anyone know why I get this error after I cloned a copy of my prod creatio site and created a test instance. I have Sales on-prem 7.15.2

Error

An error has occurred when working with the repository

Unable to connect to a repository at URL 'https://xxxx/masked/xxx'

SvnErrorCode: SVN_ERR_RA_CANNOT_CREATE_SESSION

RootCause: Error running context: APR does not understand this error code

Like 0

Like

2 comments

Hello Kumar,

 

Possible reasons are incorrect proxy settings or other parameters of the SVN server, incorrect URL to which you are trying to connect.

 

To understand where the error occurred, try connecting to the server not from the application or from the browser to the web interface, but from another program for working with SVN (for example, through the TortoiseSVN Repository Browser). If the error is reproducible, then the problem is in the infrastructure, not in the application.

 

Best regards,

Bogdan.

Thank you for the response. 

It was indeed an infrastructure issue. The IIS server not able to talk with SVN. 

Show all comments