Dear colleagues,

 

Any idea how to apply bussiness rules to an editable detail grid schema? just by code?

 

Is very usefull can edit in the grid, but just when have no rules, no read only fields, no filters, no calculated fields and so on.

 

Any ideas?

 

Thanks

 

Regrads

Julio

Like 0

Like

1 comments
Best reply

If i'm not wrong i guess you mean to say you have a inline editable detail without any form page for the user to add details and you want to add some kind of business rules.
You can add them in the object level.


But if you have a form page for the detail,you can do it through code by using handlers.
https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platfor…
 

If i'm not wrong i guess you mean to say you have a inline editable detail without any form page for the user to add details and you want to add some kind of business rules.
You can add them in the object level.


But if you have a form page for the detail,you can do it through code by using handlers.
https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platfor…
 

Show all comments

Hi Community,

Can you provide a code example for the following scenario:

When a record to a detail is added, make a field in the Parent Page visible.

Example

When a record is created in Detail 'Opportunity Team' make the Description field (of Opportunity_Form_Page) visible

Regards

Sasor

Like 0

Like

2 comments
Best reply

Hey,
So you can  fetch the count of records under the detail object through code.If the count is greater than 0 then you can make it visibile.
EG below:

for the visibilty logic refer - https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platfor…


 

Hi Community,

Any update regarding scenario?

Sasori

Hey,
So you can  fetch the count of records under the detail object through code.If the count is greater than 0 then you can make it visibile.
EG below:

for the visibilty logic refer - https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platfor…


 

Show all comments

Hi Community,

Can you provide a code snippet of how we can capture the delete event generated from an Editable List, from the parent Page?

Example:

 

We want to catch in the Opportunities_FormPage -> the deletion of a record in Opportunity Team Detail.

Regards,

Sasor

Like 0

Like

3 comments

Hi Community,

Any update regarding this scenario?

Sasori

Sasori,

You can fetch the event of deletion in a business process. Then you can do actions and if your object opportunity has live update set then the updates will appear as soon the business process has run.

 

Other option would be to add your own action in the list and handle all necessary changes in the page.

 

Franck

Hello!

There is a crt.DeleteRecordsRequest, you can add a custom handler for this request (handlers in schema metadata).

This request is called when the user tries to delete records from the row menu and bulk actions menu.
But it is called before user confirmation (modal window), and rights checking.

There are such properties in the payload: 

dataSourceName - data source name of list, for which request is called;
filters - filters for records deletion(passed when records deleted by bulk actions panel)

recordIds - record ids which should be deleted (passed when record deleted by clicking row menu delete button)

Example:


handlers: /**SCHEMA_HANDLERS*/[{
            request: "crt.DeleteRecordsRequest",
            handler: async (request, next) => {
                const dataSourceName = request.dataSourceName;
                const filters = request.filters;
                const recordIds = request.recordIds ;


                console.log(dataSourceName, filters, recordIds );
                return next?.handle(request);
            }
}]/**SCHEMA_HANDLERS*/,

Show all comments

is there a way to rename the "Save"  button on a record page ?

regards, 

Like 1

Like

4 comments
Best reply

I assume you're referring to the caption? You can change the caption for the button by opening the edit page schema (for example, AccountPageV2) and find the localizable string (on the left side) "SaveButtonCaption" then give it a new value.

Ryan

I assume you're referring to the caption? You can change the caption for the button by opening the edit page schema (for example, AccountPageV2) and find the localizable string (on the left side) "SaveButtonCaption" then give it a new value.

Ryan

Ryan Farley,

Thanks Ryan, that worked when creating a new record. When I click New to add a new record the save button became Submit, but when editing the existing record the button appeared to be "Save" again. How to make it Submit on adding and editing a record.

Thanks in advance

You also need to change the "SaveRecordButtonCaption" string in the associated section (such as AccountSectionV2)

Ryan Farley,

Worked ! Many thanks Ryan. 

Show all comments

Hi

 

Somebody tried to enable Playbook areticles in a Freedom UI DCM's?

 

I tried, but they didn't appears

 

Some trick?

 

Thanks

Julio Falcón

Like 0

Like

2 comments
Best reply

Ryan Farley,

Thanks Ryan, I saw that it is a new component, I was looking for it in the DCM, as in Classic UI. :-)

Show all comments

Hi

 

Somebody know how determine, when working with a record in a Freedom UI page if it corresponds to a new record (new/copy)?

 

Thanks in advance

 

Regards

 

Julio Falcón

Like 0

Like

7 comments

Hello Julio,

const cardState = await request.$context.CardState;
if (cardState == "add" || cardState == "copy") {
     // do something here
}

Ryan

Ryan Farley,

Thanks Ryan, where did you find/get this kind of information?

Ryan Farley,

Ryan,

 

In which kind of handler request I must introduce the code? I tried in crt.OpenPageRequest, but nothing happens. The code I'm using:

 

handlers: /**SCHEMA_HANDLERS*/[ // NdosEntity_4ad7b54DS.NdosPeriodicidadMP
	{ 
		request: "crt.OpenPageRequest",
		handler: async (request, next) => {
			const okBtn = {
				key: "OK",
				config: {
					color: "accent",
					caption: "OK"
				}
			};
 
			const cancelBtn = {
				key: "CANCEL",
				config: {
					color: "primary",
					caption: "Salir"
				}
			};
 
			// Nuevo o Copia
			const cardState = await request.$context.CardState;
 
			// Mensaje...
			const result = await request.$context.executeRequest({
				type: "crt.ShowDialogRequest",
				$context: request.$context,
				dialogConfig: {
					data: {
						message: ( cardState == "add" || cardState == "copy" ) ? "New: Este es un nuevo registro" : "Existing one: Este registro ya existe" ,
						actions: [ okBtn, cancelBtn ]
					}
				}
			});
 
			if (result === "OK") {
				// Clica en OK
 
			}
 
			/* Siguiente handler, retorna resultado */
			return next?.handle( request );
 
		},	
	},
]

Julio.Falcon_Nodos,

You would add this in the page you’re opening, not in the code that opens the page. What is the intent you’re trying to produce? I assume that in a page you’re wanting to know if the page is in add mode vs edit. Correct? To accomplish this you’d add something such as a crt.HandleViewModelResumeRequest on the page and check the cardstate there. 

Thanks Ryan, I'm also try using crt.HandleViewModelResumeRequest, but nothnig happens.

 

What I need is that when I open the page "Air Equipment/NdosPage_3ud8c3e" it can detect if I am working with a new record and do something. So it is in the code of this page, where I enter the commented code, compile, open an existing record and create a new one and the code entered does not execute/does not work in any situation.

 

If I add the code inside a crt.HandleViewModelAttributeChangeRequest, it works, but it stays 

in loop and to exit I have to go back in the browser.

 

I made a short video to show what I'm doing and where the code is in case it helps to understand, see at

https://share.vidyard.com/watch/NRBjhx3hjzCi9sZ2x5qsSK?

 

In Classic UI I've the onEntityInitialized method to execute when open the page, but in Freedom is very different

 

Thanks again

Julñio

Julio.Falcon_Nodos,

Hello Julio,

Does it also not enter the handler if you try adding a "crt.HandleViewModelInitRequest"?

Ryan Farley,

No Ryan, I didn't understand what's wrong with my code :-(, 

 

Show all comments

Dear collegaues

 

In Classic UI, I need to add a Filter business rule to can get only contacts with Email is completed. Some ideas how to solve this?

 

I tried not equal "", not contains "@" and others and didn't works

 

Thanks in advance

 

Regards

Julio

Like 0

Like

2 comments
Best reply


Hello,
 

Unfortunately, it's not possible to add such a filter using basic filters. However, you can write a custom filter in the schema code.

For example, for the Owner field on the AccountPageV2 schema, this filter may look like this:


define("AccountPageV2", [], function() {
   return {
       "entitySchemaName": "Account",
       "attributes": {
           "Owner": {
               "dataValueType": Terrasoft.DataValueType.LOOKUP,
               "lookupListConfig": {
                   "filters": [
                       function() {
                           var filterGroup = Ext.create("Terrasoft.FilterGroup");

                           filterGroup.add("HasEmail",
                               Terrasoft.createColumnFilterWithParameter(
                                   Terrasoft.ComparisonType.NOT_EQUAL,
                                   "Email",
                                   ""));
                           return filterGroup;
                       }
                   ]
               }
           }
       }
   };
});

This filter ensures that only contacts with the Email field not equal to empty string will be included in the selection for the Owner field.
 

You can learn more about such filtering in our academy: Link

Thank you for reaching out!


Hello,
 

Unfortunately, it's not possible to add such a filter using basic filters. However, you can write a custom filter in the schema code.

For example, for the Owner field on the AccountPageV2 schema, this filter may look like this:


define("AccountPageV2", [], function() {
   return {
       "entitySchemaName": "Account",
       "attributes": {
           "Owner": {
               "dataValueType": Terrasoft.DataValueType.LOOKUP,
               "lookupListConfig": {
                   "filters": [
                       function() {
                           var filterGroup = Ext.create("Terrasoft.FilterGroup");

                           filterGroup.add("HasEmail",
                               Terrasoft.createColumnFilterWithParameter(
                                   Terrasoft.ComparisonType.NOT_EQUAL,
                                   "Email",
                                   ""));
                           return filterGroup;
                       }
                   ]
               }
           }
       }
   };
});

This filter ensures that only contacts with the Email field not equal to empty string will be included in the selection for the Owner field.
 

You can learn more about such filtering in our academy: Link

Thank you for reaching out!

Thanks Pavlo

Show all comments

Hi, 

 

Please help, I need to notify final user some task he trigger is working.

 

For example, on a page, a user clicks on a button to do something, the button executes a process and I want to inform the client that it is processing what the process does.... 

 

Some ideas?

 

Thanks in advance

 

Kind regards

Julio

Like 0

Like

3 comments
Best reply

I do this often and it works great. You'd need to:

  1. Send a message from the process to the front end. See https://customerfx.com/article/how-to-refresh-a-page-from-a-process-in-…
  2. Have some code somewhere that listens for the message. See https://customerfx.com/article/receiving-server-side-messages-in-a-crea…
  3. Then display the toast message. See https://customerfx.com/article/displaying-toast-message-popups-from-cre…

 

I've typically done this by making a generic process I can use as a subprocess. It sends the message to the client. Then I make a generic script loaded from MainShell or MainHeaderSchema that listens for the message and displays the toast. It makes it simple and generic to use and works on any page.

 

Ryan

I do this often and it works great. You'd need to:

  1. Send a message from the process to the front end. See https://customerfx.com/article/how-to-refresh-a-page-from-a-process-in-…
  2. Have some code somewhere that listens for the message. See https://customerfx.com/article/receiving-server-side-messages-in-a-crea…
  3. Then display the toast message. See https://customerfx.com/article/displaying-toast-message-popups-from-cre…

 

I've typically done this by making a generic process I can use as a subprocess. It sends the message to the client. Then I make a generic script loaded from MainShell or MainHeaderSchema that listens for the message and displays the toast. It makes it simple and generic to use and works on any page.

 

Ryan

Ryan Farley,

 

How do you go about creating a generic script that loads in the MainShell or MainHeaderSchema in Freedom UI? It hasn't seemed to work when I've tried it.

Harvey Adcock,

You need to add a feature to enable creating replacing schemas for angular modules such as MainShell. See this thread: https://community.creatio.com/questions/how-create-replacing-schema-freedom-ui-basepagetemplate

Ryan

Show all comments

Dear colleagues,

 

I need to trigger a process to search for all pending approvals in a Freedom UI section, but I have not found a Visa object connected to Freedom pages. How can I approve all pending approvals connected to a specific object in a FreedomUI section via a process?

Like 0

Like

1 comments

Found, it is a single object for all entities: Approval, in the column "Reference schema name" must indicate the name of the object of the section where the Approval belongs and in the column "Entity identifier" the id of the object....

Show all comments

Hi 

 

Somebody know where can we change the message and graphics Creatio displays in a list page (Freedom & Classic pages) where no data? and the same in Next Steps?

 

Thanks

Julio

Like 1

Like

5 comments
Best reply

Julio.Falcon_Nodos,

I like to get rid of the graphic and also the "Nothing to show here!" text so I use the following: 

#next-steps-no-data-animation, 
.next-steps-no-data-main-label {
    display: none;
}

This changes it from this: 

To this: 

Ryan

I'd prefer not to have the graphics in these areas. I've been removing them with CSS, I believe that is the only option.

Ryan

Ryan Farley,

Thanks Ryan, which CSS need to modify to list pages and Next steps?

Julio.Falcon_Nodos,

I like to get rid of the graphic and also the "Nothing to show here!" text so I use the following: 

#next-steps-no-data-animation, 
.next-steps-no-data-main-label {
    display: none;
}

This changes it from this: 

To this: 

Ryan

Thanks!, I owe you a beer in Miami! :-)

Ryan Farley,

Dear Ryan, and to ListPages, when there no data? regarding Freedom pages?

Show all comments