Happy Business Starts Here

Highlighted
Support SME

Problem getting autocomplete functionality to work while Implementing the Lookup Component

Problem:

 

Customer is trying to implement the LookupComponent using a custom LookupComponentController and is trying to get the autocomplete functionality to work but encountering  error "unexpected token: WHERE" whenever typing  a letter into the lookup field in the <zqu:LookupComponent> component.

 

Following is the custom code:

 

zqu.LookupComponentOptions optionsForSoldTo = new zqu.LookupComponentOptions();
optionsForSoldTo.objectName = 'Contact';
optionsForSoldTo.Id = 'SoldToContact';
optionsForSoldTo.isEditMode = true;
optionsForSoldTo.isRequired = true;
optionsForSoldTo.lookupComponentControllerName = 'TestLookupComponentController';
optionsForSoldTo.recordTypeId = Contact.SObjectType.getDescribe().getRecordTypeInfosByName().get('Master').getRecordTypeId();
optionsForSoldTo.popupWindowTitle = 'Sold To Contact Lookup';






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

1 REPLY 1
Support SME

Re: Problem getting autocomplete functionality to work while Implementing the Lookup Component

Solution:

 

If you are building your own custom lookup controller class that extends zqu.LookupComponentController, you must override the getAutoCompleteBaseSoql() method to get the base soql for auto complete to work.

 

For example:

 

// Override the getAutoCompleteBaseSoql() method to get base soql for auto complete
public override String getAutoCompleteBaseSoql() {
return 'Select Id, Name From Contact';
}

 

Following Knowledge Center Article as been updated to document the above;

 

https://knowledgecenter.zuora.com/CA_Commerce/I_Development_Resources/C_Component_Library/B_Global_C...






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √