I am developing a business process that takes data from an API and inserts it into an object.
I have some parameters created in it and I need to make some improvements to be able to insert them.
The parameters in question are the following, UserName = Text and UserApi = Lookup (Based on Contact)
I am trying to relate the username with the userapi lookup so that later this userapi is inserted into the contact lookup in the destination object:
// Obtener la fecha de la API, puede ser un string o "false"
string fechaApi = Get("FechaApertura");
string XStudioUsuarios = Get("XStudioUsuarios");
string ExpectedRevenue = Get("ExpectedRevenue");
string UserName = Get("UserName");
Guid UserApi = Get("UserApi");

// Declarar la variable para almacenar la nueva fecha
DateTime fechaNueva;
int XStudioUsuariosInt;
int ExpectedRevenueInt;

if (!string.IsNullOrEmpty(UserName) && UserName != "false") {
   Set("UserApi.Name", UserName);
}

if (fechaApi != "false") {
   // Intentar parsear el string de fecha a DateTime
   if (DateTime.TryParse(fechaApi, out fechaNueva)) {
       // Establecer la nueva fecha si el parseo fue exitoso
       Set("FechaAperturaNueva", fechaNueva);
   }
}

if (XStudioUsuarios != "false") {
   // Intentar parsear el string a int
   if (int.TryParse(XStudioUsuarios, out XStudioUsuariosInt)) {
       // Establecer el nuevo valor si el parseo fue exitoso
       Set("XStudioUsuariosInt", XStudioUsuariosInt);
   }
}

if (ExpectedRevenue != "false") {
   // Intentar parsear el string a int
   if (int.TryParse(ExpectedRevenue, out ExpectedRevenueInt)) {
       // Establecer el nuevo valor si el parseo fue exitoso
       Set("ExpectedRevenueInt", ExpectedRevenueInt);
   }
}

return true;

Like 0

Like

3 comments

One of the options is to use the ORM. The idea here is to first check if the received text value is already present in the lookup or not. To do that perform a simple select from the entity of the lookup and check if there are values there that are the same as the received text value. Examples of retrieving data can be found here. If the value is present in the lookup - set the Id of that lookup record for your main record lookup column (as described in the examples here).

 

If the value doesn't exist in the lookup - create it and then set the Id of the created lookup record as the value for the lookup column in your main record.

Oleg Drobina,

Thanks Oleg, what you describe is exactly what I need to do, but I still don't know how I can do it.

Oleg i do this Code with the information than you gave me:


string fechaApi = Get<string>("FechaApertura");
string XStudioUsuarios = Get<string>("XStudioUsuarios");
string ExpectedRevenue = Get<string>("ExpectedRevenue");
string UserName = Get<string>("UserName");
Guid UserApi = Get<Guid>("UserApi");


DateTime fechaNueva;
int XStudioUsuariosInt;
int ExpectedRevenueInt;

if (!string.IsNullOrEmpty(UserName) && UserName != "false") {
    
   var esq = new EntitySchemaQuery(UserConnection.EntitySchemaManager, "Contact");
    var idColumn = esq.AddColumn("Id");
    esq.Filters.Add(esq.CreateFilterWithParameters(FilterComparisonType.Equal, "Name", UserName));
    var entityCollection = esq.GetEntityCollection(UserConnection);
    
    // Verificar si se encontraron resultados
    if (entityCollection.Count > 0) {
        var entity = entityCollection[0];

        var userApiLookup = new {
           Value = entity.GetTypedColumnValue<Guid>(Id.Name),
           DisplayValue = entity.GetTypedColumnValue<string>(Name.Name)
       };
    
        // Establecer el objeto Lookup en UserApi
        Set<Guid>("UserApi", userApiLookup);
    } 
}

if (fechaApi != "false") {
   // Intentar parsear el string de fecha a DateTime
   if (DateTime.TryParse(fechaApi, out fechaNueva)) {
       // Establecer la nueva fecha si el parseo fue exitoso
       Set<DateTime>("FechaAperturaNueva", fechaNueva);
   }
}

if (XStudioUsuarios != "false") {
   // Intentar parsear el string a int
   if (int.TryParse(XStudioUsuarios, out XStudioUsuariosInt)) {
       // Establecer el nuevo valor si el parseo fue exitoso
       Set<int>("XStudioUsuariosInt", XStudioUsuariosInt);
   }
}

if (ExpectedRevenue != "false") {
   // Intentar parsear el string a int
   if (int.TryParse(ExpectedRevenue, out ExpectedRevenueInt)) {
       // Establecer el nuevo valor si el parseo fue exitoso
       Set<int>("ExpectedRevenueInt", ExpectedRevenueInt);
   }
}

return true;
 

Show all comments

In the dashboards, I'm trying to create a stacked chart. I want to show the count of opportunities by stage by market. I don't know if this is possible or not, but I cannot seem to get it working. The x-axis is showing the opportunity stage and then the data would show the count by market for each stage. Please let me know what I am doing wrong, so we can get this to show. Thanks.

Like 0

Like

5 comments
Best reply

Adam Praiswater,

 

Hi! 

You correctly added series to your dashboards, now to display them according to the market you can add filtration to each series for certain market. 
 

For example:
1 series: market = 'market value'

2 series: market = 'market value'

 

Leave the grouping by Stage and you should achieve your goal.

Have a great day!

Hello,
 

Can you provide the screenshot with the configured chart?

 

 

Malika,

Current set up -

But want each stage to show by the division of market. I have tried to add a second series but that just doubles the number like so but it doesn't let me change the how to group or am I doing something wrong? -

 

Malika,

Does that help and/or make sense what I am trying to achieve?

Adam Praiswater,

 

Hi! 

You correctly added series to your dashboards, now to display them according to the market you can add filtration to each series for certain market. 
 

For example:
1 series: market = 'market value'

2 series: market = 'market value'

 

Leave the grouping by Stage and you should achieve your goal.

Have a great day!

Alina Yakovlieva,

Thank you for your help with this!

Show all comments

I want to create a report which prints all Lead records. For example, Leads in a particular stage, Leads created in last month etc 

Like 0

Like

1 comments

Hi,

 

Printed forms work so that they print the information contained in a single record of a section. One section record equals one report. If the task is to include information about multiple lead records in one report, it is better to create a separate section for this purpose, where you can add fields and details that will reference specific records via reverse relationships. This way, you can include data from multiple records in the report.

Printable forms are generated as one document per section record. If you want to implement your own logic for working with printed forms using development tools, you can look into the client schema "PrintReportUtilities," which interacts with "ReportService" on the server side. 

It would be best if you implemented something similar to ReportService.

Show all comments

Hello all,
I'm trying to add a custom component to Creatio, and I was following along with the guide then it mentions accessing the file system, which I don't really know how to do, and if possible at all while working with Creatio on the cloud ?
The doc: https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platfor…

Like 0

Like

6 comments

Hello,

 

As stated in the article

 

  • FSD of C# code is possible only by interacting with the on-site Creatio database.

 

You won't be able to access the cloud-hosted application's file system.

Assuming you're referring to creating a custom javascript UI component, correct?

You can create a local workspace for on on-site Creatio to create the custom component using Clio. Documentation and tutorials on how to do this is sparse. There are some very short videos on this topic here: https://www.youtube.com/watch?v=CE5uETqTsyQ&list=PLnolcTT5TeE2BMFf_XmJrSwpnbcLCLJkb&index=1

The documentation here also refers to steps you can use Clio for as well: https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/front-end-development/freedom-ui/remote-module/implement-a-remote-module/overview

Ryan

Oleg Drobina,

Thanks for the answer! that clears it up !

Ryan Farley,

Thank you for your reply!
Yes I mean custom javascript UI component. But if I'm understanding correctly, even Clio utility works only with on-site Creatio, right ?

Youness Youki,

No, Clio is not just for on-site - it allows you to work with a cloud hosted Creatio as well. A Clio workspace allows you to create a UI component & package on your local machine and push it to a cloud hosted system. The video I linked to shows the steps to do this (create a Clio workspace, connect it to a cloud Creatio system, create a UI component and then push the package from your local machine to the cloud system). 

Ryan

I see! I'll try it then.
Thank you !

Show all comments

I have a parameter within my business process that is a text, named UserName. On the other hand, I have an AddData that has a Lookup called CreatedBy. I need to relate the user name to the user name of this Lookup. That is, if the user name exists in the lookup, I assign this value to it.

Like 0

Like

1 comments

Greetings,
 

You can implement this using a parameter in the business process.


Below, I have provided an example of such an implementation. Please note that this is an example implementation, and you will need to adapt the business process to fit your business idea.




In my case, I pass a user as a parameter who is "TestDocum"; in this case, the process will follow the path to True.


If I pass another value, such as "Ser," the process will follow the path to False and terminate.


I hope this example helps you implement your business idea.
 

Best regards, 

Orkhan

Show all comments

Hi All,

 

How can I set Date field - "Closed On" blank using BP ?

 

 

Thanks.

Like 0

Like

1 comments
Best reply

Hello, you can clear the date column by setting it's value as: null

Ryan

Hello, you can clear the date column by setting it's value as: null

Ryan

Show all comments

Hi, 

 

Is it possible to add a datetime quick filter to a grid, where you set a time to the filer?

 

Thank you. 

Like 0

Like

3 comments
Best reply

Javier Collazo,

 

We have double checked it with the responsible team and unfortunately, it is not possible to setup Time specifically in this filter. The issue here is that name Date/Time is confusing for the users and therefore we have registered this problem for our R&D team to either change the filter name or add the ability to also apply a filter by time.

Hello,

 

You can find the instructions on how to set up a date/time quick filter in this academy article.

Thank you Mira for your answer, but I already tried what is in the guide and it does not include the time in the filter. 

 


I need to be able to filter by time too. 

Javier Collazo,

 

We have double checked it with the responsible team and unfortunately, it is not possible to setup Time specifically in this filter. The issue here is that name Date/Time is confusing for the users and therefore we have registered this problem for our R&D team to either change the filter name or add the ability to also apply a filter by time.

Show all comments

Hello Community,

 

            I have created a business process using a script element that relies on "Newtonsoft.Json.Linq". 

 

 

Scenario 1 : When I add the business process to a custom package, it works perfectly. As shown in below Image

 

#Issue

Scenario 2 : When I add the business process to my app package "UsrG***", it throws an error during publishing due to the Linq dependency.

 

Let me know if you need any more adjustments!

 

Regards,

Ajay K

 

 

Like 0

Like

2 comments
Best reply

Hello,
 

This situation can occur if your custom "UsrG***" package has the "Compile into a separate assembly" attribute.

Compile

When converting a package to assembly package (AP), transferring a schema with code to a AP, or creating a version of a compiled process, the compilation error "The type or namespace cannot be found" occurs if the code uses types from external libraries located in other packages.
To solve your problem, deselect the "Compile into a separate assembly" checkbox for your package and recompile. This should solve the problem.

remove parameter
 

Thank you.

Hello,
 

This situation can occur if your custom "UsrG***" package has the "Compile into a separate assembly" attribute.

Compile

When converting a package to assembly package (AP), transferring a schema with code to a AP, or creating a version of a compiled process, the compilation error "The type or namespace cannot be found" occurs if the code uses types from external libraries located in other packages.
To solve your problem, deselect the "Compile into a separate assembly" checkbox for your package and recompile. This should solve the problem.

remove parameter
 

Thank you.

Serhii Parfentiev,

Thank you.

Show all comments

When making changes to the section list and/or section pages for the mobile app, should I create a new packages or is it ok to leave the current package as "custom" and make the changes via the mobile application wizard?

Like 0

Like

1 comments

Hi!

It is normal to leave the current package as "custom". You can change the package only if you want to keep some functionality in a separate package. 

Best regards, 
Anton

Show all comments

I am connecting a third-party API to Creatio, it delivers different types of data including this:
"user_id": [
60,
"Luismary Mendez"
]
In the parameters of the Creatio response I have set it as an Array Text and as an Object

 

But when I try to connect this variable to the process it does not display it in the list of possible result values.

The field is Vendedor:

Like 0

Like

5 comments

This is because the user_id is an array in the payload received from the web service, not just a single value. If you know the array will only contain a single set of values and the first value in the user_id array will always be the integer Id and the second value will always be the text name, you could flatten them out by mapping them as text and integer values:

  • Map ID as: user_id[0]
  • Map Name as: user_id[1]

Ryan

Ryan Farley,

What you're telling me is that I have to set the user_id as an object?

You could, but that doesn't pass to a subprocess (with an array inside an array). If you are able to flatten it out and if you know the array will only contain a single set of values and the first value in the user_id array will always be the integer Id and the second value will always be the text name, that will pass easily to a subprocess. Like this for the "user_id" first element in array, which is an int from what you've shared:

The second value in the user_id array, which is a string from what you've shared, would look like this:

This is assuming your JSON looks like this:

{
	"result": [
		{
			"id": "someid",
			"name": "somename",
			"user_id": [
				60,
				"Some name"
			]
		}
	]
}

You're basically changing it from an array with an int in index 0 and string in index 1 to flattened out properties pointing to the value in index 0 and index 1. This is, of course, assuming that the user_id array will only contain an int at index 0 and a string at index 1.

Ryan

Ryan Farley,

Thanks Ryan, I understood your explanation, I will apply it and let you know how it goes.

Carlos Soto,

Thanks Ryan. It's works

Show all comments