Время создания
Filters

Hello.

 

I'm trying to save a pdf file that i get from a service web, the file comes in a base64 string so i use a script to convert it to a pdf and save it in Creatio, I have this code that works fine for the Accounts section but when i want to save the file in  a Custom section, the process send me an error sometimes because it doesnt find the Id other because it says that the duplicate key value violates unique constraint.

 

This is the code that works in the Accounts Section.

 

var base64FileString = Get<string>("Base64File");
var accountId = Get<Guid>("AccountId");
 
var attachFileType = new Guid("529bc2f8-0ee0-df11-971b-001d60e938c6");
var fileName = Get<string>("NameFile"); // set proper file type
 
var entity = UserConnection.EntitySchemaManager.GetInstanceByName("AccountFile");
var fileEntity = entity.CreateEntity(UserConnection);
fileEntity.SetDefColumnValues();
fileEntity.SetColumnValue("AccountId", accountId);
fileEntity.SetColumnValue("TypeId", attachFileType);
fileEntity.SetColumnValue("Name",fileName);
fileEntity.SetBytesValue("Data", Convert.FromBase64String(base64FileString));
fileEntity.Save();
return true; 

 

And this is the code that I want to use in the custom section

 

var base64FileString = Get<string>("Base64File");
var resguardoId = Get<Guid>("ResguardoId");
 
var attachFileType = new Guid("529bc2f8-0ee0-df11-971b-001d60e938c6");
var fileName = Get<string>("NameFile"); // set proper file type
 
var entity = UserConnection.EntitySchemaManager.GetInstanceByName("SysFile");
var fileEntity = entity.CreateEntity(UserConnection);
fileEntity.SetDefColumnValues();
fileEntity.SetColumnValue("ResguardoId", resguardoId);
fileEntity.SetColumnValue("TypeId", attachFileType);
fileEntity.SetColumnValue("Name",fileName);
fileEntity.SetBytesValue("Data", Convert.FromBase64String(base64FileString));
fileEntity.Save();
return true; 

 

 

Like 0

Like

4 comments

The SysFile entity doesn't, and won't, have a "ResguardoId" column. It has generic columns so it can work with any entity. Instead of setting ResguardoId, set the following: 

  • RecordId - the Id of the record (the value for ResguardoId)
  • RecordSchemaName - the name of the entity for the RecordId (whatever the entity name is for ResguardoId)

Ryan

Ryan Farley,

 

Thank you 

 

I'm made the change, the process starts without any error but the file is not save it in the record.

 

var base64FileString = Get&lt;string&gt;("Base64File");
var recordId = Get&lt;Guid&gt;("RecordId");
 
var attachFileType = new Guid("529bc2f8-0ee0-df11-971b-001d60e938c6");
var fileName ="New.pdf"; // set proper file type
 
var entity = UserConnection.EntitySchemaManager.GetInstanceByName("SysFile");
var fileEntity =  entity.CreateEntity(UserConnection);
fileEntity.SetDefColumnValues();
fileEntity.SetColumnValue("RecordId", recordId);
fileEntity.SetColumnValue("TypeId", attachFileType);
fileEntity.SetColumnValue("Name",fileName);
fileEntity.SetBytesValue("Data", Convert.FromBase64String(base64FileString));
fileEntity.Save();
return true; 

Laura Jurado,

You also need to populate the RecordSchemaName property - refer back to my previous comment.

Ryan

Show all comments

Hi. Is it possible to make the lookup fields of a record clickable in an editable detail?

Like 0

Like

2 comments

Hello,

In order to make the lookup fields of a record clickable, you need to set the Lookup view type to "Selection window." When the Lookup view type is set to "List," the records are not clickable.

image.png

Best regards,
Antonii.

Antonii Viazovskyi,

Hello. What's most interesting is that the value of this field is selected in the Window. And it's still not clickable. Maybe there's an option to hardcode this into the detail code?

Show all comments

Hello Community,

I am currently facing an issue with a model page that contains two lookup fields: one for contact and the other for email. My goal is to allow the user to select an email address associated with the selected contact, not just the primary email, but any email linked to that contact. To achieve this, I am using dynamic filtering for ContactCommunication to filter by the current contact and email communication type.

I’ve implemented this logic within the crt.LoadDataRequest handler because the email field is a simple dropdown and does not open a separate selection page.

The problem: 
When a contact is selected, I refresh the email list data source as expected. However, the email list is not properly reloading after a contact is deselected and reselected. In this case, the email filters do not update correctly. The issue is that the email list only reloads and applies the correct filters when I manually reselect the email field.

This behavior is causing a problem where the email dropdown is not correctly filtered based on the newly selected contact. Below is the code I am using for the handler:
 

handlers: /**SCHEMA_HANDLERS*/[
 {
   request: "crt.LoadDataRequest",
   handler: async (request, next) => {
     const emailDataSource = "UsrEntity_004572bDS_UsrEmailAddre_gzbqqxc_List_DS";
     const contactDataSource = "UsrEntity_004572bDS_UsrContact_7esmp6a_List_DS";

     if (request.dataSourceName === emailDataSource) {
       const lookupValue = await request.$context.UsrEntity_004572bDS_UsrContact_7esmp6a;
       console.log("Lookup Value:", lookupValue);

       if (lookupValue) {
         console.log("Filter Hit");
         const filter = new sdk.FilterGroup();
         filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "Contact", lookupValue.value);
         filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "CommunicationType", "EE1C85C3-CFCB-DF11-9B2A-001D60E938C6");

         const newFilter = Object.assign({}, filter);
         newFilter.items = filter.items;
         console.log("Filter created");
         request.parameters.push({
           type: "filter",
           value: newFilter
         });
         console.log("Filter added to request");
       } else {
         console.log("Empty Lookup");
         // request.$context.UsrEntity_004572bDS_UsrEmailAddre_gzbqqxc = null;
         // request.$context.UsrEntity_004572bDS_UsrEmailAddre_gzbqqxc_List_DS = null;
       }
     }

     if (request.dataSourceName === contactDataSource) {
       console.log("Contact Selected, reloading email address list");
       // request.$context.UsrEntity_004572bDS_UsrEmailAddre_gzbqqxc = null;

       await request.$context.executeRequest({
         type: "crt.LoadDataRequest",
         $context: request.$context,
         config: { loadType: "reload", useLastLoadParameters: true },
         dataSourceName: emailDataSource
       });

       console.log("Email list reloaded successfully!");
     }

     return await next?.handle(request);
   }
 }
]/**SCHEMA_HANDLERS*/;
 

I would greatly appreciate it if you could look into this issue and suggest a solution.

Thank you!

Like 1

Like

0 comments
Show all comments

Hi team,

We want to add a button in communication panel through which cases section should open in the side pane ( opens on clicking of buttons in communication panel) through with cases can be created quickly without closing the current section page opened in the tab.

 

We have created button in communication panel but we are finding references to open the page in side pane.

if anyone of you can help on this ,I will really appreciate it.

 

Thanks in Advance

Like 0

Like

7 comments
Best reply

Kashish Shakeel,

For Classic, it's doable, but definitely not as easy (there is not a no code approach for classic shell, only for Freedom shell). If you're using classic shell, best approach is to look at the code for the other panels and duplicate for your needs.

Ryan 

Hello Kashish,

Thank you for your question. First of all, are you using the Shell of Freedom UI in the section from which you are opening the side panel? Secondly, while I believe that creating a case from the side panel is possible, I'm not sure if your logic can be fully implemented. Also, would it be easier to create the case using a modal page in your section?

I'll be happy to assist you and will be waiting for your response.

The Academy refers to those as sidebars and they can be created with no code (more or less) in Creatio 8.1.3 and higher. See https://academy.creatio.com/docs/8.x/no-code-customization/customization-tools/ui-and-business-logic-customization/set-up-a-sidebar

Ryan

Yevhenii Grytsiuk,

 

Thankyou you your reply currently we are using the classic UI,we are not using Shell of Freedom UI in the section.

 

The requirement is to create  a quick access option for creating cases without needing to jump on another page and also in a way that  the information from the current open page can be visible properly as it is going to help in case creation.
 

The best that we thought of was using side panel for case creation while the user can see all information in the current open page.Is there any way you can help me achieve that?

 

 

Yevhenii Grytsiuk,

 

Ryan Farley,

 

Thank you for your reply, we are looking for some information on the same topic in the classic UI.

 

Is there any reference for classic UI? f yes can you please share that information with me?

Kashish Shakeel,

Answering question for Ryan - I am almost certain that, unfortunately not. That's why I was asking if you are using shell or freedom ui. However it is still possible to create a modal/minipage regardless.

Kashish Shakeel,

For Classic, it's doable, but definitely not as easy (there is not a no code approach for classic shell, only for Freedom shell). If you're using classic shell, best approach is to look at the code for the other panels and duplicate for your needs.

Ryan 

Ryan Farley,

 

Hi,

thankyou for your reply we will try to implement customized code.

 

Show all comments

Hello,

 

I would like to know how to approach the task of extracting the model of field entities to a CSV  or Excel file.

The idea is to provide project managers with a simplified view of the fields available in my Creatio instance. I'm not looking for details, just the field name, code, label (translation?), data type.

 

Any sugestions on how to approach this task?

 

Thanks,

Vlad 

Like 0

Like

4 comments
Best reply

This marketplace addon will provide you with an Excel export of all obejcts in the system, along with columns, data types, display titles of objects and columns, etc. 

https://marketplace.creatio.com/app/object-structure-export-creatio

Once installed, there will be a process you can run that gives you the Excel file. 

Ryan

Hello!

 

You can check all the information about data export on Creatio Academy:
https://academy.creatio.com/docs/8.x/creatio-apps/creatio-basics/business-data/exporting-list-data-to-excel

Thank you for your reply Arsenii, but it is not the data that I am trying to export, but the model.

 

Exemple for Accounts entity:

 

field name; field code; field label; data type; default value

Name; Name; The company name; Text - 250 caracters; <empty>

Phone; Phone; Main phone number; Text - Phone number; <empty>

Web; Web; Compny Website; Text - Web link; <empty>

(...)

 

Kind regards,

Vlad

 

This marketplace addon will provide you with an Excel export of all obejcts in the system, along with columns, data types, display titles of objects and columns, etc. 

https://marketplace.creatio.com/app/object-structure-export-creatio

Once installed, there will be a process you can run that gives you the Excel file. 

Ryan

Ryan Farley,

Perfect, I'll give it a try. 

 

Thank you,

Vlad

Show all comments