Mobile App hide field in preview page and show in edit page
Hi Community,
In mobile application we can show/hide field using business rule but how we can configure that field will only show in edit page and it will be hidden in preview page.
Thanks
Like
Hello Fulgen,
Unfortunately, field visibility can not be changed via sdk.
All other preview page parameters can be changed by means of:
Terrasoft.sdk.RecordPage.configureColumn("Account", "primaryColumnSet", "Name", {
customPreviewConfig: {
}
})
In your case you can try to create your CardViewGenerator:
1) Create new schema of "module" type with the name UsrMobileCardViewGenerator
2) Add this code inside:
Ext.define("Terrasoft.configuration.UsrMobileCardViewGenerator", {
extend: "Terrasoft.ViewGeneration.CardViewGenerator",
generateColumnItems: function(columnSetConfig) {
var columnItems = this.callParent(arguments);
if (this.getModelName() === "Account" && this.getMode() === Terrasoft.CardViewModes.Preview) {
var newItems = [];
for (var i = 0, ln = columnItems.length; i < ln; i++) {
var columnItem = columnItems[i];
if (columnItem.name !== "Name") {
newItems.push(columnItem);
}
}
return newItems;
} else
return columnItems;
}
}
});
Terrasoft.DefaultCardViewGeneratorClassName = "Terrasoft.configuration.UsrMobileCardViewGenerator";
3) Then add this schema into Manifest of your section:
"Models": {
"Account": {
"PagesExtensions": [
"UsrMobileCardViewGenerator"
]
}
}