Hi Community,

 

I want to open a look up which by default has already selected records, please see image below. Lets say, I have look up "Main Activity". I want record "Main Activity A" by default was checked upon opening the look up window. 

Thanks

 

 

Like 0

Like

1 comments

Dear Fulgen,

In order to add such functionality you will need to proceed with custom development to the basic functionality.

Overall, this would be a major development, and we highly do not recommend to interfere with basic functionality, since it can caused unexpected system behavior. 

If you decide to go for development within the system, you will need to do the following:

- Add the LookupUtilitiesV2 to the dependencies of the schema, where lookup is located;

- Override the basic schema BaseLookupPageV2;

- BaseLookupPageV2 contains various methods, which are responsible for opening of the lookup and processing user actions. It also contains an attribute  'SelectedRows', which you might need in your development.

- Override the basic method opening the lookup, so to retrieve the collection of objects, before they are rendered on the page. Modify or add the needed object to selected rows. 

- Add the clause, that your functionality will only execute for particular schema/lookup/section/page, since BaseLookupPageV2 is a parent schema for other lookups in the system.

Regards, 

Anastasia

Show all comments

I have  string text field, I want to pop up look up upon hitting [enter] or [tab] keys

Like 0

Like

1 comments

It will be hard to catch the [tab] click event. The problem is that the [tab] key is reserved for changing an active element in a browser.

The [Enter] key will be easy to catch. I would do the following:

define("ContactPageV2", [], function() {
	return {
		entitySchemaName: "Contact",
		attributes: {},
		modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
		methods: {
			onEntityInitialized: function() {
				this.callParent(arguments);
			},
			onPhoneClick: function(e) {
				if (e && e.keyCode === 13) {
					console.log("show popup");
				}
			}
		},
		dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
		diff: /**SCHEMA_DIFF*/[
			{
				"operation": "merge",
				"name": "AccountPhone",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 4
					},
					"keyup": {
						"bindTo": "onPhoneClick"
					}
				}
			}
		]/**SCHEMA_DIFF*/
	};
});

 

Show all comments