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,

 

We are trying to insert data in a datetime field in contact table from database via API. But the time shown in Creatio is different from the database. For example - one record shows as 2024-01-15 16:54:48.000 in the database whereas in Creatio it shows as 1/15/2024 10:54 AM. We are in central timezone and user profile is set to central timezone. How can we correct this?

 

Thanks

Like 1

Like

1 comments

Hello!

 

Actually it occurs because all dates savings in DB in UTC time zone and only then converting to users according their timezone settings. But when you making API request it returns date same as in DB. There is no possibility to change this behavior at this moment.

Show all comments

Hello community

 

I would like to monitor the progress of the "Generate all schema" request,

While for the "compile all" request I can monitor the progress by checking the build.log file in c:\windows\temp, the "generate all schemas" does not loggine anything.

 

Do you have suggestions?

Like 0

Like

1 comments

Hello!
 

Indeed, we do not log this anywhere, as it’s handled at the database level. We’ll create a task for the R&D team to consider implementing this in future updates.


Thank you for helping make Creatio better!

Regards,

Orkhan

Show all comments

Hi,

I've got two separate cases where a contact's phone number is displaying as [#PhoneNumber#]:


I've checked the Submitted Forms for both contacts and in each case a phone number was entered:



However, when I look at the Submitted form in table view, the phone number shows up as [#PhoneNumber#] again:


Do you know what might be causing this?

Thanks!

Like 0

Like

1 comments

Hello,

 

Unfortunately, without advanced information about your form setup, it is impossible to tell what exactly went wrong with the number registration.

You can provide the setup in the topic so other users would have a better idea of what exactly is causing the number to be rendered in such a format or create the support ticket so the Creatio employees will have a chance to research this issue.

 

Thank you for being an active part of the Creatio Community!

Show all comments

Hello community,

 

I've configured an entity with a column with default value from system settings.

When I install the package I received the error the system settings used for default does not exist.

What am I doing wrong?

Like 0

Like

2 comments

Did you include the system setting (SysSettings) and the system setting value (SysSettingsValue) in the package as well?

Ryan

Ryan Farley,

Hi Ryan

Both SysSettings and SysSettingsValue are defined.

I've done some test and the problem is the missing value in the SysSettingsValue.

Show all comments

Hello Creatio Community,

 

I am currently following Responding to an Change Event When a Field is Changed on a Creatio Freedom UI Page to auto-save the record when a number field is modified.

While the auto-save feature works, I’ve encountered an issue when filling in the number field. If I input more than two digits, the system interprets this as multiple changes (e.g., entering "125" is seen as three separate changes: "1", "12", and "125"). This triggers the auto-save and refresh process repeatedly, lasting around 30 seconds.

As a result, instead of saving "125", it starts saving and refreshing before I finish entering the complete value.

Is there a way to resolve this issue to prevent it from auto-saving prematurely while I'm still entering data?

 

Below is the script I am using for reference. Any guidance or suggestions would be greatly appreciated.

Thank you in advance!

 

Best regards,
Jin

Like 0

Like

0 comments
Show all comments

Hello Community,

 

    I want to display Process Execution custom message on the UI while process in running status. 
    
    How can I display this message using a popup, similar to the one shown in the image below?

 

Like 0

Like

1 comments
Best reply

If you want to display toast messages from a process, you'll need to (1) have a script task in the process that sends the message to the UI and (2) code on the front end that receives the message and displays the toast message. 

For sending the messasge from the process to the UI, see https://customerfx.com/article/sending-a-message-from-server-side-c-to-client-side-javascript-in-bpmonline/

For the toast you can see that here https://customerfx.com/article/displaying-toast-message-popups-from-creatio-freedom-ui-pages/

Ryan

If you want to display toast messages from a process, you'll need to (1) have a script task in the process that sends the message to the UI and (2) code on the front end that receives the message and displays the toast message. 

For sending the messasge from the process to the UI, see https://customerfx.com/article/sending-a-message-from-server-side-c-to-client-side-javascript-in-bpmonline/

For the toast you can see that here https://customerfx.com/article/displaying-toast-message-popups-from-creatio-freedom-ui-pages/

Ryan

Show all comments

Hello Creatio Community,

 

I am currently following Responding to an Change Event When a Field is Changed on a Creatio Freedom UI Page to auto-save the record when a number field is modified.

 

While the auto-save feature works, I’ve encountered an issue when filling in the number field. If I input more than two digits, the system interprets this as multiple changes (e.g., entering "125" is seen as three separate changes: "1", "12", and "125"). This triggers the auto-save and refresh process repeatedly, lasting around 30 seconds.

 

As a result, instead of saving "125", it starts saving and refreshing before I finish entering the complete value.

 

Is there a way to resolve this issue to prevent it from auto-saving prematurely while I'm still entering data?

 

Below is the script I am using for reference. Any guidance or suggestions would be greatly appreciated.

 

Thank you in advance!

 

Best regards,
Jin

Like 1

Like

1 comments

The best option in this case is to make a saving after losing focus from the input. To implement it, you may use the blurred event on the input and add a custom handler, in which you can save the card.

Best regards,

Anhelina!

Show all comments

Hello Community,

 

                  I’ve built a custom page in Freedom UI to display my data in both List View and Calendar View. I implemented the logic in `SCHEMA_HANDLERS` and used `crt.LoadDataRequest` to toggle between the views. The logic works fine when switching to Calendar View for the first time.

 

                              

                              

Issue: 
1] When switching from Calendar View to List View and then back to Calendar View, the data disappears.

I have to refresh the page to make the data reappear in the Calendar.

 

Regards,

Ajay Kuthe

 

 

Like 0

Like

3 comments

Hello,

 

Please describe in detail how exactly this was implemented and provide screenshots of this button's settings.

Mira Dmitruk,

 

I used the 'Refresh data' action to trigger the 'crt.LoadDataRequest' and control the visibility of elements to switch between views (Calender and List).

Button Config

#Code Logic in Handler

handlers: /**SCHEMA_HANDLERS*/[{
    request: "crt.LoadDataRequest",
    handler: async (request, next) => {

 

// Check if the data source name is "ListOrCalenderView"
if (request.dataSourceName === "ListOrCalenderView") {

   // Retrieve the current view mode (Calendar or List)
   const IsCalenderView = await request.$context.IsCalenderView;

   // If the current view is not Calendar (i.e., it's List View)
   if (IsCalenderView === false) {
       // Set the Button caption to "List View"
       request.$context.ListOrCalenderView_caption = "List View";
       request.$context.IsCalenderView = true;
 // Set the ListView flag to false since we are now in Calendar view
       request.$context.IsListView = false;

   } else {
  // If the current view is Calendar, switch to List View
  request.$context.ListOrCalenderView_caption = "Calender View";   request.$context.IsCalenderView = false;
  request.$context.IsListView = true;

 }

}

 

Regards,

Ajay K
 

Mira Dmitruk,

Do you have any alternative solutions besides switching between List and Calendar views?

Show all comments