[Need some Idea] Lookup's new record closes parent minipage

Hi,

I have a minipage that has lookup (contact) and whenever I try to add a new non-existing it suggests it as "New ContactName" which is nice, but when I click that, it opens the contact minipage and closes the original minipage and doesn't re-open the original minipage after I closed the contact minipage upon saving.

Do you have any idea of a better approach than making a custom modal?

Like 0

Like

1 comments

I found this code segment in LookupQuickAddMixin and I want to know where can I change the value of UseSilentCreation?
 

/**
		 * Checks that entity has mini page add mode allowed.
		 * @private
		 * @param {String} entitySchemaName Name of the entity.
		 * @param {Array} [additionalDefaultValues] Additional default values.
		 * @return {Boolean} True, if feature UseSilentCreation is turned off, and entity has add mini page.
		 */
		_needOpenMiniPage: function(entitySchemaName, additionalDefaultValues) {
			const entityStructure = this.getEntityStructure(entitySchemaName);
			if (!entityStructure) {
				return false;
			}
			const notUseSilentCreation = !Terrasoft.Features.getIsEnabled("UseSilentCreation");
			const editPages = entityStructure.pages;
			const typeLookupItem = additionalDefaultValues?.find((item) => item.attributeName === "TypeLookup");
			let page;
			if (typeLookupItem) {
				page = editPages.find((page) => page.UId === typeLookupItem.value);
			}
			page = page || Terrasoft.first(editPages);
			const hasAddMiniPage = page?.hasAddMiniPage;
			return notUseSilentCreation && Boolean(hasAddMiniPage);
		},
 
		/**
		 * Open page or mini page for new entity record.
		 * @protected
		 * @param {Object} newEntityConfig Entity config.
		 * @param {Object} newEntityConfig.entitySchema Entity schema.
		 * @param {String} newEntityConfig.entitySchemaName Entity schema name.
		 * @param {String} newEntityConfig.columnName Column name.
		 * @param {String} newEntityConfig.displayColumnValue Display column value.
		 * @param {String} newEntityConfig.valuePairsFromFilters Default values that were sent from filters.
		 * @param {Array} newEntityConfig.additionalDefaultValues Additional default values.
		 * @param {Object} viewModel View model context.
		 */
		openPageForNewEntity: function(newEntityConfig, viewModel) {
			var cardConfig = this._getNewEntityPageConfig(newEntityConfig);
			this._subscribeNewEntityCardModuleResponse(newEntityConfig.attributeName ?? newEntityConfig.columnName, cardConfig, viewModel);
			if (this._needOpenMiniPage(cardConfig.entitySchemaName, newEntityConfig.additionalDefaultValues)) {
				this.openAddMiniPage.call(this, cardConfig);
			} else {
				this._networkUtils.openCardInChain(cardConfig);
			}
			this.set && !newEntityConfig.attributeName && this.set(newEntityConfig.columnName, null);
		},
Show all comments