Hello,
I'm trying to add a button to contact page details (Contacts_FormPage), I'm currently using Creatio on cloud version 8.1.3.6734 with Freedom UI
I followed these steps:
- Navigated to Settings > Advanced Settings
- Created a new package, and added ProductCore dependency
- Created a Replacing view model with the code name ContactPageV2
- Added the code:
-
define("ContactPageV2", [], function() { console.log("ContactPageV2 module loaded"); return { methods: { onGenerateLinkClick: function() { console.log("Generate Link button clicked"); } }, diff: [ { "operation": "insert", "name": "GenerateLinkButton", "parentName": "ActionButtonsContainer", "propertyName": "items", "values": { "itemType": Terrasoft.ViewItemType.BUTTON, "caption": "Generate Link", "click": {"bindTo": "onGenerateLinkClick"} } } ] }; });
- After saving, I compiled the package
- Emptied the cache of the browser, but nothing is showing not even the console log "ContactPageV2 module loaded"
Please help as I'm not sure what I'm doing wrong or what steps am I missing (I'm a newbie to this platform).
Thank you in advance.
Like
Creatio has two types of pages, Freedom UI pages and classic pages. They are completely separate/different pages. The ContactPageV2 is the classic page, not the Freedom UI page which is Contacts_FormPage.
To add the button that executes your code on the Freedom UI page:
- Go to the contact page, click the small gear on the top right corner of the page to edit
- Save it to make a copy in your package (see the Side Note at end of article here to force the save to go into your package, if needed)
- Add a button to the page where you want it
- Open the code for the page (clicking one of the icons at the top right of the page designer)
- Add the request handler for the button (the code that will execute when clicked) following steps here: https://customerfx.com/article/adding-a-button-to-execute-custom-code-o…
Ryan
Creatio has two types of pages, Freedom UI pages and classic pages. They are completely separate/different pages. The ContactPageV2 is the classic page, not the Freedom UI page which is Contacts_FormPage.
To add the button that executes your code on the Freedom UI page:
- Go to the contact page, click the small gear on the top right corner of the page to edit
- Save it to make a copy in your package (see the Side Note at end of article here to force the save to go into your package, if needed)
- Add a button to the page where you want it
- Open the code for the page (clicking one of the icons at the top right of the page designer)
- Add the request handler for the button (the code that will execute when clicked) following steps here: https://customerfx.com/article/adding-a-button-to-execute-custom-code-o…
Ryan
Thank you!
I was able to add it following your explanation.
And yes I need to add it to my custom package since I'm trying to create a connector that can be used by anyone later on.
That was very insightful, thanks again!