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.
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.
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.
I am working on a scenario where I need to get Records (With Id and Name) from another object.
In Model class, we can get one record but how to get a Collection of records with a filter/Parameter "Name" it should get all the records with the same Name.
There is an issue in current versions of Creatio with the filter classes, such as FilterGroup etc, being applied to model load/queries. I've been reporting this issue since 8.0.6 (#SR-01182879) but it's still not yet fixed in 8.0.9, very frustrating (I've been told it will be fixed in 8.1 #SR-01198668 🤞🏻). However you can still use them with a small workaround. The example below will get all Accounts that have Type = Customer:
// make sure to add "@creatio-devkit/common" as sdkconst accountModel = await sdk.Model.create("Account");const customerFilter =new sdk.FilterGroup();
await customerFilter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "Type.Name", "Customer");// This is the workaround you have to do for the filters to work.// Shallow copy to a new object and then reassign the items collection.const newCustomerFilter = Object.assign({}, customerFilter);
newCustomerFilter.items= customerFilter.items;// now use new shallow copied filters in the queryconst customers = await accountModel.load({
attributes:["Id", "Name", "Type"],
parameters:[{
type: sdk.ModelParameterType.Filter,
value: newCustomerFilter
}]});// the customers variable is now an array of accounts with Id, Name, and Type columns
console.log(customers);
The whole issue with the FilterGroup is that the items collection doesn't get unrolled from a collection to an array - the copy forces the object to flatten out how it's expected by the underlying DataService call.
Verify that the column name is correct. In the accountModel.load your passing the attributes array with "DateTimeAttribute_x2whel6", this needs to be the column name in the object/table (which will likely start with a Usr)