+ Start a Discussion
dawnzdydawnzdy 

button didn't show up on the visualforce page

Hi,

 

     I had a visualforce page with "save" & "cancle" buttons, it works very well using most profile settings, but when I tried with a certain profile,  the "save" button didn't  show up on the page.

 

     I have checked the security setting for both visualforce page and the apex class, and they all granted access to that profile.

 

     Any idea?

 

Thanks,

Dawn

Best Answer chosen by Admin (Salesforce Developers) 
wesnoltewesnolte

Ah! Precisely what I've had before. Try changing the name of your method to something else e.g. SaveOptCase and try it again. This worked for me.

 

My guess is that something(inside salesforce) gets confused because the standard controller has a method called 'save' too. The weird thing is that you wouldn't be allowed to use a method defined in your controller (i'm guessing it's an extension) as 'delete' within the page. Methinks it's a small bug.

 

Cheers,

Wes

All Answers

wesnoltewesnolte

Hey

 

Does your page use a standard controller of an object type?

 

If it does and the button uses the 'save' method of that standard controller you must ensure that your object and field-level permissions for that object are set correctly.

 

Cheers,

Wes

dawnzdydawnzdy

The save function is defined in a custom controller.

 

What permission should I check for this?

 

Thanks!

wesnoltewesnolte

Just so I can get a bit of a better feel for what you're doing..

 

You're not using a standard controller?

The name of you method is save?

 

I know these seem trivial but I've had strange issues in this area before and the solutions have been just as weird.

 

Wes

dawnzdydawnzdy

I am using both standard (Opportunity)  and customer controller to create a case linked to this opty.

 

 

This is the save() function: 

 

 

public PageReference save() {   
         CreateCase();
         upsert(optyCase);
         return (new ApexPages.StandardController(optyCase)).view();    
     }

 

 

 

wesnoltewesnolte

Ah! Precisely what I've had before. Try changing the name of your method to something else e.g. SaveOptCase and try it again. This worked for me.

 

My guess is that something(inside salesforce) gets confused because the standard controller has a method called 'save' too. The weird thing is that you wouldn't be allowed to use a method defined in your controller (i'm guessing it's an extension) as 'delete' within the page. Methinks it's a small bug.

 

Cheers,

Wes

This was selected as the best answer
dawnzdydawnzdy

Thanks wesnolte!

 

It's exactlly like your said, it worked fine after I changed the method name!

 

Cheers, thank you so much!

 

 

Dawn

wesnoltewesnolte

Glad to help:)

 

Cheers