
The page to add a new record for a section in Creatio can have two different modes. One is to use the full page to create a new record, and another is to use the add mini page to present a simpler add screen in a dialog. The out of the box behavior when adding a record using the Mini page is that the record gets created and the dialog closes. By default, the user doesn’t navigate to the newly created record, which can be confusing for users. However, that is easy to change. Just so we’re clear, an add mini page looks like this (this is the out of the box add mini page for the account area)
Just to point out first that the user can create the record and navigate to the new record by using the arrow icon button at the top right of the add mini page, however, that’s not intuitive for some users. In this article, we’ll be changing the default behavior for all mini pages to automatically navigate to the new record once the mini page is saved. We’ll do this by creating a replacing client view for the BaseMiniPage. Note, if you only want to change this behavior for one particular mini page, you’d just make these changes to that one mini page. For example, if we only want to change this behavior for the Account mini page, you’d make the changes below to the AccountMiniPage only instead of to BaseMiniPage.
We will first need to create a “Replacing view model” and select “BaseMiniPage” as the parent:
Then, add the following code to the new BaseMiniPage:
define("BaseMiniPage", ["NetworkUtilities"], function(NetworkUtilities) { return { methods: { save: function() { this.callParent([function() { NetworkUtilities.openEntityPage(this.getOpenEntityPageConfig()); }, this]); } } }; });
Now, whenever the save button is clicked, it will save the new record and then navigate to the newly created record.
Note, as I mentioned earlier, if you only want this behavior on a single mini page, for example the AccountMiniPage. The best route is to open the Section Wizard from the account section, then go to the mini pages and add the save method from the code above to the methods in the source code for the mini page. Don’t forget you’ll also need to add the NetworkUtilities to the modules list at the top as well.
This is great. Thank you