I often use backend validation in Creatio - I prevent saving a record and throw an exception from an event listener. It works like a charm, but as a result, the end user sees only a toast message, which is small and disappears after a moment, so it's easy to overlook. Is it possible to intercept such an error and display a normal confirmation popup, instead of thisone?
It would be great if there is a generic solution, which doesn't require me to change all of my validations.
As an alternative you can use websockets to implement your logic.
Here i created a custom section and a clientMessageBridge as described in this article. In this section i created a Test Field. To subscribe to message broadcasting in the HandleViewModelInitRequest handler i used schema attribute to store a function that will be called whenever a message is published. Also note, that you should unsubscribe from websocket connection when your view is destroyed. To do this please don't forget to implement such logic in HandleViewModelDestroyRequest handler.
On the form page when user clicks Save button a custom MyCustomRequest handler is called. In this handler i realized the following logic: call a business process (where i pass Test Field value as well as expected business process parameter value) -> if there is no validation error that is passed back from business process (hasValidationErrors property) i call SaveRecordRequest request -> if there is an error - the SaveRecordRequest is not performed.
Also the function that is triggered when a websocket message is broadcasted does open a pop-up which displays error message.
Here is an example:
And the outcome:
Hope this helps and let me know if you have any question left.
Is there a similar way to the following article to add a lookup to a Popup page? I want when the stage of a lead changes to add a popup where I have to select the disqualification reason.
Hello, Unfortunately, there is no other way except for development.
As a workaround, you can create a business rule that will display the field you need and make it required, and then users will not be able to save the record until they fill in that field.
Such a business rule will look like this:
You can read more about creating business rules in the following article:
However, we understand that this is not ideal for your specific needs.
We want to assure you that we have created a request for our development team to implement this functionality in future versions of our application. We understand the importance of providing our clients with the best possible experience and will work hard to implement the changes you have suggested.
Thank you again for bringing this to our attention, and please do not hesitate to reach out if you have any further questions or concerns.
Hello, Unfortunately, there is no other way except for development.
As a workaround, you can create a business rule that will display the field you need and make it required, and then users will not be able to save the record until they fill in that field.
Such a business rule will look like this:
You can read more about creating business rules in the following article:
However, we understand that this is not ideal for your specific needs.
We want to assure you that we have created a request for our development team to implement this functionality in future versions of our application. We understand the importance of providing our clients with the best possible experience and will work hard to implement the changes you have suggested.
Thank you again for bringing this to our attention, and please do not hesitate to reach out if you have any further questions or concerns.
I'm trying to create a popup to display to users after they start a new session (log in). What is the simplest way to do this?
There is a new business process called "User sessions" in the CRT Base package. Is this something I could use for the purpose of displaying a popup after a new user session is created?
I was able to create a custom user task that displays a popup and call it with a business process with a simple start but cannot figure out a way for it to be triggered to display to a user when they start a new session.
Sessions are created directly in the database by Insert and do not generate an event on the object. Business processes rely on events at the object. If it is not the happening process will not notice any changes. As for now, there is no option to track start/end of the user session via the process signals. Our R&D team responsible for this functionality is already working on implementing it in the future releases. I will forward your feedback to the team in order to increase the importance of this task.
I have a process that needs to check the value of a field. If the value is correct, another field will be unlocked, if it is not, a popup will appear.
The problem is that sometimes the pop-up appears before the page gets refreshed. I have the "Refresh active page" add-on inserted in the process that updates that field.
I think sometimes the pop-up is quicker than the refresh. The pop-up has been implemented by code.
As a suggestion you can add a timer after the "Refresh active page" element, and set it to two seconds for example.
This way you could ensure that the element is completly executed in the background and only then the pop-up is displayed.
This add-on was developed by a third party, so if you would like to receive assistance regarding how does it work in detail, please contact info@solutionsmetrix.com . Unfortunately we can not ensure how will behave the business process with third party custom developments.
As a suggestion you can add a timer after the "Refresh active page" element, and set it to two seconds for example.
This way you could ensure that the element is completly executed in the background and only then the pop-up is displayed.
This add-on was developed by a third party, so if you would like to receive assistance regarding how does it work in detail, please contact info@solutionsmetrix.com . Unfortunately we can not ensure how will behave the business process with third party custom developments.
This happens in the Application Section. When i fill in the product terms and try to save the Application this pop up is shown. Meanwhile the object SysFinApplicationSpecRight doesnt exist at all in the database. How can I fix this problem ?
I have the popup add-on installed from marketplace. I've used it in the past often, but it stopped working in our current instance about a week ago. I don't have popup blocker on the browser.
I had tried uninstalling and reinstalling previously but this wiped all the business processes that had it in place. I cannot rebuild it all again- is there any way to troubleshoot this?
You should identify the cause of the issue first and foremost.
Check the process log and make sure the process was launched and “To whom should the window be shown” field was filled out correctly.
If everything is correct, troubleshoot the issue in the incognito mode.
If you cannot reproduce the issue in the incognito mode, check your browser extensions. Some of them, ad blockers in particular, could block pop-up windows in Creatio.
I need to skip the mini-page which comes when we click "complete" on any user task in a DCM.As soon as the complete button is clicked the user task should be marked complete. Is there any way or examples to do so.
The method that is being called when clicking the complete button in the user-task is "execute" from the "ActivityDashboardItemViewModel" module. It checks if the item that needs to be completed has the mini-page or if it's an email activity or a process activity and then executes its logic. If none of the conditions are met the "execute" method from the "EntityDashboardItemViewModel" is called (parentMethod for the "execute" method in the "ActivityDashboardItemViewModel"). So in case you need to autocomplete the task you need to override the logic of this "execute" method (and unfortunately we don't have a specific example on this matter).
It seems we can not create the replacing schema for EntityDashboardItemViewModel or ActivityDashboardItemViewModel. Is there any suggestion where we can override the 'execute' method to add the custom logic?
Actually there is a possibility to override this logic:
1) Create the module with UsrActivityDashboardItemViewModel name and the following code (copied the original code from the ActivityDashboardItemViewModel):
define("UsrActivityDashboardItemViewModel", ["UsrActivityDashboardItemViewModelResources", "ProcessModuleUtilities",
"ConfigurationConstants", "EntityDashboardItemViewModel", "MiniPageUtilities"],
function(resources, ProcessModuleUtilities, ConfigurationConstants){
Ext.define("Terrasoft.configuration.UsrActivityDashboardItemViewModel", {
extend:"Terrasoft.EntityDashboardItemViewModel",
alternateClassName:"Terrasoft.UsrActivityDashboardItemViewModel",
Ext: null,
sandbox: null,
Terrasoft: null,
columns:{/**
* Process element identifier.
*/"ProcessElementId":{
type: Terrasoft.ViewModelColumnType.ENTITY_COLUMN,
dataValueType: Terrasoft.DataValueType.STRING},
/**
* Indicates if button "Execute" was clicked.
*/"ExecuteButtonClick":{
type: Terrasoft.ViewModelColumnType.ENTITY_COLUMN,
dataValueType: Terrasoft.DataValueType.BOOLEAN}},
/**
* @inheritdoc Terrasoft.BaseDashboardItemViewModel#initIconSrc
* @overridden
*/
initIconSrc: function(){
var iconSrc = resources.localizableImages.IconImage;this.set("IconSrc", iconSrc);},
/**
* @inheritdoc Terrasoft.EntityDashboardItemViewModel#addQueryColumns
* @overridden
*/
addQueryColumns: function(esq){this.callParent(arguments);
esq.addColumn("Title", "Caption");
esq.addColumn("Type");
esq.addColumn("StartDate", "Date");
esq.addColumn("Owner.Name", "Owner");
esq.addColumn("ProcessElementId");},
/**
* @inheritdoc Terrasoft.BaseDashboardItemViewModel#getProcessElementUId
* @overridden
*/
getProcessElementUId: function(){returnthis.get("ProcessElementId");},
/**
* @inheritdoc Terrasoft.BaseDashboardItemViewModel#execute
* @overridden
*/
execute: function(options){
console.log("test");
var schemaName =this.get("EntitySchemaName");
var hasMiniPage;const parentMethodArguments = arguments;const parentMethod =this.getParentMethod();
Terrasoft.chain(
function(next){this.showBodyMask();if(Terrasoft.Features.getIsEnabled("OpenEditPageInDcm")){this.hasMiniPageForMode(schemaName, Terrasoft.ConfigurationEnums.CardOperation.VIEW, next, this);return;}
hasMiniPage =this.hasMiniPage(schemaName);
next(hasMiniPage);},
function(next, hasMiniPage){this.hideBodyMask();if(!this._isEmailActivity()&&this.isActivity()&& hasMiniPage){this.showMiniPage(options);return;}
var elementUId =this.get("ProcessElementId");
var recordId =this.get("Id");
var config ={
procElUId: elementUId,
recordId: recordId,
scope:this,
parentMethodArguments: parentMethodArguments,
parentMethod: parentMethod
};if(ProcessModuleUtilities.tryShowProcessCard.call(this, config)){return;}
parentMethod.call(this, parentMethodArguments);},
this);},
/**
* Returns true if it is task activity entity.
* @private
* @return {Boolean} True if it is task activity entity.
*/
isActivity: function(){
var executionData =this.get("ExecutionData");
var schemaName =this.get("EntitySchemaName");returnthis.Ext.isEmpty(executionData)||(executionData && schemaName === executionData.entitySchemaName);},
////TODO #CRM-33987/**
* Returns if current activity is email.
* @returns {Boolean} Returns if current activity is email.
*/
_isEmailActivity: function(){
var activityTypes = ConfigurationConstants.Activity.Type;
var typeLookup =this.get("Type");return typeLookup.value=== activityTypes.Email;},
/**
* @inheritdoc Terrasoft.BaseDashboardItemViewModel#onExecuteButtonClick
* @overridden
*/
onExecuteButtonClick: function(){this.set("ExecuteButtonClick", true);this.callParent(arguments);},
/**
* @inheritdoc Terrasoft.BaseDashboardItemViewModel#onCaptionClick
* @overridden
*/
onCaptionClick: function(){this.set("ExecuteButtonClick", false);this.callParent(arguments);},
/**
* @inheritdoc Terrasoft.MiniPageUtilities#openMiniPage
* @overridden
*/
openMiniPage: function(config){if(this.get("ExecuteButtonClick")){
var status ={
name:"ActivityMiniPageStatus",
value:"Done"};if(config &&this.Ext.isArray(config.valuePairs)){
config.valuePairs.push(status);}else{
config.valuePairs=[status];}}this.callParent(arguments);}});});
the only modification was console.log("test") to check the override.
2) Create a replacing view module for the SectionActionsDashboard with the following code:
I tried in a different instance, the error didn't come. But when I click on "Complete", it refers to the ActivityDashboardItemViewModel in stead of SKSActivityDashboardItemViewModel.
Also, I can see initDashboardConfig referencing to the correct schema, but still execute method is not,