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

Hi everyone,

I have a Object that contains multiple records with the same name.
I want to retrieve/read only the *unique records* based on the name field, instead of getting duplicate records.

What would be the best way to achieve this ? Is there a way to use a query/filter or any other approach to return only distinct/unique records?

Any guidance or example would be greatly appreciated.

Thank you

Like 0

Like

0 comments
Show all comments
view
open
Email
attachment
Sales_Creatio_enterprise_edition
8.0

Dear,

In Creatio CRM version 8.3.4, when sales representatives send a quote to clients, the quote is attached as a PDF. 

Download the Order PDF Files

However, the link is not clickable, and the sales reps cannot preview the quote. I tried adding the "Attachment" component to the email's "General Info" tab, but the file list is empty, so that must not be the right component. 

Attachment

How can I add an element that displays the order file?

In the timeline, we can click on the file link to open it:

ActivityFile

I can find the file with the email id and SQL:

SQL

I can see the order file with the object "ActivityFile" but we can not download it or get a preview.


This problem is very troublesome for our users.
Thank you !
Nicolas

Like 0

Like

3 comments

ok i finaly found, on the attachment object, i had to configure the File save location and set to Activity File

Hi LÉZORAY Nicolas,

May I ask what are you using to generate the PDF?
thanks,

Luis

Luis Tinoco Azevedo,

Hello Luis,

We use Creatio native service: Terrasoft.Configuration.ReportService.ReportService

The process calls GenerateMSWordReport() with the print template ID and the ID of the relevant record. Creatio first generates the document from the Word template via IReportGenerator.

When the ConvertToPdf parameter is enabled, the result is then converted to PDF by the IPdfConverter component, retrieved as follows:

ClassFactory.TryGet("PdfConverter", out pdfConverter); result.Data = pdfConverter.Convert(result.Data);


The generated content is returned as a byte array in report.Data. We then save this data to:
- ActivityFile, to attach the PDF to the email;

- OrderFile, to also save the PDF in the order files.

We therefore do not use an external PDF library in the process; instead, we rely on the Word report generator and the PDF converter provided and stored within Creatio.
 

Show all comments

Hi Community,

We are working on a Freedom UI page where we need to implement cross-field validation on a date field. Specifically, we want to validate that the Detection Date (FechaDeteccion) is not earlier than the Child's Birth Date (FechaNacimiento).

In Classic UI, we used to handle this easily by accessing other model attributes within the validation method. However, in Freedom UI using custom validators declared in validators schema block, the validator function only receives the control instance (Angular AbstractControl), and properties like control.root or control.parent do not give us access to other Page ViewModel attributes/context.

We are currently passing $context via viewModelConfigDiff parameters like this:

JS

"PDS_HcoFechaDeteccionSospecha_s35z4sf": {
   "modelConfig": {
       "path": "PDS.HcoFechaDeteccionSospecha"
   },
   "validators": {
       "ValidarSospechaVsNacimiento": {
           "type": "usr.HcoFechaSospechaNacimientoValidator",
           "params": {
               "message": "La fecha no puede ser anterior a la fecha de nacimiento.",
               "campoNacimiento": "PDS_HcoFechaNacimiento_04pdwdb",
               "context": "$context"
           }
       }
   }
}

And in the validator declaration:

"usr.HcoFechaSospechaNacimientoValidator": {
   "validator": function(config) {
       return function(control) {
           let fecha = control.value;
           if (!fecha) return null;

           let ctx = config.context;
           // Reading secondary field from passed context...
           let fechaNacVal = ctx ? ctx[config.campoNacimiento] : null;

           // Date comparisons...
           return isInvalid ? { "usr.HcoFechaSospechaNacimientoValidator": { message: config.message } } : null;
       };
   },
   "params": [
       { "name": "message" },
       { "name": "campoNacimiento" },
       { "name": "context" }
   ],
   "async": false
}

Our Questions for the Community:

  1. Is passing "context": "$context" in viewModelConfigDiff the recommended OOTB standard in Freedom UI for cross-field validation, or is there a native SDK approach / API method to inspect other attributes from within a custom validator?
  2. Alternatively, is there a recommended way to trigger/update the validation status of FechaDeteccion programmatically from a crt.HandleViewModelAttributeChangeRequest handler without relying on alert() or manual field resetting?

Any insights or best practices on how you are handling multi-field dynamic validations in Freedom UI would be greatly appreciated!

Thanks in advance!

Like 0

Like

0 comments
Show all comments

I am trying to add an attachment feature when employees are adding new cases. I am able to add it to the "New" cases screen with the web designer: 

 

But when the cases come through, there is no attachment in the file. 

Any help would be appreciated. 

Like 0

Like

1 comments

Hi Matt, 

upon saving Creatio does two distinct things:

1 - Create the Case Record (-> Parent Record for the Attachment) 

2 - Upload and Create the Attachment/File record and connect it to the Parent Record ID


I assume that during execution of Step (2) the Parent (Case) ID has not been defined yet as the Case record is about to be created just now, so the Attachment record is uploaded, but not connected.

In order to avoid this, the easiest solution seems to be to delay the possibility of uploading files until after the Case has been created/saved for the first time. 

Otherwise to my knowledge there is no standard approach for this yet. You can also choose to do a more refined solution by Custom JS Code (Handler), Business Process etc. :
 

Alona Dolya
(...)
"Please note the following important points:

  1. The Attachments component works only in the context of a record (entity). Files cannot be uploaded without being associated with a record.

       2. If you need to collect files before the main business object is created, you will need to implement a custom approach. A common solution is:create a temporary (technical) object/record, use the Attachments component to upload files there, then use a business process or server-side logic to transfer the files to the final object once it is created."

See: upload files | Community Creatio

If you want to verify, check was is actually saved in the CaseFile Table - if all previous records were uploaded successfully, but they don't point to the correct Parent Record, then that is most likely the culprit.

Best, 
David

Show all comments
mobile
file
Studio_Creatio
8.0

How to get file creation date in mobile application when downloading it from a gallery or from a file system?


Here is my code:

onFileTypePickerItemTap: function(el, index, target, record) {
    var source = record.get("Source");
    switch (source) {
        case Terrasoft.Configuration.FilesAndLinksDetailFileSources.Gallery:
            Terrasoft.Camera.captureFromGallery({
                success: this.onCameraCapture,
                failure: this.onFail,
                scope: this
            });
            break;
            ...
        }
    }
},

onCameraCapture: function(fileName, url) {

    Terrasoft.Mask.show({message: Terrasoft.LocalizableStrings.UploadingFile});
    if(fileName && url) {
        this.saveFile(fileName, url);
    } else {
        Terrasoft.Mask.hide();
    }
}

Like 0

Like

0 comments
Show all comments