3

I have a controller extention class and a visulforce page, VF page had a reference to a method call save in the extension class However, I renamed the method and the reference from VF page.

My problem is, when I validate my code with Force.com Migration Tool, it gives the error "...Error: The method System.PageReference Save() is referenced by Visualforce Page (..."

Extension Class's method;

        ...
public Pagereference Send() {
    try {  
        return doSend();

    } catch(Exception e){
        ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.FATAL,e.getMessage());
        ApexPages.addMessage(myMsg);
    }

    return null;
}

    ....

VF Page's reference;

    ...
<apex:pageBlockButtons location="both">
        <apex:commandButton value="Send" action="{!send}"/>
        <apex:commandButton value="Cancel" action="{!cancel}"/>
</apex:pageBlockButtons>
    ...

Error;

enter image description here

Can anyone see what's wrong here? any suggestions?

2
  • Did you include the updated page in your deployment
    – Eric
    Commented Oct 22, 2015 at 1:02
  • Yes I did, I merged all of my changes and I double checked, the change is there.
    – Hasantha
    Commented Oct 22, 2015 at 1:06

1 Answer 1

1

This is an annoying glitch with the compiler. You'll need to deploy an intermediate version of either the page without a reference to the save function, or the class with the new function plus a dummy save method (public void save() { } will suffice), and then a second deployment with the final version of your code. This rule doesn't apply to managed packages, though, only deployments for unmanaged code. I don't know of any workaround that involves less than two deployments.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .