0

We have five communities in our org. We have bunch of common components in ORGS which common among org. Can we identify at run time in apex call is coming from which community.

Let suppose we have comm1, comm2, coom3, comm4 & comm5.

We are trying to implement logic like,

 if( comm1){


}
if( comm2){


}

Thanks

2

I would expected the Apex call Network.getNetworkId() to return an Id that you can then used to query the Network object to e.g. return the community name.

(But watch out in unit tests - this method will return null there. So you will have to use e.g. Test.isRunningTest to add test-only fake code.)

1
  • Thank you. Let me try that. Apr 19 at 10: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.