• Elgun Aliyev 2
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Hi everyone,

We have multiple records (same record type) and User input percentage field. We need to make sure sum of that field is 100%. Is there any way of validating it in Visualforce page or so?

For example,

Record A    50%
Record B    25%
Record C    based on the inputs above percent for this record must be 25%


Kind regards,

Elgun
Hi Everyone,

It is urgent matter please help.

I wrote Apex class to set the finish location for my VF Page but when I try to write a test class I fail.

Can Anyone please help me to finish the Test Class for below example

This is the Apex Class where I define the location for the end of the flow
public class OpptyFlowController {
   
public Flow.Interview.NewOpptyButtonFlow myFlow { get; set; }
    
public String getmyID() {
if (myFlow==null) return '';
else return myFlow.var_NewOpptyId;
}

public PageReference getOID(){
PageReference p = new PageReference('/apex/opportunityProductEntry?&addto=' + getmyID() + '&retURL=%2F' + getmyID() + '&&sfdc.override=1&id='+ getmyID());
p.setRedirect(true);
return p;
}

}
This is the test class that I wrote but it fails to save, Error message is "Constructor not defined: [ApexPages.StandardController].<Constructor>(List<Opportunity>)"
@istest (SeeAllData = true)
private class OpptyFlowControllerTest {
    static testMethod void theTest(){
    Opportunity[] VarOpp = [Select ID from Opportunity limit 1];

PageReference testPage = new pagereference('/apex/Page.OQS_FLOW_VF_Page');
        testPage.getParameters().put('id', 'VarrOpp.id');
        Test.setCurrentPageReference(testPage);
        PageReference p = new PageReference('/apex/opportunityProductEntry?&addto=' + VarOpp + '&retURL=%2F' + VarOpp + '&&sfdc.override=1&id='+ VarOpp);
p.setRedirect(true);
        OpptyFlowController sc = new OpptyFlowController (new StandardController(VarOpp));
    }
}

 
Hi everyone,

We have multiple records (same record type) and User input percentage field. We need to make sure sum of that field is 100%. Is there any way of validating it in Visualforce page or so?

For example,

Record A    50%
Record B    25%
Record C    based on the inputs above percent for this record must be 25%


Kind regards,

Elgun
Hi Everyone,

It is urgent matter please help.

I wrote Apex class to set the finish location for my VF Page but when I try to write a test class I fail.

Can Anyone please help me to finish the Test Class for below example

This is the Apex Class where I define the location for the end of the flow
public class OpptyFlowController {
   
public Flow.Interview.NewOpptyButtonFlow myFlow { get; set; }
    
public String getmyID() {
if (myFlow==null) return '';
else return myFlow.var_NewOpptyId;
}

public PageReference getOID(){
PageReference p = new PageReference('/apex/opportunityProductEntry?&addto=' + getmyID() + '&retURL=%2F' + getmyID() + '&&sfdc.override=1&id='+ getmyID());
p.setRedirect(true);
return p;
}

}
This is the test class that I wrote but it fails to save, Error message is "Constructor not defined: [ApexPages.StandardController].<Constructor>(List<Opportunity>)"
@istest (SeeAllData = true)
private class OpptyFlowControllerTest {
    static testMethod void theTest(){
    Opportunity[] VarOpp = [Select ID from Opportunity limit 1];

PageReference testPage = new pagereference('/apex/Page.OQS_FLOW_VF_Page');
        testPage.getParameters().put('id', 'VarrOpp.id');
        Test.setCurrentPageReference(testPage);
        PageReference p = new PageReference('/apex/opportunityProductEntry?&addto=' + VarOpp + '&retURL=%2F' + VarOpp + '&&sfdc.override=1&id='+ VarOpp);
p.setRedirect(true);
        OpptyFlowController sc = new OpptyFlowController (new StandardController(VarOpp));
    }
}