Hi Community,

How can we filter the Cities based on the Zip Code (string field) in Freedom UI?

Apparently dynamic filtration on Object Level works only for Lookup fields.

Sasori

Like 0

Like

4 comments

Hello Sasori,



Since a text field and there is no lookup values you can not filter it based on conditions. 

Hi Bogdan,

Your answer is something that we already now (I have already stated that in my post) . And it is very astonishing that such functionality which was oob in the Classic UI is not present in the Freedom UI.

Please give us a code example of implementing such functionality in freedom UI.

Sasori

Sasori,

 

We don't have a ready example of such implementation. 

 

However, we have already registered the idea for our R&D team to implement this functionality in further releases. I will assign your case to this project to increase its priority.  

Sasori Oshigaki,



You need to create other lookups, remove and replace the current postal code text field, so that you can add postal code to the list of cities to do the links. It is indeed weird that this is a seperate text field as an OOTB feature.



Also, accounts is in Freedom UI, with customer 360, but not account adresses , how weird is that ??

Show all comments

I tried returning false and not calling next?.handle(request), but the record still seems to get saved. In Classic UI it was possible to prevent saving by not calling the this.callParent method, which I believe is somewhat analogous to the next?.handle(request), but I guess not perfectly? Maybe I'm missing something.

Like 0

Like

1 comments
Best reply

Hello Harvey,

It is possible, and you do it in the right way as I can see from the description. To prevent saving you have to declare this handler in the scheme and simply do not call next?.handle(request). 

Hello Harvey,

It is possible, and you do it in the right way as I can see from the description. To prevent saving you have to declare this handler in the scheme and simply do not call next?.handle(request). 

Show all comments

I'm looking to trigger page data validation in a specific circumstance from code. I've found that you can use

request.$context.validate()

within client event handlers to trigger the OOTB fields validation for the page, but this just returns an object representing any/all errors in validation for the data. What would make sense to do in our use case after that would be to trigger the NotifyService message you usually see when saving fails due to such validation checks, but I can't see how to trigger it/how to fetch the string that should be shown in the message. I located a method that looks like it is performing this task for the OOTB save validation, called getValidationErrorMessage, which would be passed the request context and the error object returned by the validate function, but this method doesn't seem to be available for use.

 

Has anybody had any luck with triggering validation in Freedom UI and then displaying the OOTB message based on that validation result? Any help would be greatly appreciated. We're currently running on 8.1.0

Like 1

Like

3 comments

Hello,

If I'm not mistaken, you can use simple OOTB validation that is described here https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platfor…

Hi Dmytro,

 

This doesn't give us a way to trigger the validation manually though unfortunately. What we were trying to achieve was to show the validation message to users without saving/trying to save the record at that point in time. We ended up making our own very basic error message that shows the results returned by

request.$context.validate()

if there are any and stops the user progressing in our custom path, but it would be good to be able to tap into the OOTB error toast message so it's a little more detailed and polished.

Harvey Adcock,

 

Hello! 

Unfortunately, so far, we don't have the functionality to trigger the OOTB validation snackbar-message without saving /trying to save the record. 

We have registered your suggestion, and our R&D team will consider implementing it in future releases.

Thank you for making our product better!

 

Best regards, 

Natalia

Show all comments



I have a section called 'Requests' that has 3 multiple edit pages based on a section FIELD value. Now, the parent edit page has been disabled (it is in a 'not in use' state). How can I enable it? I need a common page that is not based on a Field value.

Like 0

Like

2 comments

Dear Sam

 

I recommend you to keep the main base page unused.

The other three pages you can make inherit from this first one getting a base page for common problems, for example, you need to add a business rule or a field and you need it in three sections, you go to the base page, create what you need there and voila, all the pages get this new field or business rule....

 

See images:

1.- Client Model schemas  https://prnt.sc/4YfSmr4FPukL

2.- How to inherit https://prnt.sc/-owYS4INpiXe

3.- https://prnt.sc/69f_gvWJjxBW

 

Regards

Julio Falcón

Julio.Falcon_Nodos,

Thanks, Julio!

Your suggestion to keep the main base page unused and have the specific pages inherit from it makes sense. I implement it using another approach.

Thanks for your reply

 

Regards, Sam

Show all comments

We're trying to set it up so that one of our mini pages used for record creation (wherever the record creation is started from, as there are several screens with a button to create the record) always has a default value set. We can't set the default on the entity, as records coming in from the integrations shouldn't have these fields set to any default, only set to whatever comes in through the interface. Is there any configuration that can be done to set default values for pages themselves?

 

We know about setting defaults when calling the crt.CreateRecordRequest request which is done from the calling page, but would ideally like to be able to set it one time for the creation mini page itself to avoid code duplication. We are on 8.1.0

Like 1

Like

5 comments

You can setup a business rule if the attribute is not filled in then you set a static value. This will work only on the interface.

Thanks for the suggestion Franck, and interesting/concerning that the entity-level business rules only apply when creating records through the UI and not for all data!

 

Unfortunately the business rule value setting is much too limited in Creatio for what we need, only being able to set to a constant/static value which is defined when setting up the business rule. We need to be setting the value based on some logic through code, but would ideally be doing so with declarative code rather than imperative code which modifies the fields manually.

Hello Harvey,

The most general way to set the default values for a mini-page is to transfer them in ModelInitConfigs via crt.OpenPageRequest:

modelInitConfigs: [{defaultValues: [{AttributeName: 'AttributeValue'}]}]

But if you want to avoid transferring the values in every place you open the mini-page, consider the following implementation in the mini-page view model:

  1. Set the attribute value in the "crt.HandleViewModelInitRequest":
    request.$context.AttributeName = “AttributeValue”;
  2. Provide it not to be overridden to default null value in "crt.HandleViewModelAttributeChangeRequest":
    if (request.attributeName === "AttributeName" && request.value === null) {
          request.$context.AttributeName = “AttributeValue”;
    }

     

Best regards, Natalia

Hi Natalia,

 

Thanks for the reply, those will definitely be useful - for example I didn't know you could set default values when calling the crt.OpenPageRequest, I thought it was only possible to do so using the crt.CreateRecordRequest, so thanks for that!

 

I believe the workaround for putting the logic in the mini-page would mostly work, but with the following caveats:

1. You would not be able to clear the value of the field manually, which is unfortunate

2. This would make a change to the page that would cause the confirmation dialog to appear if closing the mini-page without the user making any modifications to data - not the end of the world, but it would be nice to avoid that

 

A quick question - what is the difference between simply assigning a request.$context.AttributeName using 

request.$context.AttributeName = "value"

Vs using the _setAttributeValue method in your reply? Is there any functional difference between the two, or is it just preference?

 

Many thanks,

Harvey

Harvey Adcock,

 

Hi, 

Sure, setting the mini page default values via HandleViewModel InitRequest and HandleViewModelAttributeChangeRequest has some disadvantages. That’s why we recommend using ModelInitConfigs in OpenPageRequest.

 

However, it may still be used if the user doesn’t need to set the field value to null. Especially considering the facts that:

- removing the string field means setting a value to an empty string (not null);

- the numeric field value might be set to 0 instead of removing it.

 

The question of silent saving has already been discussed in the separate feed - https://community.creatio.com/questions/it-possible-make-changes-attributes-code-freedom-ui-silently .

 

Regarding your question about setting the attribute value – I clarified it with our R&D department. There is no functional difference between the two approaches, but only the direct assigning is recommended to use as the most stable method:

request.$context.AttributeName = "value"

Thank you for such an important question. I have already changed my examples accordingly.

 

Best regards,

Natalia

Show all comments

We've got a requirement to run some async entity event listener code, but when following the academy article for that ( https://academy.creatio.com/docs/7-18/developer/back_end_development/ob… ) and trying to use the arguments.OldEntityColumnValues property of the EntityEventAsyncOperationArgs arguments parameter passed in, we get the following compilation error which we cannot seem to resolve:

 

From looking online for general resolutions, it looks like we maybe need to add this assembly to the web.config file, but we're on a cloud instance so presume this isn't a feasible resolution.

 

Any advice would be greatly appreciated.

 

Reduced version of the code (without usings etc shown) that throws the error below:

public class UsrAsyncSendLeadAssociation: IEntityEventAsyncOperation
{
    public void Execute(UserConnection userConnection, EntityEventAsyncOperationArgs arguments) {
        var oldModVal = arguments.OldEntityColumnValues;
    }
}

 

Like 0

Like

1 comments

Hello,

As a quick solution, you should disable the option "Compile into a separate assembly" in the package where the schema is located.

After this, the problem should be resolved.

Show all comments

Is there any way to undo/cancel a change that triggers the crt.HandleViewModelAttributeChangeRequest handler? The use case is that a field is set in the crt.HandleViewModelInitRequest handler, but this setting of the value gets immediately overwritten by the OOTB system that sets up the page it seems. So I would like to be able to conditionally cancel the setting of this field by the page. Any help would be greatly appreciated. We're currently on 8.1.0

Like 0

Like

2 comments

Hi Harvey,

 

We can create an attribute to store a value that you want to set in HandleViewModelInitRequest. Then, in HandleViewModelAttributeChangeRequest, we can check if the current field value matches the one you previously set. If it does not match, we can assign the stored value to it. This way, we ensure that the desired value is assigned to the field.



In the given example, we have created an attribute named "UsrInitialValue".

viewModelConfig: /**SCHEMA_VIEW_MODEL_CONFIG*/{
			"attributes": {
				"StringAttribute_ljc6yh6": {
					"modelConfig": {
						"path": "PDS.UsrTestString"
					}
				},
				"UsrInitialValue": {}
			}
		}/**SCHEMA_VIEW_MODEL_CONFIG*/,



This attribute is used to store a specific value that we set during the initialization process. In the crt.HandleViewModelInitRequest handler, we set a value for the request.$context.UsrInitialValue. And in crt.HandleViewModelAttributeChangeRequest, we check if the current field value matches the value we set previously in the request.$context.UsrInitialValue. If they don't match, we update the field with the new value.

 

handlers: /**SCHEMA_HANDLERS*/[
			{
				request: "crt.HandleViewModelInitRequest",
				handler: async (request, next) => {
					request.$context.UsrInitialValue = "testInit";
					request.$context.StringAttribute_ljc6yh6 = await request.$context.UsrInitialValue;
					return next?.handle(request);
				}
			},
 
			{
				request: "crt.HandleViewModelAttributeChangeRequest",
				handler: async (request, next) => {
					var srtValue = await request.$context.StringAttribute_ljc6yh6;
					var initVal = await request.$context.UsrInitialValue;
					if (request.attributeName === 'StringAttribute_ljc6yh6' && srtValue != initVal) {
						request.$context.StringAttribute_ljc6yh6 = initVal;
					}
					return next?.handle(request);
				}
			}
		]/**SCHEMA_HANDLERS*/,

 

Artem Smyrnov,

 

I think this would prevent any modification to the data, including intended changing by the user or system. Obviously it could be changed to add some more conditions, but really the main thing we want/frequently need is for the crt.HandleViewModelInitRequest request to be able to initialise a value and not be overwritten by the standard page loading stuff (loading default values for the entity, clearing out the field where there are no default values etc). I'm pretty sure this was possible in Classic UI, it just doesn't seem to be currently in Freedom UI without some pretty nasty hacks.

Show all comments

I've noticed there are a lot of HTML Style elements added to the Creatio pages' DOM, and I was wondering what generates and sends these to the browser so that some of them can be modified. This appears to be different from the normal CSS Linking that happens in Creatio, so I presume there must be some different method for overriding them. See below for an example of one of the style elements I want to modify:

Like 1

Like

4 comments

Hello Harvey,

 

The style HTML tag (inside the head tag) usually contains CSS rules, which are crucial for the init page rendering, or the most general CSS rules. These rules could be overridden in a common way:

  1. Create a new module, choose LESS in the left panel, and add the CSS rules.
  2. Add the name of this module to the dependencies in the Page client module, starting with the prefix “css!”

Here is an additional example - https://community.creatio.com/questions/how-can-i-hide-task-properties-pre-config-page .

 

Best regards,

Natalia

Hi Natalia,

 

Unfortunately this doesn't seem to be working for me for 2 reasons:

  1. The style in the CSS is not taking precedent over the OOTB style that is included in the style element in the DOM. Does Creatio have any way of overriding the OOTB elements' styles without resorting to using !important everywhere?
  2. The client module seems to be "compiling" my code and modifying it from what I wrote (first line after this) into what appears in the browser sources (second line after this point) and these are completely different - Creatio cannot take 40 pixels off 100% height and conclude that it's always going to be 60% height:
    1. height: calc(100% - 40px)
    2. height: calc(60%)

 

Do you know of any resolution to these issues?

Hi Harvey

 

You can use this addon to apply CSS styles globally: https://marketplace.creatio.com/app/experceo-global-jscss-editor-creatio

If you can identify the selector, you can easily override the CSS properties values using !important keyword.

I hope this helps!

Mohamed Ouederni,

Thanks Mohamed, generally we're trying to keep add-ons to a minimum unless strictly necessary to avoid too many dependencies and potential points of failure, but worth knowing.

Using Natalia's recommendation, I was able to apply the CSS - for any others having this issue, the resolution to my first issue was just to set the style as being important, though another resolution might be to make the selector more specific (CSS specificity) than the ones acting upon it. And the resolution to my second issue was that it's a LESS CSS issue rather than Creatio's issue, but it can be worked around using the following escaping of the calculation:

height: calc(~"100% - 40px")

Which I found from this Stack Overflow question: https://stackoverflow.com/questions/11972084/how-to-prevent-less-from-t…

Show all comments

Hi Team,



I want to use the below min.js file as a script

https://public.tableau.com/javascripts/api/tableau.embedding.3.latest.min.js

to  load the tableau as a IFrame and use the functions of the scriot file add filter to the loaded URL. 

 

To implement it the min.js file has to be included in Creatio. How do we add this file in Creatio?



Regards,

Adharsh S

Like 0

Like

2 comments

Hello, 

None of this is tested (and I've not used the Tableau embed script to know if it would work this way), but you can try using require for it by adding the following: 

requirejs.config({
	paths: {
		Tableau: 'https://public.tableau.com/javascripts/api/tableau.embedding.3.latest.min.js'
	}
});

Note, you can add this before the page code define and then include as a reference for it: 

define("UsrMyCustomObject1Page", ["Tableau"], function (Tableau) {

Then use as something like: 

const viz = new Tableau.TableauViz();
viz.src = 'https://my-server/views/my-workbook/my-view';
viz.toolbar = 'hidden';
document.getElementById('tableauVizElement').appendChild(viz);

Ryan

Hi Adharsh



You can use this addon to add JS scripts globally: https://marketplace.creatio.com/app/experceo-global-jscss-editor-creatio

 

Go to System Settings -> ExpGlobalJSValue to update the global JavaScript script.

 

require(["https://public.tableau.com/javascripts/api/tableau.embedding.3.latest.min.js], function(lib) { 

       window.Tableau = lib;

});



Then you can use window.Tableau
 in your js code.



Hope this helps!

Show all comments

Is it possible to set up useful number truncation in Creatio for Measure/KPI elements in Freedom UI? OOTB, if a number being shown in the Measure component is too long, it just gets cut off and ellipses put at the end to indicate it's not all showing, but this means the user cannot tell how big the number is at all! It could have 3, 6, 9 or more extra zeroes hidden in the ellipsis. e.g. the following could be showing 191 million, 191 billion, 191 trillion etc:

 

Ideally it would be possible to set it up so that you can choose to have automatic truncation using abbreviations like 10M or 20K if the number is too long, but it would also be nice if we could specify in the number formatting that the number should always be shown in thousands, millions etc - possibly something like specifying "{0k}" in the number format for always showing the number in thousands. Don't know how possible any of this is today or would require changes by Creatio, but any advice appreciated. Currently using Creatio 8.1.0

Like 1

Like

1 comments

Yes this is getting pretty frustrating among metrics and graphs alike for a couple years now, not to be able to set to K or M etc...

Show all comments