Question

Filter in mobile app grid page not working.

I'm trying to add a default filter to my account grid page in the mobile app so that it only imports accounts owned by the current user.

I've tried multiple solutions, but nothing worked, and this is my last one:

Like 0

Like

1 comments

Hello,

In order to add such filter you need to create a new module in the configuration with this code:

 Terrasoft.sdk.Module.addFilter("Account", Ext.create("Terrasoft.Filter", {
    type: Terrasoft.FilterTypes.Group,
    subfilters: [
		Ext.create("Terrasoft.Filter", {
			compareType: Terrasoft.ComparisonTypes.Equal,
			property: "Owner",
			valueIsMacros: true,
			value: "Terrasoft.ValueMacros.CurrentUserContactId"
		})
	]
}));

After this, you need to connect this module in the Manifest schema:

	"Models": {
		"Account": {
			"RequiredModels": [
				------
			],
			"ModelExtensions": [],
			"PagesExtensions": [
				--------,
				"UsrAccountOwnerFilterMobile"
			]
		}
	},

 

Show all comments