Article
How to display another column in the "Accounts" list in the mobile app (outdated for version 7.11.3)
18:20 May 18, 2018
Question
How do I display another column in the "Accounts" list in the mobile app? For example, the "Address" coulmn?
Answer
Since the MobileAccountModuleConfig base schema cannot be changed, you need to create a custom UsrMobileAccountModuleConfig schema (in a custom package, create the page extension schema of the corresponding section). To do this, in the [Configuration] section, select Add > Source code. Fill in the schema properties ([Title], [Name], [Package]). Select JavaScript as a language for the schema, and connect it to the manifest.
"Models": { "Account": { "RequiredModels": [ . . . ], "ModelExtensions": [ . . . ], "ModelExtensions": [], "PagesExtensions": [ "MobileAccountRecordPageSettingsDefaultWorkplace", "MobileAccountGridPageSettingsDefaultWorkplace", "MobileAccountActionsSettingsDefaultWorkplace", "MobileAccountModuleConfig", "UsrMobileAccountModuleConfig" ]
Paste the following code in the schema:
Terrasoft.sdk.GridPage.setSecondaryColumn("Account", { columns: ["Address"], convertFunction: function(values) { return values.Address; } });
Register the necessary columns in the manifest:
{ "Name": "Account", "SyncColumns": [ "Address" ] }
Once done, we recommend regenerating the source code and compiling the configuration