Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I developed my app,

The controller is complete, and also the visualforce, but I need to hide my code at installing the app in another salesforce account. How can I make this possible?

Is there any way to hide both codes? The apex and the code behind?

Thanks in advance.

share|improve this question

You'll want to refer to the ISVForce guide, but in summation, if you're using a managed package, your Apex Code will be hidden from subscribers, but your Visualforce and JavaScript cannot be hidden.

share|improve this answer
    
Was about to say that too - if they put the content of the page in a Component it will be hidden though – Phil Hawthorn Jan 21 at 17:17
    
@sfdcfox Do you have good tutorial about how to do this? I read the article but it redirect me to many links, links for this, links for that, but it does not have any structure about how to do this?! Thanks in advance – Rodolfo Lanshore Jan 21 at 20:08
    
I doubt there's a tutorial, simply because there's nothing to do out of the ordinary. To hide your Apex Code, define a namespace, create a managed package, add your code to the package, and upload. The only caveat here is that global classes can be seen by subscribers. Public or less will have the body of the code hidden from subscribers automatically. – sfdcfox Jan 21 at 20:35
    
It's not that simple it's seems, this error shows everywhere: No test methods found in the Apex code included in the package. At least 75% test coverage is required. – Rodolfo Lanshore Jan 21 at 21:21
2  
@RodolfoLanshore See Add a Test Class and How to Write Good Unit Tests. – sfdcfox Jan 21 at 22:20

The way to create this is to create a managed Salesforce package.

That way your customers can use your controller and VF page, but they will not be able to access the source code of the Apex class. That will not hide your VF markup though.

share|improve this answer
    
I think user still able to view VF page code correct ? – Ratan Jan 21 at 17:18
1  
You're right. I have double-checked and modified my answer accordingly. Thanks! – mkorman Jan 21 at 17:21
    
This information redirect me to a lot of links, the manual, partner community. My question now is, do I need to be part of the salesforce partner community to enable this managed salesforce packages? So, it'll be through some kind of payment? – Rodolfo Lanshore Jan 21 at 17:38
    
You don't need to be part of the partner community and it's absolutely free (unless you want it listed on the App Exchange). I will try to post a different link if I can find it. – mkorman Jan 22 at 14:27
    
There is another writeup here (sfdcsrini.blogspot.com/2015/01/…), which seems to be a bit more step-by-step. – mkorman Jan 22 at 15:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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