I have a Section with a detail. If a field of a particular record in the detail is modified , the record name should be added as a field value in the section.
I have written a refresh script task and have the update script. But it seems to be not working. On hard reload the update happens.
This is my scrip task code:
UserConnection userConnection = Get("UserConnection");
Guid jobflowId = Get("JobFlowID");
string senderName = "UpdateSelectedCandidate";
string message = JsonConvert.SerializeObject(new {
RecordId = jobflowId
});
MsgChannelUtilities.PostMessage(userConnection, senderName, message);
return true;
This is my edit page code for refresh :
onEntityInitialized: function() {
// onEntityInitialized method parent realization is called.
this.callParent(arguments);
this.Terrasoft.ServerChannel.on(Terrasoft.EventName.ON_MESSAGE, this.onMessageReceived, this);
},
destroy: function() {
this.Terrasoft.ServerChannel.un(Terrasoft.EventName.ON_MESSAGE, this.onMessageReceived, this);
this.callParent(arguments);
},
onMessageReceived: function(sender, message) {
if (message && message.Header && message.Body) {
var result = this.Ext.decode(message.Body);
//window.alert(message.Header.Sender);
//window.alert(message.Body);
if (message.Header.Sender === "UpdateSelectedCandidate" && this.get("Id") === result.RecordId) {
this.updateSectionCard({sectioncard: "UsrJobFlow1Page"});
}
}
}
I am aware that if a detail has to be refreshed the method name is this.updateDetail({detail: "Name of the detail"}).
But if the entire edit page has to be refreshed i do not know the method name.
Kindly help me resolve the same asap
Thanks & Regards,
Saranya
Like
Dear Saranya,
You can easily use this marketplace application that allows refreshing either detail's and section's lists https://marketplace.bpmonline.com/app/refresh-data-button-bpmonline.
Best regards,
Oscar
Oscar Dylan
Dear Oscar,
We don't want any market place app to be installed. we are looking for a solution to be resolved through code.
Kindly help us resolve the same
Thanks & Regards,
Saranya
Sri Saranya,
Dear Saranya,
Since the logic is executed on the back-end, the page has to be reload for changes to display. However, there is an option to reload data on the page automatically by adding a method 'this.reloadEntity();' to your custom code. As a result the page will be reloaded automatically by the system and changes will appear.
Also here is a community post regarding same question https://community.bpmonline.com/node/26495.
Regards,
Oscar
Oscar Dylan,
Hi Oscar, I am using the command this.reloadEntity() on a page and wanted to check if there is a way to force cache cleaning. Thanks.