Greetings community,
I'm looking to devise a function that accepts an Entity as a parameter, allowing for record insertion into Creatio using a Script Element.
Consider the following code snippet:
// Function to insert records based on the provided Entity
void InsertRecord(string entityName, Dictionary recordValues) {
UserConnection userConnection = Get("UserConnection");
var insert = new Insert(userConnection).Into(entityName);
foreach (var keyValue in recordValues) {
insert.Set(keyValue.Key, Column.Parameter(keyValue.Value));
}
var affectedRows = insert.Execute();
}
// Example usage to insert Contact or Account records (with parameters)
InsertRecord("Contact", new Dictionary {
{ "Name", "Andrew Black" },
{ "Note", "Parameter" }
});
Is there any approach to implementing this logic using a Script Task or any other element?