Add mini card in Contact Lookup "New" Option/Button

Hi Community,

 

In Contact Lookup lets say in Case page, there is a "New" button for user to create a new Contact record. Once "New" button is clicked, instead of opening contact edit page, I wanted to open add mini card. How can I possibly do this?

 

Thanks 

Like 0

Like

4 comments

Hi Fulgen,

 

We are interested in the needOpenMiniPage method from the LookupPageViewModelGenerator. I was able to open the lookup in runtime of the webbrowser by modifying the code of the method in the following way:

 

original code

needOpenMiniPage: function(entitySchemaName) {
			const notUseSilentCreation = !Terrasoft.Features.getIsEnabled("UseSilentCreation");
			const entityStructure = moduleUtils.getEntityStructureByName(entitySchemaName);
			const editPages = entityStructure.pages;
			const hasAddMiniPage = editPages[0].hasAddMiniPage;
			return notUseSilentCreation && this.lookupInfo.isQuickAdd && !Ext.isEmpty(hasAddMiniPage);
		},

runtime code that opened a minipage when clicking on the "New" button in the modal window:

needOpenMiniPage: function(entitySchemaName) {
			this.lookupInfo.isQuickAdd=true; //line added
			const notUseSilentCreation = !Terrasoft.Features.getIsEnabled("UseSilentCreation");
			const entityStructure = moduleUtils.getEntityStructureByName(entitySchemaName);
			const editPages = entityStructure.pages;
			const hasAddMiniPage = editPages[0].hasAddMiniPage;
			return notUseSilentCreation && this.lookupInfo.isQuickAdd && !Ext.isEmpty(hasAddMiniPage);
		},

You need to replace this method in your system and add this.lookupInfo.isQuickAdd=true; before this.callParent(arguments) and it should open the minipage:

Best regards,

Oscar

Oscar Dylan,

Hi, I'm trying to do what you suggested but can't find the 

needOpenMiniPage method in the LookupPageViewModelGenerator.

Am I looking at the right place? (added screenshot)

Thanks!

Chani Karel,

 

Hi,

 

Yes, this is the correct module, please double-check it, the method declaration is located at 1208 row:

Best regards,

Oscar

Oscar Dylan,

Thank you so much, I found it.

I have another question now:

I used this atricle https://customerfx.com/article/overriding-modules-in-creatio-formerly-b… to add the override function and it didn't work.

Is there another way to edit the method?

Was I doing the right thing?

 

Thanks,

Chani

Show all comments