Hi,



So have this default Opportunity Section which we edited to change the UI for creating a New Record (see image for reference). Then we change it in a way that choosing customer can only be through accounts, which we are having the prompt error actually.







Question

After checking all the previous version of OpportunityPageV2, I can't find anything that prompts this error, any thoughts/comments?

Like 0

Like

2 comments
Best reply

Hi,



I'm able to afford to fix my problem via the following code segment. I both declared this in minipage and pagev2 of opportunity.

          "Client": {
            "caption": {"bindTo": "Resources.Strings.Client"},
            "dataValueType": Terrasoft.DataValueType.LOOKUP,
            "multiLookupColumns": ["Account"],
            "isRequired": false
          },

Thanks a lot!

Hello Solem,

 

Hope my message finds you well.

 

You can check the Opportunity object and find the 'Customer' column, then disable the requirement for this field to be populated. Also, you can use Section Wizard / Page Designer to find the configuration for the mentioned column. Additionally, if you use the mini-page for the Opportunity section, there also need to disable the requirement for the Customer field.

 

Best regards,

Roman

Hi,



I'm able to afford to fix my problem via the following code segment. I both declared this in minipage and pagev2 of opportunity.

          "Client": {
            "caption": {"bindTo": "Resources.Strings.Client"},
            "dataValueType": Terrasoft.DataValueType.LOOKUP,
            "multiLookupColumns": ["Account"],
            "isRequired": false
          },

Thanks a lot!

Show all comments

Hi Team,



I would like to prevent selecting the future date in the date field.

Kindly help me with any insight on this.



Note: All the future date should be greyed out and is not able to select (if it is clicked it shouldn't be selected or populated in the date field).

 

 

 

Thanks in Advance!



Regards,

Bhoobalan P.

Like 0

Like

3 comments

Hi Bhoobalan,

 

Please use the column validator instead that will do the same task:

setValidationConfig: function() {
              this.callParent(arguments);
              this.addColumnValidator("UsrDatetime1",this.dateTimeColumnValidator);
            },
          	dateTimeColumnValidator: function(){
              console.log(this.get("UsrDatetime1"));
              var invalidMessage = "";
              console.log(this.getSysDefaultValue(Terrasoft.SystemValueType.CURRENT_DATE_TIME));
              if (this.get("UsrDatetime1")>this.getSysDefaultValue(Terrasoft.SystemValueType.CURRENT_DATE_TIME)){
               	invalidMessage = this.get("Resources.Strings.ErrorMessage");
              } 
                return {
                  invalidMessage: invalidMessage
                };
              },

Just replace the UsrDatetime1 column with your date\rime column name and also create a localizable string with the "ErrorMessage" code.

 

Best regards,

Oscar

Oscar Dylan,

Thanks much for the precious response!



But still we could select the future date value, And after validation we throw a error message below the corresponding field name. 



We need to block selecting the future date, which could be possibly achieved via Jquery as below,

$("#dateField").datepicker({

    maxDate: 0

});



How could we achieve the same in our CREATIO Date field ?





Regards,

Bhoobalan P.

Bhoobalan Palanivelu,

 

This validator will also return a validation message upon saving a record with an incorrect date, so it's not possible to select the date\time grater than the current date\time:

And this is much easier than creating a custom logic for the date selector modal window so please use this approach.

 

Best regards,

Oscar

Show all comments

I am trying to implement validation logic in client module edit page of a section.

I want to save the column value of UsrAttributeName (a lookup) into a variable.

To do this, I am using this.get("UsrAttributeName").displayValue. But when Page is loaded it hangs and console shows the error 

message: Uncaught TypeError: Cannot read property 'displayValue' of undefined 

Like 0

Like

2 comments

Hello! 

 

1. To add validation use this.addColumnValidator method in setValidationConfig method.

Please, find the example in the Academy article: https://academy.creatio.com/documents/technic-sdk/7-16/how-add-field-va…

 

2. If the column value is not defined you cannot call for its properties. Check if the column has value:

var attribute =  this.get("UsrAttributeName");

var attributeDisplayValue = attribute  && attribute.displayValue;

 

Please, let us know in case any additional information is required. 

 

Best regards,

Olga. 

Olga Avis,

Hi 

 

After debugging it turns out undefined is coming because Entity/Page is not fully loaded or when I create a new record then all fields are empty.

I could use your suggested way to assign attribute value to a variable but that would not be able to work if entity/page is not fully loaded.

 

So I used a flag in attributes with default value false and set it to true in OnEntityIntilized method.

Then I checked the flag, if it is true then the validation method will run.

 

Thanks

Ram

Show all comments

Hello



Creatio by default allows a user to choose between 50, 250 and 500 as max lengths of a Text column from the Object designer. We have a use case where we have to set a specific max length for a field Eg Text (80 charecters). Find below a few questions in this regard 

1. Is there a way to set this custom max length for that object from the Creatio GUI?

2. If #1 is not possible, Can this be set directly at the database/data model layer? If Yes, How? Also, will such a limit automatically bubble upward to the UI? ie If the field is set to 80 charectars and an input field is linked to it, Does a validation of max 80 charectars on the UI automatically apply?

3. The following link provides guidelines on how to custom implement an input validation on the UI. Will such a validation also work on Creatio Mobile?

Like 0

Like

4 comments

Hello. Would really appreciate some help on this question

M Shrikanth,

 

1. There is no way to set the custom max length for a field from the Creatio GUI.

 

2. It's possible to set the custom max length for a field via development by creating a field validator. Please find the examples in the article on Academy:

https://academy.creatio.com/documents/technic-sdk/7-15/how-add-field-validation?_ga=2.27542716.1082264901.1584023961-1276886288.1584023961

 

3. The validation functionality must be developed in the mobile application separately. You need to create a custom business rule in the mobile for that. The guidelines can be found in the article on Academy:

https://academy.creatio.com/documents/technic-sdkmob/7-15/custom-business-rules-mobile-application

Hello

Creatio by default allows a user to choose between 50, 250 and 500 as max lengths of a Text column from the Object designer.

1. Is there a way to set this custom max length for that object from the Freedom UI?

Ahamed Rizlan,

 

Hello,

 

On the object level it's not possible however field validator can be used on the page where the field is added to ensure the value has a specific length and prevent saving when the field length is greater than some value. Here is an article regarding field validators in Freedom UI.

Show all comments

Is there a way to make a thread sleep (like "Thread.Sleep(nnn)" in C#) in order to make it possible to wait for a property set by an ESQ return, such as the code example below ?

...

this.set(("EsqOk", false);

esq.getEntityCollection(function(result) {

     ...

     // ESQ return

     ...

     this.set(("ValidationMessage", "xxxxxxxx");

     this.set("EsqOk", true);

     }

}, this);

// main thread flow

while (!this.get("EsqOk") {

     this.Thread.Sleep(500);

}

return {

     invalidMsg: this.get("ValidationMessage")

};     

 

Like 0

Like

1 comments

No. It's a bad idea to stop the application for data selection. It's better to use masks. Like MaskHelper.showBodyMask and MaskHelper.hideBodyMask

Show all comments