1

I am trying to create lightning component which should be specific to one custom object record only.

I added the component to Community Builder Custom object detail page. The problem I am facing is this component is coming up for all record detail pages like Account, Contact, Other Custom objects etc.

I tried using force:hasRecordId interface as well but it just for passing the record id. How can I restrict the Lightning component for specific Custom Object detail page only?

4

You can use sfdc:objects to specify a specific object; only objects that are specified will show the component:

<design:component label="My Component">
    <sfdc:objects>
        <sfdc:object>Contact</sfdc:object>
    </sfdc:objects>
</design:component>
  • i've done just this and it still shows up for all pages in community builder not just my custom object, any ideas? – thegogz Mar 21 '17 at 16:16
0

You can use Page Manager and build your own page in Napili Template .

You can pull of the Standard Detail Page components and your custom components there and expose that as a Tab .

  • I thought about it, but my scenario is - I have a Napili tab which goes to list view of the object and from there user can click on any of the records to go to the detail page and on that detail page I have added my Custom component. If my tab was opening the record page directly then I think your approach will be most suitable – Kaushik Ray Jun 24 '16 at 14:56
  • as a last option I am thinking to hide the component on load if the current page is the Custom object page I want, but I am hoping for some standard approach – Kaushik Ray Jun 24 '16 at 14:57
  • Sorry missed the scenario that you want to invoke that from another list .How about creating a formula field and exposing that instead in list view that points to this page .This sounds like ability to override a view type of scenario for Napili .Raise this as an idea !!! – Mohith Shrivastava Jun 24 '16 at 15:04
  • Good Idea, but client is very specific on the fields that needs to be present on on the community list view. And they want ability to keep on changing the admin config from their side to change these values. I will raise an idea – Kaushik Ray Jun 24 '16 at 15:06

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.