• nsk
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

We've got a list button that calls a VF pg which uses an extension to the standard controller for a custom object.

 

Unless I'm absolutely crazy, this worked fine very recently.  (Last week?)  Today it doesn't work.  I get the following error:

 

Invalid variant 'parent': value 'Opportunity'

 

Which I don't understand at all.  I've tried it in various instances and it seems to have stopped working everywhere.  SF, did you push a change that caused this to stop working?

 

Here's the code.  First the page:

 

 

<apex:page standardController="OppPayment__c" recordSetVar="installments" extensions="ONEN_EXT_MarkPaymentsPaid" action="{!markInstallmentsWrittenOff}">
<apex:param name="mark" value="writeoff"/>
</apex:page>

 

next the extension:

 

 

public class ONEN_EXT_MarkPaymentsPaid {

private List<OppPayment__c> selectedInstallments;
private String mark;

//have to instantiate with StandardSetController for list buttons
public ONEN_EXT_MarkPaymentsPaid(ApexPages.StandardSetController controller) {
//get the selected ids that were checked
this.selectedInstallments = (List<OppPayment__c>)controller.getSelected();
}

public pageReference markInstallmentsPaid() {
mark='paid';
PageReference p = markInstallments();
return p;
}

public pageReference markInstallmentsWrittenOff() {
mark='writeoff';
PageReference p = markInstallments();
return p;
}

pageReference markInstallments() {
//get all the installments that were selected
List<OppPayment__c> InstallmentsFromSelection = [select Id,paid__c from OppPayment__c where Id IN :selectedInstallments];
if (InstallmentsFromSelection.size()>0) {
for (OppPayment__c thisInstallment : InstallmentsFromSelection) {
//if we're passing in paid on the querystring, mark them paid
if(mark=='paid') {
thisInstallment.paid__c=true;
thisInstallment.Written_Off__c=false;
} else if(mark=='writeoff') {
thisInstallment.Written_Off__c=true;
thisInstallment.paid__c=false;
}
}

update InstallmentsFromSelection;
}
PageReference p = new PageReference(System.currentPageReference().getParameters().get('retURL'));
p.setRedirect(true);
return p;
}
}

 

 BTW, OppPayment__c is a custom object which is detail-master to Opportunity.  The button is being accessed from a related list on an Opportunity layout.

 

edit: I just discovered that this list button works fine when called from the Console or from an OppPayment__c list view.  So the error seems to only occur when it's called from a related list on the Opp layout.  (Hence the reference to Opportunity being the 'parent', I assume.)

 

BTW, we have unit tests, and they all still pass.  So whatever the issue here is, it seems to happen only in the SF UI.   Also, nothing shows up in the System Log.

 

Can anyone help here?  

 

Thanks much!

 

PS: here's another post that may be related that looks like it was never answered: http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=12980

 

 

 

 

Message Edited by sparky on 07-06-2009 10:54 PM
Message Edited by sparky on 07-06-2009 11:06 PM