Hi, everybody!
I work on Classic UI. I have a task: to realize opening mini-page instead of full page in Account Lookup by clicking Add Button.
I managed to do it in runtime mode.
To do this, it was necessary to make a change to the basic client module LookupPageViewModelGenerator.js, the needOpenMiniPage method.
But I couldn't override this basic module in the configuration and connect it to my page.
Code of my new LookupPageViewModelGenerator:
define("LVLookupPageViewModelGeneratorV2", ["LookupPageViewModelGenerator"], function(LookupPageViewModelGenerator) {
Ext.define("Terrasoft.configuration.LVLookupPageViewModelGeneratorV2", {
extend: "Terrasoft.LookupPageViewModelGenerator",
needOpenMiniPage: function(entitySchemaName) {
this.lookupInfo.isQuickAdd=true; // додано
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);
},
});
return Terrasoft.configuration.LVLookupPageViewModelGeneratorV2;
});
Code of my page where lookup is contained:
define("ELFinApplicationAccountPage", ["LVLookupPageViewModelGeneratorV2"], function() {
return {
entitySchemaName: "FinApplication",
attributes: {},
messages: {},
details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
businessRules: /**SCHEMA_BUSINESS_RULES*/ {}/**SCHEMA_BUSINESS_RULES*/,
methods: {},
diff: /**SCHEMA_DIFF*/[
{
operation: "insert",
name: "LVPartnerWhoRecommended",
parentName: "AdditionalProfileInfoContainer",
propertyName: "items",
values: {
layout: {
column: 0,
row: 6,
colSpan: 24
}
}
},
]/**SCHEMA_DIFF*/
};
});
I wrote this code while I was reading this article: https://community.creatio.com/questions/add-mini-card-contact-lookup-new-optionbutton. But maybe I made a mistake or didn`t take smth into account.
What do I have to do to make this work?
Thank you!