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

Hi all,

I have a process where a user selects a contact folder from a list on a preconfigured page. A sub process then needs to run for each contact in the selected folder.

I've read the article for Programmatically Using Section Folder Filters in Processes or Server-Side Code in Creatio | Customer FX and I have borrowed a script task for creating the list of contacts.

var sectionName = "Contact";
var folderId = "2d3c0306-1e43-4ba7-943b-a3d261b66897"; //I will pass this in from the preconfigured page
 
// get folder SearchData
var folderSchema = UserConnection.EntitySchemaManager.GetInstanceByName(sectionName + "Folder");
var esq = new EntitySchemaQuery(folderSchema);
var dataCol = esq.AddColumn("SearchData").Name;
var folderData = esq.GetEntity(UserConnection, folderId).GetBytesValue(dataCol);
 
// convert filter data to esq filters
var serializedFilters = System.Text.Encoding.UTF8.GetString(folderData, 0, folderData.Length);
var dataSourceFilters = Terrasoft.Common.Json.Json.Deserialize<Terrasoft.Nui.ServiceModel.DataContract.Filters>(serializedFilters);
 
// MUST INCLUDE using Terrasoft.Nui.ServiceModel.Extensions;
var folderFilters = dataSourceFilters.BuildEsqFilter(UserConnection.EntitySchemaManager.GetInstanceByName(sectionName).UId, UserConnection);
 
// now can include folderFilters as filters in new esq
var contactEsq = new EntitySchemaQuery(UserConnection.EntitySchemaManager, "Contact");
contactEsq.AddColumn("Id");
contactEsq.Filters.Add(folderFilters); // using the filters from the folder
var contacts = contactEsq.GetEntityCollection(UserConnection);

I would like to either pass the results into a collection or run a sub process for each contact directly from the script task.

Any help would be much appreciated,

Like 0

Like

1 comments

An easy way to accomplish what you're after is to: 

  1. Create a collection parameter in the process
  2. Populate the contacts from the ESQ into the collection parameter (see link below)
  3. Then use normal subprocess for each contact in the collection

See here for how to add the results of the ESQ from the folder to a collection param: https://customerfx.com/article/working-with-collection-parameters-in-a-process-in-creatio/

Ryan

Show all comments

Hello community,

I have a question if any conditions are applied to visibility of Publish button in the Landing form of Landing page section? I've created a test LP, but can't see this button. 

Like 0

Like

2 comments

The ability to publish is only enabled by turning on a feature. Go to:

[creatiourl]/0/flags

Then locate the feature (or add it if it is missing) "LandingPagePublishingEnabled" and check the box to enable. Then click the "clear cache" button. This will turn that on.

Ryan

Ryan, thanks a lot!

Show all comments

Hello everyone,

I'm hoping someone in the community can shed some light on an integration issue I'm facing. I've been stuck on this for a couple of days and have exhausted the usual methods, so any advice would be greatly appreciated!

I'm developing a webphone panel for a telephony provider. This is built as a standalone Angular component that uses an <iframe> and depends on the provider's JavaScript library, webphoneConnectorSDK.js. The final component is intended to be used within our Creatio instance.

The Problem: The component behaves perfectly in my local Angular development environment (ng serve). The SDK script loads, its global objects are available, and all functions work as expected.

However, once the component is built and deployed within the Creatio environment, it fails. I receive runtime errors indicating that the functions from the SDK cannot be found ( "WebphoneConnectorSDK is not defined").

What I've Already Tried:

I'm confident the script file is being loaded, but it seems it's not executing correctly or exposing its objects to the global window scope inside Creatio.

  1. Standard <strong>angular.json</strong> Method: I've added the script to the "scripts" array in my angular.json file.

    "scripts": [ 
    	"src/assets/js/webphoneConnectorSDK.js" 
    ]

    I've verified after building that the SDK's code is present in the final, bundled scripts.js file, which is loaded on the page. Still, the WebphoneConnectorSDK object is undefined.

  2. Dynamic Script Loading: I also tried creating a service in Angular to load the script dynamically and waiting for it to complete (async/await). The script's onload event fires successfully, but the result is the same.

My Questions for the Community:

  1. Has anyone else successfully integrated a third-party JS library (especially one that relies on the global window object) into a custom Angular component for Creatio?
  2. Is there a known "best practice" or a specific integration pattern for this scenario that I'm missing?
  3. Are there any non-obvious Creatio settings or configurations that could be interfering with the execution of globally-scoped scripts?

I'd be incredibly grateful for any ideas, pointers, or shared experiences you might have. Thanks for taking the time to read!

Like 1

Like

0 comments
Show all comments

Is there any way to add the OOTB Change Log section into a workplace? I know it isn't a normal Section so it would be somethign of a workaround, but it would be useful for our purposes to grant access to just the Change Log without granting access to the System Designer to a user role. Even just having a "Section" displayed in the workplace that just acts as a link to the change log would be useful if that's possible in some way?

Like 0

Like

0 comments
Show all comments

Hi Community

we need to generate a custom excel file but excel reports will not be enough.

Our case, we have a "Article" object, that has a "Category"

and depending on the "Category", this article has certain "ArticleRequirements".

We need to generate and excel file that will have a column header per each "ArticleRequirements"

The "ArticleRequirements" also have a classification A,B and C and ideally I need to separate them into 3 different sheets.

This means that the excel for each article can have a different number of columns.

 

Ex Excel for Product A:

 

Excel for product B:

anyone had a similar case? and any suggestions on how to approach this challenge? 

Some libraries that can be used by Creatio to achieve this?

Thanks

Luis

 

Like 2

Like

1 comments

I did something like this and used the same thing that is used for exporting a list to Excel. Basically, when you export a list to Excel, it takes the ESQ from the list as one big serialized string and then sends it to the ReportService/GetExportToExcelKey service and then it gives back the Excel file. What my custom solution did was to just form my own ESQ string at runtime using the columns I wanted in the Excel file (which varied based on other conditions) and then pass it off to ReportService/GetExportToExcelKey, just as if I was exporting a list. 

For this type of thing to work, the user does need the operation permission for exporting a list to Excel (since it thinks that is what you're doing) and also the data in the Excel file does need to be based off of an actual object (meaning not just some random database query) - essentially, as if the data you wanted were bound to a list (even though it's not)

Ryan

Show all comments