• viktor iliukhin 6
  • NEWBIE
  • 0 Points
  • Member since 2021

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

I try to open Opportunity via a visualforce page
 
<apex:page controller="xxx1">
    <apex:form id="fmMain">
        <apex:actionStatus id="pageStatus">
            <apex:facet name="start">
                <apex:outputPanel >
                    <apex:outputLabel value="Please, ......."/>
                </apex:outputPanel>            
            </apex:facet>
        </apex:actionStatus>
        <apex:pageBlock >
            <apex:pageBlockButtons >
                <apex:commandButton action="{!xxx}" value="xxx" status="pageStatus" reRender="fmMain" />
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>
 
public class xxx1 {
    public PageReference xxx() {
        id oppId = '0061x00000KpGN5';
        PageReference pageRef = new PageReference('/'+ oppId);
        pageRef.setRedirect(false);
        return pageRef; 
    }
}
When I try to open opportunity (click to button), I get error page. Without "apex:actionStatus" it works very well, but I need indiacion process

User-added image
An Apex transaction insert 100 Account records and 2000 Contact records  before encountering a DML exception when attempting to insert 500 Opportunity records. The Account record are inserted by calling the database.insert() method with the allOrNone argument set to false. The Contact and Opportunity record are inserted using the stand-alone insert statement.
How many total records will be committed to the database in this transaction?
A. 100
B. 2,100
C. 2,000
D. 0

Considering the salesforce documentation of Database.insert() when allOrNone is false, the answer should be A i.e 100. But, when I checked this on Anonymous window in developer console I get answer as D i.e 0.

Please help me with this solution.