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

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
Discussion
version
ApplicationHub

It would be nice if there was some automatic prompt to the user in the app hub when exporting a customer application to update the version number of a customer application. Just a little popup asking if you would like specify the version number, showing the current version number, would make this feature a lot more visible & easy to incorporate into standard workflows.

1 comments

Adding also possibility to add notes of changes in the new version number so it's directly documented in the app would be great add to be able to direcly see new changes and history of changes.

Show all comments
google
calendar
calendar integration
Studio_Creatio
8.0

Hello all,

I recently connected my instance of Creatio to my Google Calendar and the synchronization connected successfully but it brought in only a fraction of events on my calendar. The integration seems to have skipped over every recurring meeting. Is there a way to bring those meetings in? That seems like a huge gap otherwise.

Like 0

Like

1 comments

Outlook calendar integrations also needs improvements, hopefully, the new Graph API integration with Creatio 10 will improve existing behavior and allow more options 🙂. 
First thing asked by Sales teams, and first thing not living to expectations today.

Show all comments