0

I am working on a detail page in lightening experience. This page only exists in lightning and was prepared from a page layout, i.e., I did not create any custom components. Page uses standard components. Now this page has some fields of type picklist. I want to populate picklist by calling REST web services in from an apex controller class. Is there a way to do this without creating a custom component and then placing it on Detail tab in lightning app builder? What I am looking for is the use the Standard Detail “page/tab”, yet set actions such as onSelect, onChange etc and inside those actions write my custom code…

I know I can create a custom component and then in client controllerj.js files, I can call method of APEX class which will make calls to external REST WEB Services, pull data and show in picklist. What I was hoping is that I can just override the client xxxxcontroller.js files of standard detail component without creating custom components.

I hope I am clear on what I am asking, at least I hope it is a good start to get ideas.

Looking for ideas what are different options? If there is no other way than writing custom components, then what lighting components I can use inside my Custom Component to minimizes my work.

1

You'll need to write your own custom components to display the elements where you'd like to add new behaviors. You cannot inject code into the standard Record Detail component, nor can you pull out or override individual elements from that component.

Within your custom components, you can use any of the base Lightning components. The <lightning:recordViewForm> component may be helpful to you here to maximize use of built-in functionality.

Alternately, an efficient route could be to remove all of the items where you need custom functionality and surface only those items in one or more custom components that you add to your Lightning record page, while using the standard Record Detail component to display the remainder of the record data.

  • Thanks a lot for your quick response and your expert guidance. – pmehrotr Dec 30 '18 at 5:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.