Question

How to limit contacts in account?

I have a contact list detail in account .

And i want to limit this list to only 3 contacts. 

Any idea?

Like 0

Like

3 comments

Hello,

 

In the detail schema add this method to the methods object:

getRowCount: function() {
					return 3;
				},

This will limit download of records to 3 records at once.

Oleg Drobina,

Hello Oleg , i want the user to only be able to add three contacts .

Thank you.

developer,

 

Hello,

 

In this case you need to perform the client-side ESQ to the object that represents this contact list that is sent in terms of the onEntityInitialized method execution (the one that is triggered when the page is opened) that will count the number of records (example can be found here) then the result of this check should be passed via a sandbox message to the detail, the result should be set to the custom attribute created in the detail schema and this attribute should be used either in the getAddRecordButtonVisible overridden method on the detail schema or you can "merge" the "AddRecordButton" element in the diff and use your custom attribute value in the "visible" property of the element.

Show all comments