function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SvenSven 

Override save button (apex, vf) fails with user with limit rights

Hi,

We have a visualforce edit page on a custom object that is related to the case object.
if you use the standard save button - when you save the custom object it always returns to the cases view page.

because we still have to do some functionality on the custom object after the save, we overridden the save button with below code. this does the save but remains on the custom objects detail view.

Now this functionality worked fine before but now it does not work anymore (maybe winter '09) on a user with limited rights. if we change a setting on the profile "author apex" then it works again but then the users has to many rights to modify and delete records.


Code:
 public PageReference saveobj() {
     standardController.save();
        this.obj = (obj__c)standardController.getSubject();         
        return new PageReference('/'+ obj.Id);     
    } 

So we would like to keep our profile limited but the code has to keep working offcourse.
Any help would be great

Thx
Sven