How to add lookup select to detail before entering rest of inputs?

Im trying to replicate this feature the Accounts tab has in its Addresses detail which i'm trying to replicate on a similar detail on a custom section.

Like 1

Like

4 comments
Best reply

hi Oliver Crowe,



This is found in the "BaseAddressDetailV2" schema and the corresponding method for this functionality is getEditPages().

 

The below function can be modified/overridden in your corresponding address detail (Account Address or Contact Address).

Account Address - AccountAddressDetailV2

Contact Address - ContactAddressDetailV2

			/**
			 * @inheritdoc Terrasoft.BaseSchemaViewModel#getEditPages
			 * @overridden
			 */
			getEditPages: function() {
				var menuItems = this.Ext.create("Terrasoft.BaseViewModelCollection");
				var entityStructure = this.getEntityStructure(this.entitySchemaName);
				if (entityStructure) {
					var editPage = entityStructure.pages[0];
					var addressTypes = this.get("AddressTypes");
					addressTypes.each(function(addressType) {
						var id = addressType.get("Id");
						var caption = addressType.get("Name");
						var schemaName = editPage.cardSchema;
						var item = this.getButtonMenuItem({
							Caption: caption,
							Click: {bindTo: "addRecord"},
							Tag: id,
							SchemaName: schemaName
						});
						menuItems.add(id, item);
					}, this);
				}
				return menuItems;
			},

"Address Type" is a lookup that has the values appearing as "Actual, Legal, Shipping". Also you can customize values in this lookup as well.

 

 

 

BR,

Bhoobalan Palanivelu.

Greetings,



Could you kindly describe the feature in a bit more detail? What exact function are you trying to achieve with this detail? 

Mykhailo Zeleniuk,

 

Can you see the picture in my post? When you go to enter a new record to the detail it pops up with options from the Address Type field and automatically fills that in with the selected type.

hi Oliver Crowe,



This is found in the "BaseAddressDetailV2" schema and the corresponding method for this functionality is getEditPages().

 

The below function can be modified/overridden in your corresponding address detail (Account Address or Contact Address).

Account Address - AccountAddressDetailV2

Contact Address - ContactAddressDetailV2

			/**
			 * @inheritdoc Terrasoft.BaseSchemaViewModel#getEditPages
			 * @overridden
			 */
			getEditPages: function() {
				var menuItems = this.Ext.create("Terrasoft.BaseViewModelCollection");
				var entityStructure = this.getEntityStructure(this.entitySchemaName);
				if (entityStructure) {
					var editPage = entityStructure.pages[0];
					var addressTypes = this.get("AddressTypes");
					addressTypes.each(function(addressType) {
						var id = addressType.get("Id");
						var caption = addressType.get("Name");
						var schemaName = editPage.cardSchema;
						var item = this.getButtonMenuItem({
							Caption: caption,
							Click: {bindTo: "addRecord"},
							Tag: id,
							SchemaName: schemaName
						});
						menuItems.add(id, item);
					}, this);
				}
				return menuItems;
			},

"Address Type" is a lookup that has the values appearing as "Actual, Legal, Shipping". Also you can customize values in this lookup as well.

 

 

 

BR,

Bhoobalan Palanivelu.

Bhoobalan Palanivelu,

how exactly do you access address types? I m trying to implement this on EmploymentType, but I cannot access the values in employment type. 

Show all comments