I am trying to use crt.SaveRecordRequest for list page but this is not working, Is there any other request we need to use in freedom UI to run a code on Save all pressed? 

 

Here is my code

 

handlers: [
 {
   request: "crt.SaveRecordRequest",
   handler: (request, next) => {
     console.log("handler triggered: ");
     return next.handle(request);
   }
 }
],

 

 

I am able to run this code successfully on record page for that and code works perfectly but same code doesn't work on list page. 

 

For testing I have tried running HandleViewModelAttributeChangeRequest on list page and it worked fine so just the above SaveRecordRequest is not working.

 

handlers: /**SCHEMA_HANDLERS*/[

       {

           request: "crt.HandleViewModelAttributeChangeRequest",

           handler: async (request, next) => {

               console.log("# Atribute updated :", request);  

               return next?.handle(request);

           }

       }

   ]/**SCHEMA_HANDLERS*/,

Like 0

Like

2 comments

Hello,

 

You are right to use crt.SaveRecordRequest, the only thing you need to add a check for the attribute name. Here is the screenshot from the debugger when clicking the "Save all" button:

Like

 

 {
                request: 'crt.SaveRecordsRequest',
                handler: async(request, next) => {
                  if (request.itemsAttributeName == "GridDetail_9ib3s20"
) {
                    console.log("I am triggered");
                  }
                  return next?.handle(request);
                }
            }

Thank you for the response. I see the difference now so for record page its 'crt.SaveRecordRequest' but for list page its with s 'crt.SaveRecordsRequest'

Show all comments

Hi!

 

I'm trying to get all items in my detail list on freedom ui in the handler: "crt.SaveRecordRequest".
When enter in this handler, I need to read the values from an especific field from all items in the detail (In the image below you can see the field).
How can I access all items?

Like 0

Like

1 comments

Hello,

 

Here is the example of a handler where I read all values displayed in the list of contacts on the account form page:

{
                request: 'crt.SaveRecordsRequest',
                handler: async(request, next) => {
                  if (request.itemsAttributeName == "GridDetail_9ib3s20"
) {
                    const gridDetail = await request.$context.GridDetail_9ib3s20;
                    let nameColumnValues = [];
                    gridDetail.forEach((item) => {
 
                      nameColumnValues.push(item.GridDetail_9ib3s20DS_Name.__zone_symbol__value);
 
                    });
                    console.log(nameColumnValues);
                  }
                  return next?.handle(request);
                }
            }

 

GridDetail_9ib3s20 - is the attribute name for my test list.

As a result the array of names was logged in the console:

So you can try the same approach on your end.

Show all comments

Dear colleagues,

 

In Classic UI when ran a process we can get resultParameterValues in Client Code.

 

I need to do the same but in Freedom UI client module,

 

I saw some code like this in Academy, Community and so on, but didn't any who shows us how to get process output paramaters

const handlerChain = sdk.HandlerChainService.instance;
const result = await handlerChain.process({
    type: "crt.RunBusinessProcessRequest",
    processName: "UsrSomeProcess",
    processParameters: {
        AccountId: await request.$context.Id,
        InputParameter1: "Some Value 1",
		InputParameter2: "Some Value 2"
 
    },
    $context: request.$context
});
 
if (result.success) {
    // process was sucessfully executed
}

 

Please help

 

Thanks

Julio Falcón

Like 1

Like

5 comments

I saw in the debugging is there some resultParameterValues in the response, but is null and I have one output parameter?

 

Julio.Falcon_Nodos,

Solved! due the debugging resultParameterNames element I tried and works, here the result

 

// Inicialize Process input parameters
var ClienteObject = await request.$context.NCSDetalleDelPedidoDS_NCSCuenta_kn04jps;
var LugarPobladoObject = await request.$context.NCSDetalleDelPedidoDS_NCSLugarPoblado_g8rmatm;
var ProductoObject = await request.$context.NCSDetalleDelPedidoDS_NCSProducto_cuzrngv;
if ( ClienteObject == null || LugarPobladoObject == null || ProductoObject == null ) {
	await next?.handle(request);
 
}
/// Run process
const handlerChain = sdk.HandlerChainService.instance;
const result = await handlerChain.process({
	type: "crt.RunBusinessProcessRequest",
	processName: "NCSPrecioFinalProductoPedido",
	processParameters: {
		DetallePedidoID: await request.$context.Id,
		ClienteID: ClienteObject.value,
		LugarPobladoID: LugarPobladoObject.value,
		ProductoID: ProductoObject.value
 
	},
	/* Process Output Paramters */
	"resultParameterNames": [
		"PrecioFinal",
		"ProcessesRanOK"
	],
	$context: request.$context
});
 
// Result is OK?
if ( result.success && result.resultParameterValues[ "ProcessesRanOK" ] ) {
	// OK, get price
	request.$context.NCSDetalleDelPedidoDS_NCSPrecio_leqtalu = result.resultParameterValues[ "PrecioFinal" ];
 
} else {
	// Some error msg
	console.log( "Error getting price" )
 
}

Julio.Falcon_Nodos,

Julio, excellent find - I assume the start of the process needs to be marked as "run in background" = false? Can you check if your process is marked that way?

Ryan

.

Ryan Farley,

Hi Ryan, 

 

Yes, I have configured it as you indicate. Happy to help you!

Julio

Show all comments

Hi all, 

  In the Next Steps approval element of Freedom UI, is it possible to add an additional button? We already have 'Approve' and 'Reject' buttons, but I would like to include a 'Revise' button as well.


Regards,
Elakkia 

Like 2

Like

4 comments

Hi all,
Could anyone please help on this
Regards,
Elakkia.

Elakkia ,Hello!
 

Unfortunately, adding your own button to existing templates is not possible.
 

However, the development team is currently working on an article that will describe the steps to add a custom tile in the Next Steps element through code. This article will soon be available on our academy.
 

Additionally, we have registered an idea to add the "Revise" button to the default tile template in the Next Steps.
 

Thank you for your request!

 

Pavlo Sokil,

Thanks for the reply!

Pavlo Sokil,

Are there any estimations for both of that plans? 

 

i mean the article, and "Revise" button?

Show all comments

Dear colleagues,

 

In a Freedom ListPage, I need to process all the records that a user selects AND REPORT THE RESULTS AT THE END.

 

I'm having trouble figuring out how to approach this task. Currently, as I understand it, we call a process with the ID of the record to be processed.

 

Is there a way to know when all the selected records have been processed and know which ones?

 

I'm trying to implement a temporary table to insert the IDs of the selected records, but for this, I need to have a unique ID in that temporary table so that if there are multiple users doing the same thing, the current user's records are not mixed up. To do this, I've edited the code of the page where the service call is made to pass a second parameter to the process, an ID that I need to generate, but the generated ID is always the same "00000000-0000-0000-0000-000000000000":

			"parameterMappings": {
				"NotaCreditoID": "Id",
				"ProcesoID": Terrasoft.utils.generateGUID()
			},

 

What am I doing wrong with this approach?

 

Here is an excerpt of the modified code:

 

define("NdosNotasCredyDeb_ListPage", /**SCHEMA_DEPS*/["@creatio-devkit/common"]/**SCHEMA_DEPS*/, function/**SCHEMA_ARGS*/(sdk)/**SCHEMA_ARGS*/ {

 

"operation": "insert",
"name": "Button_ft2cncy",
"values": {
	"type": "crt.Button",
	"caption": "#ResourceString(Button_ft2cncy_caption)#",
	"color": "default",
	"disabled": false,
	"size": "large",
	"iconPosition": "only-text",
	"visible": true,
	"clicked": {
		"request": "crt.RunBusinessProcessRequest",
		"params": {
			"processName": "NdosLiberaDescartaNC_CC",
			"processRunType": "ForTheSelectedRecords",
			"showNotification": true,
			"dataSourceName": "PDS",
			"parameterMappings": {
				"NotaCreditoID": "Id",
				"ProcesoID": Terrasoft.utils.generateGUID()
			},
			"filters": "$Items | crt.ToCollectionFilters : 'Items' : $DataTable_SelectionState | crt.SkipIfSelectionEmpty : $DataTable_SelectionState",
			"sorting": "$ItemsSorting",
			"selectionStateAttributeName": "DataTable_SelectionState"
		}
	},
	"clickMode": "default"
},

 

On the other hand, has anyone done this in any other way? How?

 

Thank you very much

 

Julio

Like 0

Like

4 comments
Best reply

Hi Julio, 

As of Creatio 8.1.3 you can pass multiple records into a process using a collection parameter. This executes a single process for the collection of selected records. See an example in this article: https://customerfx.com/article/launching-a-process-for-multiple-records-in-a-creatio-list/

Ryan

I'm also tried sdk.generateGuid(), I test it on the console and returns a Guid, but for some reason the parameters is not delivered to the process, what's wrong?

Hi Julio, 

As of Creatio 8.1.3 you can pass multiple records into a process using a collection parameter. This executes a single process for the collection of selected records. See an example in this article: https://customerfx.com/article/launching-a-process-for-multiple-records-in-a-creatio-list/

Ryan

Ryan Farley,

Thanks Ryan,

 

I know and I use them, the problem is the process ran for each record individually and if I need to detect when it processes all selected records, generate a report like "Selected records xxx, processed records yyy" and actually this is not possible 

 

At least I don't know how to do this.

 

Thanks again

 

Julio

Thanks Ryan, your article solves my problem, great job as usual

 

Regards

Julio

Show all comments

Hi,

Anyone experienced the same error as me?

 

*UsrSomePage is not allowed due to ACL setup for *CurrentUser. Failed rules: - Object page settings rule.


HTPP: PostClient:


 

I have a classic page I'm trying to open from a freedom detail. My button works perfectly for Supervisor then opens the classic page, but for any other user it doesn't. The object has no permissions declared at the Object Permission section.

Let me know if you know anything.

PS
I tried adding System Administrator to User and the button works, but I don't want to do that. Object has no permission set-up. 

Regards,
Solem A.

Like 0

Like

2 comments
Best reply

Hello,

 

The possible reasons, why user can't open the page:
1. User does not have permissions to page data source. 
2. The list page is not added to any workplace, available for user. 
3. Another page is configured for the current user (or his role) in the object related pages.

 

Solution:
1. Set up correct permissions, workplaces (check 1-3 points above). 
2. Add page to the Whitelist of pages to bypass page opening restrictions lookup, if customer want to allow any user can open via direct URL regardless of configured permissions. 
3. Add user (or role) to CanBypassPageOpeningRestrictions system operation to bypass all restrictions. We strongly recommend to use correct configuration (not just bypass permissions) to provide the best level of security. 

Hello,

 

The possible reasons, why user can't open the page:
1. User does not have permissions to page data source. 
2. The list page is not added to any workplace, available for user. 
3. Another page is configured for the current user (or his role) in the object related pages.

 

Solution:
1. Set up correct permissions, workplaces (check 1-3 points above). 
2. Add page to the Whitelist of pages to bypass page opening restrictions lookup, if customer want to allow any user can open via direct URL regardless of configured permissions. 
3. Add user (or role) to CanBypassPageOpeningRestrictions system operation to bypass all restrictions. We strongly recommend to use correct configuration (not just bypass permissions) to provide the best level of security. 

Mira Dmitruk,


This worked for me, 
 

Add page to the Whitelist of pages to bypass page opening restrictions lookup, if customer want to allow any user can open via direct URL regardless of configured permissions.

 

Thank you!
Solem A.

Show all comments

Hi everyone,

I need to add validation checks and perform calculations on certain fields when the "Save All" button is clicked in a specific detail. 

Could you please guide me on how to add custom code to this button's click event? 

Which handler should I implement or override to achieve this?

Thanks in advance for your help!

Like 0

Like

3 comments

Hello Rachel,

When you click "Save All" button crt.SaveRecordsRequest is called.
Override this handler by implementing your version of it with logic you need.

Hope this helps 

Yevhenii Grytsiuk,

Thank you very much for your answer!
I tried using the crt.SaveRecordsRequest handler, and it works great!

 

I have another question, if you don’t mind:

Which handler is called when the user clicks the "New" button in a detail that has the "Inline adding records" option enabled?

 I’m referring to this button:

 

 

 

By the way, I noticed the image you previously shared didn’t load correctly. Could you please resend it? I’m very interested in understanding this feature better.

 

Also, is there a consolidated resource where all these handlers are documented? I noticed that the Academy only covers documentation for basic handlers.

 

Thanks again for your help!

Rachel

 

 

Hi everyone,

Just checking for updates on the "New" button handler in a detail with "Inline adding records." 

Thanks!

Show all comments
Question

Hi community,

 

Is there a way to put an input mask on an input in freedom UI ? 
for example I have a text field and I want to have a mask "44[0-9]{8}"

It'd be best if I can pre-fill the input with the mask.

Like 0

Like

2 comments

Hello Yurii,

OOTB, we have input mask for Freedom UI phone number fields. This can be turned on in the designer:



Additionally, you can check out the following community post on how to add an input mask: https://community.creatio.com/articles/how-add-input-mask

I hope this helps.

Have a great day!

Alina Yakovlieva,

Thanks, I know about the phone number thing. The post you sent link to refers to old UI. Is there a way to create an input mask for Text field(not phone number) in FreedomUI ? Code works too

Show all comments

Hi,

Is there a way to alter the open record event of a detail row in Freedom so that it runs a particular event that I want? I see some example of HandlerChain, but those are primarily from a button.



Example, instead of opening the edit record page of the product when clicking "Motherboard..." I want to change what it does.

Regards,
Solem A.

Like 0

Like

1 comments
Best reply

Hello,

 

Find the _sendRequest method in the core file like 1964.1a6d8f3494eb48eb.js. This will show that the request sent when clicking the record is "crt.UpdateRecordRequest" (on the screenshot below I've clicked the Account column value for the record in the "Job experience" list on the contact page):

So in case you need to modify the logic you need to add a check for the UpdateRecordRequest and make sure it's called when clicking the needed column value (using the recordId parameter for example).

Hello,

 

Find the _sendRequest method in the core file like 1964.1a6d8f3494eb48eb.js. This will show that the request sent when clicking the record is "crt.UpdateRecordRequest" (on the screenshot below I've clicked the Account column value for the record in the "Job experience" list on the contact page):

So in case you need to modify the logic you need to add a check for the UpdateRecordRequest and make sure it's called when clicking the needed column value (using the recordId parameter for example).

Show all comments

Hey Community,

I'm looking to access the `onclick` / 'FolderTreeVisibleChanged' handler of the Folders button on Freedom UI list pages. What is the name of the handler method that i can use?


Like 0

Like

3 comments
Best reply

Hello sprity,

If i understood you correctly, you want to control visibility state or togle mode of the folders tree. The handler you provided, well, is responsible for this logic.  

Here is an example of how you can do it:

Toggle mode (open if closed, close if open):

    request: 'crt.FolderTreeVisibleRequest', 
    params: { 
        folderTreeName: "FolderTree_blabla", 
        togglePanel: true 
    } 
}

Explicit visibility mode (always open or always close, regardless of current state):


    request: 'crt.FolderTreeVisibleRequest', 
    params: { 
        folderTreeName: "FolderTree_blabla", 
        visible: true  // or false to close 
    } 
}

As mentioned, this handler also saves the state to the user profile, meaning that when the page is reopened, the folder tree will be in the same state (open or closed) as it was before. If you'd prefer not to save the state in the profile, you can manually update the visibility attribute, like so:

{folder tree name}_visible => FolderTree_blabla_visible

Hope this helps! Let me know if i understood you correctly and if you have any questions let.

Hello sprity,

If i understood you correctly, you want to control visibility state or togle mode of the folders tree. The handler you provided, well, is responsible for this logic.  

Here is an example of how you can do it:

Toggle mode (open if closed, close if open):

    request: 'crt.FolderTreeVisibleRequest', 
    params: { 
        folderTreeName: "FolderTree_blabla", 
        togglePanel: true 
    } 
}

Explicit visibility mode (always open or always close, regardless of current state):


    request: 'crt.FolderTreeVisibleRequest', 
    params: { 
        folderTreeName: "FolderTree_blabla", 
        visible: true  // or false to close 
    } 
}

As mentioned, this handler also saves the state to the user profile, meaning that when the page is reopened, the folder tree will be in the same state (open or closed) as it was before. If you'd prefer not to save the state in the profile, you can manually update the visibility attribute, like so:

{folder tree name}_visible => FolderTree_blabla_visible

Hope this helps! Let me know if i understood you correctly and if you have any questions let.

Yevhenii Grytsiuk,

Thank you for this Yevhenii. One of the more difficult parts of working with Freedom UI is the inability to dig into the out of the box code to see how to change the behavior. This was easy with classic, but for Freedom we have to dig through all the minified code to see if we get lucky finding what we are after. 
Until there's better documentation outlining what all the various requests are to handle, it would be great to have some sort of switch (like the IsDebug setting to enable debug mode) that just dumps all the fired requests to the console (and maybe include what object/component fired the request?) Not sure how reasonable that would be since it's likely quite a bit of stuff would show there, but might make it easier to see the requests that fire when some action is taken.

Ryan

Ryan Farley,

Sounds great to me. I will register your idea so that our r&d team hopefully would implement it.

Show all comments