Hi all,
Per business requirements we need to restrict the Customer field in Case to only show Contact records and only allow for the creation of Contact records. We achieved this through the following simple Javascript:
function (executionContext) { var lookup = executionContext.getformContext().getControl("customerid"); if (lookup) { if (lookup.getEntityTypes().length > 1) { lookup.setEntityTypes(["contact"]); } } }
This code correctly locks the Customer lookup to just Contacts; however, after enabling this script the +New Contact button no longer appears.
If the script is disabled, the button returns, and the user is able to create Contacts and Accounts.
Permissions are properly set so it should be visible, but it's not. Does anyone know what might be going wrong? It used to work and now suddenly does not. Thanks.