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
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);
},Hello,
It seems that this was already customized since OOB does not allow adding new records to the lookup inside the mini page.
As for the UseSilentCreation - it's a system feature with the UseSilentCreation code according to the code in the very same LookupQuickAddMixin
Go to
/0/Nui/ViewModule.aspx#Section/AppFeature_ListPage - for old UI
/0/Shell/#Section/AppFeature_ListPage - Freedom UI
find the UseSilentCreation feature (if the record is not present there - create it and enable it for all employees role) and relogin to the app.