After adding records ,How can I reload a detail list in a Freedom UI page from a task script within a business process, without using the live update feature in the object?
Thank you

Like 0

Like

3 comments

Note that i'add this code in the task script in the process 


var userConnection = Get<UserConnection>("UserConnection");
string messageText = "Successful";

Terrasoft.Configuration.MsgChannelUtilities.PostMessageToAll("ReloadDetail", messageText);
return true;    

i got this error message 
"The type or namespace name 'MsgChannelUtilities' does not exist in the namespace 'Terrasoft.Configuration' (are you missing an assembly reference?"

 

 

"The type or namespace name 'MsgChannelUtilities' does not exist in the namespace 'Terrasoft.Configuration' (are you missing an assembly reference?" - this error message will occur in case the business process is created in the assembly package. The only workaround is to uncheck the "Assembly package" property in the package settings or move the process to the regular package.

 

As for the possibilities and if LiveUpdate is not an option - yes, socket nessage to the client-side and triggering the LoadDataRequest with reload enabled is the only option.

I also encountered this same error, but in my case, it was due to a dependency issue. I resolved it by adding the 'crtBase' package as a dependency in the package containing the business process.

Show all comments

Hello Community,
Here is the scenario Im truing to solve.

We Have Opportunity (parent page) in freedomUI and Contact In Opportunity in Classic UI.

We want to capture the following event. When we click Close in 'Contact in opportunity', we want to capture this event, in the Opportunity Form Page. 

The scope behind this is to perform a list reload of the Contacts(have already tried Enable live update in the entities-doesnt work)

How can this be achieved?

Sasor

Like 0

Like

9 comments

++++

Hello,
 

You can implement the following code to reload the data source when you get to the Freedom UI page on the crt.HandleViewModelInitRequest.
 

Sample implementation for “Opportunities_FormPage”

define("Opportunities_FormPage", /**SCHEMA_DEPS*/["@creatio-devkit/common"]/**SCHEMA_DEPS*/, function/**SCHEMA_ARGS*/(sdk)/**SCHEMA_ARGS*/ {
...
        handlers: /**SCHEMA_HANDLERS*/[
              {
        // Load data grids
      request: 'crt.HandleViewModelInitRequest',
      handler: async (request, next) => {
          console.log("You returned to FreedomUI page");
            const result = await next?.handle(request);
            const handlerChain = sdk.HandlerChainService.instance;
            await handlerChain.process({
                type: 'crt.LoadDataRequest',
                $context: request.$context,
                config: {
                    loadType: "reload"
                },
                dataSourceName: "ContactRolesListDS"
            });
            return result;
      }
  }

Serhii Parfentiev,

Hello Serhii,

Have you actually tried it ? HandleViewModelInitRequest is not even triggered when you close the classic ui page (nothing in the console log)

Sasor

++++

++++

++++

++++

+++++++

Hi Community,

Is there any idea about this topic?

Sasor

Show all comments

Hello Community,

I have developed a logic that when number of records in a detail is greater than 3 the plus sign dissappears

However my problem is that I have to refresh the whole page in order for the plus sign to dissappear. I have tried

this.reloadEntity() or this.UpdateDetail() method but without success.

Any idea how to overcome this problem

Best regards

Sasori

 

Like 0

Like

2 comments
Best reply

In the detail schema do the following:

 

1) Add attribute

attributes: {
	"IsAddVisible": {
		dataValueType: Terrasoft.DataValueType.BOOLEAN
	}
}

2) Add attribute to visible property of add button, add the following to the diff of the detail schema: 

diff: [
	{
		"operation": "merge",
		"name": "AddRecordButton",
		"values": {
			"visible": {"bindTo": "IsAddVisible"}
		}
	}
]

3) Add the following to methods: 

methods: {
	onGridDataLoaded: function() {
		this.callParent(arguments);
		this.setAddVisible();
	},
 
	subscribeGridEvents: function() {
		this.callParent(arguments);
		this.setAddVisible();
	},
 
	setAddVisible: function() {
		var items = this.getGridData().getItems();
		this.set("IsAddVisible", items.length &lt; 3);
	}
}

End result, the add button should only be visible when the detail has less than 3 items.

Ryan

In the detail schema do the following:

 

1) Add attribute

attributes: {
	"IsAddVisible": {
		dataValueType: Terrasoft.DataValueType.BOOLEAN
	}
}

2) Add attribute to visible property of add button, add the following to the diff of the detail schema: 

diff: [
	{
		"operation": "merge",
		"name": "AddRecordButton",
		"values": {
			"visible": {"bindTo": "IsAddVisible"}
		}
	}
]

3) Add the following to methods: 

methods: {
	onGridDataLoaded: function() {
		this.callParent(arguments);
		this.setAddVisible();
	},
 
	subscribeGridEvents: function() {
		this.callParent(arguments);
		this.setAddVisible();
	},
 
	setAddVisible: function() {
		var items = this.getGridData().getItems();
		this.set("IsAddVisible", items.length &lt; 3);
	}
}

End result, the add button should only be visible when the detail has less than 3 items.

Ryan

Thanks a lot Ryan. I was using ESQ before, but this is definitely faster and better.

Show all comments

Hello Creatio Community,

I have made the Activity participant detail (Activites section) as an editable list.

When I add a new record and click on the added row ( the active row doesnt behave normally) as editable lists in other sections. I think is probably sort of bug of the system, because i have tried in fresh installations and the same thing happens.

 

I overcome this by refreshing the page so that the added row behaves normaly.

I manage to refresh the page by sending a message from a business process to the Front-End and subscribe to the message. But i refresh the whole Activity (entity), i want to refresh only the Participant detail.

This snippet is implemented in ActivityPageV2

			init: function() {
				this.callParent(arguments);
				// register our onProcessMessageReceived function to get messages from the server
				Terrasoft.ServerChannel.on(Terrasoft.EventName.ON_MESSAGE, this.onProcessMessageReceived, this);
			},
			onProcessMessageReceived: function(scope, message) {
				debugger;
				var sender = message && message.Header.Sender;
					if (sender === "RefreshDetailActivityParticipantFromBP") { //"SMRefreshPaged"
					this.reloadEntity();
				}
			}

How can i manage to refresh only the Participant detail list?

I have tried also this.reloadGridData() and this.updateDetail({reloadAll: true}); without success.

Like 0

Like

3 comments

this.reloadGridData()  is not defined in the ActivityPageV2. (console)

I think that the proper solution involves using the this.reloadGridData()  method ? Should i just add the :

mixins: {
			GridUtilities: "Terrasoft.GridUtilities"
		}

in the ActivityPageV2 ?

Any updates on this Creatio team ?

Sasori Oshigaki,

this.updateDetail({ detail: "NameOfDetail" });

You can find the "NameOfDetail" value to use by looking at the details section of the page code for your detail (it's not the name of the detail schema, but the name or Id it gave it when it added it to the page). The reloadGridData function only works from within the detail schema code itself. 

 

Show all comments

Hi

i want to reload the detail record after i chose the "Processed" case.

i have found this.reloadDetails() but it's use for the function from editpage

Can anyone help me out with this issue ?

Like 0

Like

1 comments

Thank you for your question!

 

Please be advised that you may feel free to use the "this.reloadEntity();" method for your case.



In addition, you may use a Marketplace solution for refreshing detail`s or section`s lists: https://marketplace.creatio.com/app/refresh-data-button-creatio



Or, you may find more information on your case by these community threads below:

1. https://community.creatio.com/questions/how-refresh-entire-page-without…

2. https://community.creatio.com/questions/default-value-custom-objects

3. https://community.creatio.com/questions/reload-record-page



Thank you!

 

Regards,

 

Danyil

 

Show all comments

Hi all,

       I want to use javascript function to reload data of a detail on the edit page. For example:

  • I open a contact to edit data
  • In the contact editing page, there is activities detail
  • When I run a business process, I want to reload activities detail when that business process finishes (use message to detect)

Thank you.

Like 0

Like

3 comments
Best reply

Dear Toan,

You can use this.updateDetail() method. For example:

 

this.updateDetail({

                        detail: "ContactCommunication"

                    });

 

Regards,

Dean

I think a call to this.reloadDetails() from the edit page should do this.

Dear Toan,

You can use this.updateDetail() method. For example:

 

this.updateDetail({

                        detail: "ContactCommunication"

                    });

 

Regards,

Dean

Dean Parrett,

Thank you Dean. I can call this.updateDetail("ContactCommunication");

Show all comments

Hi Community,

Every after record item changes, I am calling this method this.reloadGridData() to refresh the grid in order the recent changes will be displayed.

Now I want after reloading, I want the last active row to be re-selected again. Any idea how can I possibly do this?

Like 0

Like

3 comments

Start from debugging the reloadGridData method and find how it works. Keep your attention on the "onGridDataLoaded" method. Additionally, please debug and find what happens after selecting a record.

Eugene Podkovka,

 

Hi Eugene, 

 

How to debug the reloadGridData method?

Where to find this method?

Hello, 

 

I'd suggest to check the corresponding replacing view model schema where the logic is implemented.

This article (and connected to it) could be helpful for better understanding. 

Hope it clarifies!

Best regards,

Anastasiia

Show all comments

Hi All,

Please, how do i reload details when records are added automatically. Have suggestion will be highly appreciated.

 

Thank you

File attachments

Like

2 comments

Please someone advise. Thank you!

Dear Adebola,

 

The similar case was solved here - https://community.bpmonline.com/discussion/10973. Feel free to check if the provided solution meet your needs.

Lisa

Show all comments