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 1

Like

4 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.

Harvey Adcock,

There is no logic that could be used to revert changes to the column value that were done by the handler.

As a solution, you need to create a column that will not use any other handler and set the value using your custom handler. This will prevent the value from being overwritten by other handlers or custom logic.

We have a workaround in place, but this capability has been required a few times - it would be good if Creatio supported setting values on the page in the init handler (or some other handler, maybe a new initvalues handler or something) since per-page default values is often required.

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

Hey Creatio Community,

I'm currently working on customizing the LeftPanelTopMenu in Creatio, specifically trying to add a personalized icon to the getTopMenuConfig function.

Here's what I've tried so far:

  1. I imported a new image via Creatio's UI, and I can confirm it's in the system.
  2. In my code, I'm attempting to reference this image in the getTopMenuConfig function.

Here's a snippet of my code:

 getTopMenuConfig: function() {
                var menuConfig = [
                    {
                        id: "collapse-button",
                        tag: "CollapseMenu",
                        className: "Terrasoft.HoverMenuButton",
                        style: Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
                        classes: {
                            imageClass: ["button-image-size"],
                            wrapperClass: ["collapse-button-wrapperEl"]
                        },
                        imageConfig: resources.localizableImages.collapseIconSvg,
                        click: {
                            bindTo: "collapseSideBar"
                        },
                        hint: this.getCollapseSideBarMenuItemCaptionConfig(),
                        markerValue: this.getCollapseSideBarMenuItemCaptionConfig()
                    },
					{
                        id: "send-button",
                        tag: "sendbtnMenu",
                        className: "Terrasoft.HoverMenuButton",
                        style: Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
                        classes: {
                            imageClass: ["button-image-size"],
                            wrapperClass: ["collapse-button-wrapperEl"]
                        },
                        imageConfig: resources.localizableImages.sendSvg,
 
                    },

Despite my efforts, the personalized icon isn't appearing. I've double-checked the image name and made sure it's correct.

Has anyone encountered a similar issue or successfully added a personalized icon to the LeftPanelTopMenu? Any insights or suggestions would be greatly appreciated!

Thanks,

ABDERRAHMAN TIGAMI

Like 0

Like

0 comments
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

Hello Everyone,

 

How to convert input text value to ***** in Freedom UI.

 

Thanks.

Like 0

Like

1 comments

You can try using the password input which will mask the entire text as ****. This control doesn't appear in the toolbox, so to add it, you could add an input, then in the code change "type": "crt.Input" to "type": "crt.PasswordInput". You can see an example of this control in the page SysUserProfilePage (user profile page)

Ryan

Show all comments

Hello, 

 

I would like to set an upper limit on the size of an image that gets sent in an email. The image being sent is a variable in a form using the [#ImageName#] syntax. 

 

I have tried styling the element in div and img tags, but I think that this variable syntax does not respect styles.  

 

How can I style an image in an email template? 

 

Thanks!

Like 0

Like

1 comments

Hello,

 

Unfortunately, the logic of inserting an image through a macro into a letter template is not implemented in Creatio.

I am broadcasting your wish to the development team to consider the possibility of adding similar logic in future versions.

Show all comments

Hello.



I tried loading a detail in a modal, but it is not firing any detail method.

Is it not possible to implement such?



I know lookuputilities exist, but it shows a list as a expanded lookup.

We are more trying to show a detail in modal.



Let me know any updates.

Like 0

Like

1 comments

Hello!



Could you please provide more details regarding your request and step-by-step instructions to reproduce the issue?

Show all comments

Hello,

 

I've noticed a problem when users try to import data. For example, they select the Case object  to add data and upload an excel file with columns that correspond to lookup fields in the case. If the lookup value already exists in Creatio there is no problem and the field will be filled with that value, but if it does not exist, Creatio does not allow the user to create that new value and will throw the following error inside the ExcelImportLog page:

 

Current user does not have sufficient permissions to run "CanManageLookups"

 

If I change this operation permission and allow it for a given user, it will work fine but then that user has complete access to the Lookups section. This means that he is able to see all the lookups, create new values and remove them if they want. This is not a good practice and implies security issues.

 

Therefore, is there another way to achieve what I want without having this risk?

 

PD: I don't know if it may be an incidence related with my own environment, because I haven't noticed this behavior in any other Creatio instance before and it seems to happen only with some lookups, not all of them.

 

Regards

Like 0

Like

1 comments

Hello,

 

Unfortunately, it is not possible to allow users to have access to specific lookups only, but we have already registered the following suggestion for our R&D team and they will consider adding the following functionality in the upcoming releases.



However, we can offer you a workaround, but it is also worth noting that this is a workaround and that you can only track which rights have been issued through the database.



1. Grant everyone the rights to the CanManageLookups operation

2. Enable administration by records for the Lookup object.

In this case, do not configure the administration privileges.

Thus, there will be access to the lookup section, but only the author of the lookup will have rights to the records themselves (for system directories, this will be the Supervisor)

3. Using the BP and the element of granting rights, grant rights only to the required record.

Show all comments

I tried installing this add-on in order to be able to copy the section details of an object in Creatio: https://marketplace.creatio.com/app/salesup-copy-object-records-creatio, but it did not work for me. Although it installed successfully, I got errors in the console (see below for error stack trace) when loading the page for the Copy object records settings. Is this add-on set up for use?

 

Uncaught Error: Script error for "SuCopyObjectSettingsSectionV2"
http://requirejs.org/docs/errors.html#scripterror
    at new s (main.js?hash=27e026eb9a9d42cba4288f23c680a5e8:1:697)
    at makeError (require.js?v=8.1.0.6557:168:17)
    at HTMLScriptElement.onScriptError (require.js?v=8.1.0.6557:1744:36)
    at v.invokeTask (polyfills.js?hash=27e026eb9a9d42cba4288f23c680a5e8:1:7131)
    at I.runTask (polyfills.js?hash=27e026eb9a9d42cba4288f23c680a5e8:1:2494)
    at g.invokeTask [as invoke] (polyfills.js?hash=27e026eb9a9d42cba4288f23c680a5e8:1:8183)
    at Z (polyfills.js?hash=27e026eb9a9d42cba4288f23c680a5e8:1:20797)
    at N (polyfills.js?hash=27e026eb9a9d42cba4288f23c680a5e8:1:21090)
    at HTMLScriptElement.U (polyfills.js?hash=27e026eb9a9d42cba4288f23c680a5e8:1:21356)

 

Like 0

Like

1 comments

Hello,

 

Please be informed that support for this free marketplace addon is only supported via email by the developer of this app. You will need to contact the developer directly at care@salesup-it.com.

Show all comments

Is it possible to hide an element based on a condition in handler without adding a new attribute for visibility condition to the element?

Like 0

Like

1 comments

Hello!



Could you please provide more detailed description of the task that needs to be solved, with screenshot or examples?

Your task could potentially be solved using the Visibility parameters or through business rules:https://academy.creatio.com/docs/8.x/no-code-customization/customizatio…

Show all comments