Hi guys,

 

Is there a way to sort a detail by a specific field in Freedom Mobile? I'm using this approach that works in Classic, but it does not seem to work when I switch to the Freedom version:

 

Terrasoft.sdk.GridPage.setOrderByColumns("Account", {
    column: "CreatedOn",
    orderType: Terrasoft.OrderTypes.DESC
});

 

Thanks!

Like 0

Like

1 comments

Hello,

 

This approach won't work in Freedom UI, this one is for classic UI. Here is the example of the code for ActivityDetailV2EmbeddedDetail out-of-the-box

"ActivityDetailV2EmbeddedDetail": {
                "properties": {"readonly": true},
                "modelConfig": {
                    "path": "ActivityDetailV2EmbeddedDetailDS",
                    "cacheConfig": {},
                    "sortingConfig": {
                        "default": [{
                            "columnName": "CreatedOn",
                            "direction": "asc"
                        }],
                        "name": "Attribute_ActivityDetailV2EmbeddedDetail_SortingConfig"
                    },
                    "name": "Attribute_ActivityDetailV2EmbeddedDetail_ModelConfig"
                },
                "name": "Attribute_ActivityDetailV2EmbeddedDetail"
            },

added to the MobileCaseRecordPageSettings (edit page of the case section in mobile). The code for your detail should be found in the same schema and modified.

Show all comments

Hi everyone,

do someone have an example of the DataSourceLoadOptions that can be used to "set up pagination and sorting"?
As explained at this link: https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/front-end-development/freedom-ui/data-sources/crud-operations/references/model-class-js



Thanks.

BR,
Samuel

Like 2

Like

3 comments
Best reply

Hello,

 

Here is a handler that will trigger calling the model load with the sorting using the "Name" column from the "Account" entity in the ascending order with row offset 15 and 1 record fetch:

{
				"request": "usr.TriggerCustomRequest",
				handler: async (request, next) => {
					const accountModel = await sdk.Model.create("Account");
					const accounts = await accountModel.load({
							attributes: ['Id', 'Name'],
							options: {
								pagingConfig: {
									rowsOffset: 15,
									rowCount: 1
								},
								sortingConfig: {
									columns: [
										{
											columnName: "Name",
											direction: "asc"
										}
									]
								}
							}
						});
					return next?.handle(request);
				},
			}

Hello,

 

Here is a handler that will trigger calling the model load with the sorting using the "Name" column from the "Account" entity in the ascending order with row offset 15 and 1 record fetch:

{
				"request": "usr.TriggerCustomRequest",
				handler: async (request, next) => {
					const accountModel = await sdk.Model.create("Account");
					const accounts = await accountModel.load({
							attributes: ['Id', 'Name'],
							options: {
								pagingConfig: {
									rowsOffset: 15,
									rowCount: 1
								},
								sortingConfig: {
									columns: [
										{
											columnName: "Name",
											direction: "asc"
										}
									]
								}
							}
						});
					return next?.handle(request);
				},
			}

Hi Oleg, is there a way to retrieve distinct values modifying the "options"? How can I do it?

Luca Tavasanis,

Unfortunately, there is no way to apply distinct using the SDK model. 

We've registered the idea to our R&D team and hope to see the realization in the nearest releases. Thank you for making us better!

Show all comments

Can I add tags (prefixed with a #) to mark certain feeds? Say, for example, as #important or #CertainEvent to find relevant feeds? This is different from using @mentions to tag certain contacts.

Thanks.

Like 3

Like

2 comments

Hello,

Unfortunately, we do not yet have this functionality available. However, we have registered this request to the responsible R&D team for consideration and implementation in future application releases. 

Thank you for helping us to improve our product.

Thank you. Looking forward to this functionality hopefully soon.

Show all comments

Hi, 
    When the "AcceptApprovalWithoutComment" system setting is set to false, a popup for confirmation appears when clicking on the approval element's decision.

 Is it possible to override this popup to make it a lookup field instead of a text field(approval comment)? If so, what is the schema name for that?


 

Like 0

Like

1 comments

Hello,

Unfortunately, it is not possible to override this popup.

We've registered the suggestion for the R&D team.

Show all comments

Hello Great community, 

 

We are planning to move from Classic UI to Freedom UI and would love your input. Apart from edit data directly in list what are the major best features of Freedom UI? What should we be aware of during the transition? Have you encountered any significant issues when switching to Freedom UI for all users? Any issue with message templates or Excel reports? Any sources or documentation would be greatly appreciated.

 

Thanks!

Like 2

Like

4 comments

Hi, 

Did the switch recently for our sales team: 

- check that all business rules that you use are usable in Freedom UI (eg: you cannot use business rules based on roles in freedom UI)

- Plan for editing both minipages and normal pages

 

  • - some functionalities still do not work in Freedom UI (eg: activities not automatically linking to your opp and account, will be there in 8.1.4, but could be a blocker) or if deduplication is important, make sure you set it up: https://marketplace.creatio.com/app/deduplication-freedom-ui-enhancements 

  • - Do not understimate the time to make the UX look good, the advantage of being a better page editor means you need to be careful in giving a UX direction 😉

    - User training is important

    - before pushing to prod: test, test,test because there are sometimes somes unexpected bugs which the teams are working actively on fixing
  •  
  • - carefull on the package management with autopackage generation in the latest version of Creatio

    Advantages:

     1- you can answer to more of your client's requests in depth without needing custom code (doesn't mean at some point you might not need some, but later in more complex scenarios)

    2 - all new functionalities are provided for Freedom UI only (including future AI Copilot)

    3- UX makes reading data clearer if you use the right colors
  •  
  • 4- no more limit in functionalities depending on page type
  •  
  • 5- object level business rules (rather than just page business rules), very useful

    Disadvantage: 

    Performance is not yet on par of what classic UI and classic shell were able to provide, so you'll quickly have your users complaining that it's a bit slower. But it's getting there, version 8.1.3 shows a good bump in performance improvement. 

One of the best approaches to converting a classic system to Freedom is to make use of the "Object-specific form page interface in the Freedom and Classic UI shell" lookup. This allows you to develop the Freedom UI equivalent while still allowing users to remain on the classic versions of the screens. Once the Freedom UI equivalent of the screens are complete and ready, you just need to switch the default for that entity in the lookup and users will begin seeing the Freedom UI version (along with swapping out the exposed section in the workplace to switch from the classic section to the Freedom section)

I've typically taken this approach: 

  1. Switch users to Freedom UI shell, but remain on classic screens
  2. Convert a section to Freedom UI, once complete switch in lookup and workplace
  3. Once users are using the new section work on switching any related detail edit pages to Freedom screens if applicable
  4. Repeat for next section(s)

 

A few random thoughts to add: 

  • As Damien mentioned, it's a bit slower, but has been getting faster with each version. 
  • There's a few things you might run into that isn't yet possible with Freedom UI. However, the ease at creating complex UIs is a nice trade off. You'll spend far less time doing tedious things for the UI such as adding buttons, labels, custom filters, etc and just focus on the actual business requirements. It really does make a lot of things "no code" that used to require code to accomplish.
  • The auto-refresh of records that have been modified on the back end or in processes is one of the best things in Freedom UI. Make sure you enable this - then you can rethink how data gets modified and do more via no code in processes rather than in the page code. 
  • Definitely get rid of the classic UI thinking. You can do so much more with screens, adding metrics/charts and other elements to lists and screens to make them far more visual & useful for users
  • It can be frustrating that new Freedom pages don't always go in the package you want. You can control this by adding packageUId in the URL of the page designer or disable the "smart" package feature so it just uses the current package system setting
  • To get the UI how you'd like don't forget you can put containers inside of containers. A layout element can have nested layout elements to split up cells/controls. 
  • For the most part, I'm always disabling editable lists so they aren't editable. You lose too much control over things in an editable list for now. Hopefully soon we'll be able to have events, rules, validation, etc for editable lists, but that isn't there now.
  • The lack of Freedom UI specific documentation is frustrating. Going beyond "no code" seems to be pushed to the side and it's not uncommon that code will break between versions. It's completely aggravating. Luckily, there's a huge amount of things that used to require code that now can be done with a no code approach, however, it doesn't cover everything and once you need to go beyond no code it can get frustrating at times - especially with such little documentation (or none) on the topics. I do have a lot of articles on things I've discovered with coding for Freedom UI screens here

Ryan

Damien Collot,

Perfect. Thank you for the detialed notes. All points are noted

Ryan Farley,

Perfect. Thank you for the detialed notes. All points are noted

Show all comments

Is it possible to intercept using some request handler the event when a user clicks on the green "Complete" button on a Next Steps tile? This is the button in the "next-step-tile-actions" div on the page which only appears when you hover over the next step tile:

 

It would be vey helpful to be able to run some custom code when this button is clicked - in our case, we need it to save the main page record before actioning this next step, as completing the next step might automatically transition the Lead to the next stage, losing any data entered by the user.

Like 220

Like

6 comments

None of the following handlers are triggered by clicking this button, maybe I've missed some candidates but these are the ones I've tried so far:

crt.ChangeNextStepsStateRequest

crt.OpenPageRequest

crt.UpdateRecordRequest

crt.CreateRecordRequest

Also tried "brute forcing" it by overriding every handler I could find in the Creatio code, but literally nothing fires when clicking that button! Not even something like the page's crt.HandleViewModelPauseRequest (since it's a modal popup, I guess the full page doesn't actually pause like it would when navigating to a another page through clicking a lookup for example). Hopefully I've missed something, triggering some action on clicking that button would be useful.

Any thoughts/knowledge on how such a thing could be achieved?

Hi Harvey! 

 

Unfortunately, at the moment, there is no way to intercept the event of clicking on the Next-steps tile buttons. This button can call different requests depending on the type of tile, and these requests are called without the view model context, which will not allow us to intercept them from the card and use them to save card data.

 

We have registered your idea, and the R&D team has already planned the task for this improvement - they will create a special output event for the Next-steps component. This functionality will be available in future releases.

 

Thank you for making our product better!

 

Best regards,

Natalia

Thank you for the information Natalia, this would be a welcome improvement!

Hi Natalia, is there any expected timeline for this improvement known yet? Do you have a reference for the planned task for later follow-up?

Show all comments

Just a quick PSA - either 8.1.2 or 8.1.3 breaks the ability we had before of being able to set Page Parameter values in the crt.HandleViewModelInitRequest request handler, since in the newer versions it appears the value is reset back to the default (similar to how fields based over table columns are) at some time after the init handler runs. This is quite frustrating, as it's reducing the number of options we have for setting values in the code where required (which it still often is with the current options for no code development).

 

A workaround that Ryan Farley has previous mentioned using for setting field values by using a javascript timeout can be used for this too, e.g.

setTimeout(() => {request.$context.TextPageParameter = "Test value";}, 300);
Like 2

Like

8 comments

Hello, Harvey

I also had such an isuue but I resolved it by calling parameter initialization after let result =  await next?.handle(request); And then in the end return result; 

Andrii Orlenko,

 

Mine was already being initialised after awaiting the result of handling the request, so it might be that sometimes this takes long enough to be ok but not always (so would introduce a race condition).

Harvey Adcock,

Thank you for the provided information!
The problem is already registered on the R&D team, and we hope to see the fix in future releases.

Anhelina,

Thank you. 

Just an FYI, I've been reporting this since 8.0.10 (see #SR-01234445). I was told this would be resolved in "the nearest releases (8.1.1-8.1.2)", however, it's still an issue in 8.1.3 without a commitment from Creatio on a specific timeframe for a resolution. This is a pretty huge pain point so it's disappointing that it's still a problem. I do love Freedom UI (and I'll take it any day over classic!) but there's been many instances of my code breaking along the way with new versions and it sometimes seems less urgent for fixes for issues that go beyond the "no code" customizations.

Ryan

Ryan Farley,

I checked that case before replying to Harvey and asked the responsible team to raise the priority for this task. I apologize for the delay and hope to see the fix soon.
Meanwhile, they shared one more workaround, which is better to use with parameters:

add the handler on parameter changing and rewrite it when the default value has appeared:

Example

Anhelina,

Yes, this approach does work if all you need when the form is initialized is to work with a single value on the page. However, that is often not the case and each property initialization can happen at slightly different times, so referencing other attributes in this same handler might not work, depending on the timing of the various attributes being loaded/initialized. Adding a separate handler for each attribute you need to work with can get messy quick.

Ryan

What I think would be nice/match the existing patterns would be to have some new request handler that does the setting of default values on the page, something like "crt.HandleAttributeInitRequest", which would perform the OOTB platform's setting of these values in the next?.handle(request) and then after awaiting the result of that a developer could set their own defaults for fields they need to, which wouldn't be overwritten (since the defaults had already been set).

 

It would also be nice to be able to "silently" set these default values (like you could in Classic UI) so that setting values in that request handler wouldn't cause the "are you sure" dialog to appear if a user closes the page without actually modifying the data themselves. Actually it would be nice to be able to do that generally from within request handler code.

Hi, is there any update on the matter? 
Still when you're trying to read the attributes on crt.HandleViewModelInitRequest the attributes aren't initialized and are all undefined

Show all comments

It looks like in 8.1.3, when clicking the magnifying glass on a lookup field which is configured to show the lookup page modal popup, the handler crt.OpenSelectionWindowRequest is now called instead of crt.OpenLookupPageRequest. Is is the case that the old handler has been swapped for the new one? Why has this been done? And are there any important differences to be noted? It's broken some of our client's custom code in the upgrade, and from a surface view it looks like it works in much the same way as the old handler and that simply swapping the code to use the new handler instead of the old works, but don't want to make any assumptions on that. Anybody have any insight on this?

Like 2

Like

10 comments

Hmm. Good find. I’ll have some broken customizations as well. Hopefully we’ll get an official word about the change. This isn’t the first time I’ve had things break from changes to core Freedom UI things. I like using Freedom UI but at times it feels like a moving target. We need some commitment from Creatio about avoiding breaking changes. 
Ryan

Hi Harvey, 

I just tested this in an 8.1.3.6734 system and both "crt.OpenSelectionWindowRequest" and "crt.OpenLookupPageRequest" did open the selection/lookup window for me. However, using the results seemed to work differently depending on which request I used, it didn't work to just change the request name and leave the rest of the code as-is. So they do appear to possibly be slightly different requests, at least from my very limited tests so far 🤷🏼‍♂️

Ryan

Interesting, thanks for the additional info Ryan! For triggering the lookup page from code I think we'll stick with the original method for now then.

 

But a little PSA for anyone wondering why their code overriding the crt.OpenLookupPageRequest handler to intercept and add filters/perform other logic when a user triggers a lookup page on a lookup field configured to view as "Selection window" rather than dropdown list, they should now be overriding crt.OpenSelectionWindowRequest instead. Hopefully we'll get some clarification on why this has changed and any implications.

Harvey Adcock,

8.1.3 is the first release with this API published, and Creatio mentioned the API for Freedom UI selection window in the 8.1.3 release notes. At the same time, we left it without changes so as not to break possible customizations with the old unpublished API. However, the old API is effectively deprecated, and the new API should be used from now on.

The full article for the Academy is almost ready and will be officially published soon.
Here is part of main information (maybe some parts will be changed, that's why please follow the updates): 
In order to open the lookup window, you have to use crt.OpenSelectionWindowRequest:
 

/**
 * @publicApi
 */
@CrtRequest({
    type: 'crt.OpenSelectionWindowRequest',
})
export class OpenSelectionWindowRequest extends BaseRequest {
    public itemAttributeName?: string;
    public itemsAttributeName?: string;
    /**
     * @publicApi
     */
    public entitySchemaName?: string;
    /**
     * @publicApi
     */
    public schemaName?: string;
    /**
     * @publicApi
     */
    public filtersConfig?: FiltersConfig;
    /**
     * @publicApi
     */
    public features?: PageLookupFeatures;
    /**
     * @publicApi
     */
    public selectionState?: SelectionState;
    /**
     * @publicApi
     */
    public afterClosed?: (result: SelectionWindowResult) => void;
    /**
     * @publicApi
     */
    public caption?: LocalizableString;
}

 

Add the following code to your custom handler:

handlers: /**SCHEMA_HANDLERS*/[
			{
				request: "usr.OpenLookupRequest",
				handler: async (request, next) => {
					devkit.HandlerChainService.instance.process({
						type: "crt.OpenSelectionWindowRequest",
						scopes: [...request.scopes],
						$context: request.$context,
						entitySchemaName: "Contact",
						// caption: 'Responsible',
						schemaName: 'CustomLookupPage',
						itemAttributeName: 'LookupAttribute_2mnilrq',
						// itemsAttributeName: 'Contact_List',
						afterClosed: async (result) => {
							if (!result.canceled) {
								const lookupValues = await result.getLookupValues();
								const value = lookupValues[0];
								if (value) {
									alert(value?.displayValue ?? '');
								}
							}
						},
						filtersConfig: {
							filterAttributes: [
								{
									name: 'MyFilter',
									loadOnChange: false
								}
							],
							attributesConfig: {
								MyFilter: {
									value: {
										"items": {
											"29e16d42-36f1-4e04-9029-4321cbb2494d": {
												"filterType": 1,
												"comparisonType": 11,
												"isEnabled": true,
												"trimDateTimeParameterToDate": false,
												"leftExpression": {
													"expressionType": 0,
													"columnPath": "Name"
												},
												"isAggregative": false,
												"dataValueType": 1,
												"rightExpression": {
													"expressionType": 2,
													"parameter": {
														"dataValueType": 1,
														"value": "Super"
													}
												}
											}
										},
										"logicalOperation": 0,
										"isEnabled": true,
										"filterType": 6,
										"rootSchemaName": "Contact"
									}
								}
							}
						}
					});
					return next?.handle(request);
				}
			}
		]/**SCHEMA_HANDLERS*/,

where

entitySchemaName - the name of the entity schema whose data is displayed in the lookup window. Optional parameter. If not specified, the data source is taken from the attribute specified in itemAttributeName

caption - optional parameter, displayed in the window title. If caption is not specified, the caption is taken from the attribute specified in the itemAttributeName parameter. If itemAttributeName is not specified, then from the entity schema.

schemaName - the name of the schema that is displayed in the lookup window. Optional parameter. Default is BaseLookupPageTemplate

itemAttributeName - the name of the attribute from which the title is taken, the name of the entity schema and in which the result of the selection in the window will be written. Optional parameter. As a rule, this is the attribute with which the Combobox control is associated.

itemsAttributeName - the name of the attribute from which the data source name is taken. Optional parameter.

afterClosed - callback function returning the result of the selection in the window. Optional parameter.

filtersConfig- describes the filter to be applied to the data. Optional parameter

P.S. Additionally, users can enable features and much more, which you're able to read from the article on the Academy in the near future.

 

Anhelina,

Thanks for this Anhelina. 

Anhelina, 

Hi!

How i can filter SelectionWindow by using value from lookup field on page? 

 

I try this: 

{
   request: "usr.AddSection",
   handler: async (request, next) => {
 
       const id = request.$context.PDS_Transport2_93i8xm8;
 
 
       request.$context.executeRequest({
           type: "crt.OpenLookupPageRequest",
           $context: request.$context,
           entitySchemaName: "Section",
           features: {
               select: {
                   multiple: true,
                   selectAll: false,
                   resultType: 'lookupValues'
               },
               create: {
                   enabled: false
               }
           },
           filtersConfig: {
               filterAttributes: [
                   {
                       name: 'MyFilter',
                       loadOnChange: false
                   }
               ],
               attributesConfig: {
                   MyFilter: {
                       value: {
                           "items": {
                               "29e16d42-36f1-4e04-9029-4321cbb2494d": {
                                   "filterType": 1,
                                   "comparisonType": 11,
                                   "isEnabled": true,
                                   "trimDateTimeParameterToDate": false,
                                   "leftExpression": {
                                       "expressionType": 0,
                                       "columnPath": "Transport"
                                   },
                                   "isAggregative": false,
                                   "dataValueType": 1,
                                   "rightExpression": {
                                       "expressionType": 2,
                                       "parameter": {
                                           "dataValueType": 1,
                                           "value": id.value
                                       }
                                   }
                               }
                           },
                           "logicalOperation": 0,
                           "isEnabled": true,
                           "filterType": 6,
                           "rootSchemaName": "Section"
                       }
                   }
               }
           },
           afterClosed: function(selectedItems) {
               const textValues = Object.values(selectedItems).map(item => item.displayValue).join(', ');
               request.$context.PDS_SectionUpload_h11bk0p = textValues;
           }
       });
   }
}

but always get error: The data types nvarchar and uniqueidentifier are incompatible in the add operator.

Ryan Farley,

Maybe you can help?

 

Grygorii Synieok,

You forgot to await the value when getting the attribute. 

Change to this (note the added "await"): 

const id = await request.$context.PDS_Transport2_93i8xm8;

Ryan

Ryan Farley,

Thank you!

But another problem was with: "dataValueType":10 and  "comparisonType":3 with this parametrs works fine.

Full code:

{
    request: "usr.AddSection",
    handler: async (request, next) => {
 
        var autoId = await request.$context.PDS_UsrTransport2;
 
 
        request.$context.executeRequest({
            type: "crt.OpenLookupPageRequest",
            $context: request.$context,
            entitySchemaName: "SectionAuto",
            features: {
                select: {
                    multiple: true,
                    selectAll: false,
                    resultType: 'lookupValues'
                },
                create: {
                    enabled: false
                }
            },
            filtersConfig: {
                filterAttributes: [
                    {
                        name: 'MyFilter',
                        loadOnChange: false
                    }
                ],
                attributesConfig: {
                    MyFilter: {
                        value: {
                            "items": {
                                "29e16d42-36f1-4e04-9029-4321cbb2494d": {
                                    "filterType": 1,
                                    "comparisonType":3,
                                    "isEnabled": true,
                                    "trimDateTimeParameterToDate": false,
                                    "leftExpression": {
                                        "expressionType": 0,
                                        "columnPath": "Transport"
                                    },
                                    "isAggregative": false,
                                    //"dataValueType": 1,
                                    "rightExpression": {
                                        "expressionType": 2,
                                        "parameter": {
                                            "dataValueType": 10,
                                            "value":autoId.value
                                        }
                                    }
                                }
                            },
                            "logicalOperation": 0,
                            "isEnabled": true,
                            "filterType": 6,
                            "rootSchemaName": "SectionAuto"
                        }
                    }
                }
            },
            afterClosed: function(selectedItems) {
                const textValues = Object.values(selectedItems).map(item => item.displayValue).join(', ');
                request.$context.PDS_UsrSection = textValues;
            }
        });
    }
}

Hello Harvey,

 

I've a 8.1.3 environment and on some pages the crt.OpenLookupPageRequest works correctly  while on other pages it doesn't open the required lookup

Do you have the same issue ?

 

 

 

 

 

Show all comments

Hi,

 

I have a Freedom UI list where I can take a few actions after the user has selected one or more rows. The actions run as expected, but the records are kept selected after the actions run and the user has to manually clear the selection. What do I need to add to the custom code to clear the selection? 

Thanks,
Jose 

File attachments
Like 1

Like

7 comments
Best reply

Jose Hernandez,

 

You need to try

 

request.$context.GridDetail_tviz7gf_SelectionState = null
 

null is needed to remove the selection, but also change GridDetail_tviz7gf to your list attribute.

Hello,

Could you describe exactly what your custom logic performs for better understanding?

Malika,

 

It depends on the action. The Unlock one just clears the locked by field for the selected cases. The print generates letters and sends them to our print vendor for each case selected. Finally, the Assign one opens a window where the user can select the person to assign the cases to. Each one is calling the code below with the proper parameters.

I just need to know what I need to add to that code to clear the selection after the code that runs the business process.

 

Thanks,

Jose

        processSelectedRows: async function(request, processName, message, next) {
            var selectedRecords = await this.getSelectedRows(request.$context);
            var count = selectedRecords.count;
            var date = new Date();
            var hours = date.getHours();
            var minutes = date.getMinutes();
            var ampm = hours >= 12 ? 'PM' : 'AM';
            hours = hours > 12 ? hours - 12 : hours;
            var timeString = hours.toString().padStart(2, '0') + ':' + minutes.toString().padStart(2, '0') + " " + ampm;
            message = message + " on " + timeString + " for " +  count + " selected records.";
            request.$context.executeRequest({
                type: "crt.NotificationRequest",
                message:message
            });
            const handlerChain = sdk.HandlerChainService.instance;
            result = await handlerChain.process({
                type: 'crt.RunBusinessProcessRequest',
                processName: processName,
                processRunType: "RegardlessOfThePage",
                processParameters: {
                    "SelectedRecords": selectedRecords.selected
                },
                $context: request.$context
            });
            if (!result.success)  {
                var errorMsg = Ext.String.format(resources.localizableStrings.UnableToProcessSelectedRows, processName, result.errorInfo?.message);
                request.$context.executeRequest({
                    type: "crt.NotificationRequest",
                    message: errorMsg
                });                        
            }
            /* Call the next handler if it exists and return its result. */
            return next?.handle(request);
        }

I've not tried clearing the selections, but it might work to do this after you execute the process: 

request.$context.DataTable_SelectionState.selected = [];

Or it could be that you'll set SelectionState to null or {}?

Ryan

Ryan Farley,

Thanks Ryan. I tried that (and other variations like setting the type to 'clear') and the model gets cleared, but the GUI is not refreshed. In other worlds on the page the records are still showing as selected even though the model now has cleared the selection.

Jose Hernandez,

 

You need to try

 

request.$context.GridDetail_tviz7gf_SelectionState = null
 

null is needed to remove the selection, but also change GridDetail_tviz7gf to your list attribute.

Thanks Oleg. That worked. In my case I used  request.$context.DataTable_SelectionState = null; 

Viktoriia,

 

Hello,

 

It's 

 

request.$context.DataTable_SelectedRows
 

DataTable should be replaced with your list attribute name.

Show all comments

HI, 

 

How do I push or replace navigation history in freedom. In classic UI you were able to do it  using a sandbox message. 

 

Is it possible to be done in Freedom?

 

Thank you!

Like 1

Like

4 comments

Are you referring to pushing to navigation history (as far as going to the record/page itself)?

If so, this shows how to open a page (section or other page) https://customerfx.com/article/navigating-to-a-page-via-code-in-a-creatio-freedom-ui-page/

This shows how to open a record page in add or edit mode https://customerfx.com/article/opening-an-edit-page-to-add-or-edit-a-record-via-code-in-a-creatio-freedom-ui-page/

If I've misunderstood what you're after let me know. Hope this helps. 

Ryan

Hi Ryan, thank you for your answer.

No that's not what I'l looking for. What I want to do is what history.replaceState(state, unused, url) does in JS. change the shown url and the browser history, but not navigate. 

Javier Collazo,

Ah I see now. I've not noticed any equivalent of that in the devkit. I've seen a navigationservice and router classes as possibilities in the internal code, but they aren't exposed in devkit.

One possibility is to use the "crt.7XRequest" request. I've been able to use that for what would have been a sandbox.publish previously, a least for what I've tried with it so far. See https://customerfx.com/article/navigating-a-user-back-from-a-creatio-freedom-ui-page/

Might take a little playing with to figure out how to get the other params passed for stateObj, pageTitle, etc. Searching the source for "crt.7XRequest" would likely find some examples of similar requests.

Ryan

Javier Collazo,

I did find an example: 

await handlerChain.process({
    type: "crt.7XRequest",
    $context: null,
    action: "ReplaceHistoryState",
    hash: someHash,
    stateObj: obj,
    silent: isSilent
});

Ryan

Show all comments