• Himanshu Ghate
  • NEWBIE
  • 190 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 38
    Questions
  • 10
    Replies
Scenario --> I have created student VF page in which all the fields are there,So when I have inserted Id on the URL ,it's take you to the studnet record details page .when you are inserting any previous student record Id on the url of that VF page. 
But the Problem is--> As an user when the user is trying to insert or make student record on it own or new ,after hitting on the save button ,it's not taking to the studnet record details page .
Please can some one help me.

Image:-
VisualforcePage Error


Apex Class code-->
public class CustContStudentVfEx1ApexClass {
  
        //Now for the custom object
        //Create the visualforce Page when the user will insert the data ,it should be store somewhere so,for that we need to create
        //Variable to insert the value.
    public Student__c stud{get;set;}
     
    //Now to create the constructor when the user will insert the Id on the url we should be giving the Student Details record on the visualforce Page
    public CustContStudentVfEx1ApexClass(){
            
           //When the User will insert the Id on the url ,the particular record should be get display automatically
           ID  id=ApexPages.currentPage().getParameters().get('id');
           //Now to fetch the fields when the user will put the id on the url it should be showing some particular field on  the vf page.
           //But I want to check the user insert the url id is null or not .
           //using the conditional statement and put it inside the stud variable.
        stud=(id==null)?new Student__c():[SELECT Id,Name,State__c,Subject__c,Population__c,Gender__c,D_O_B__c,Age__c,City__c,Class__c FROM Student__c WHERE ID=:id];
            
 
    }
    //Now when the user will hit on the save button ,the record should be get shown update or new one
    public PageReference Save(){
        
             //To check the insert record is giving an error or not 
        try{
                
            upsert(stud);
        }
        catch(System.DmlException e){             
  
              //Now if an error occur I need to show this error on the vf to show an error
              ApexPages.addMessages(e);
              return null; //Now to return to the Page where we are inserting the record or fill up 
           
              
        }
        //Now ,if the error doesn't occur ,then take me to the details page of the records
        PageReference  studentDetailsPage=new ApexPages.StandardController(stud).view();
        return studentDetailsPage;
        
    }
    //For the cancel the it will take you to the current vf page
    public Pagereference Cancel(){
         
         return null;
    }
}

VisualforcePage code-->
<apex:page controller="CustContStudentVfEx1ApexClass" lightningStylesheets="true">
<apex:form >
<apex:pageBlock title="Student">
<apex:pageBlockSection title="StudentInformation"  collapsible="true" columns="2"> 

<apex:inputField value="{!stud.Name}"/>
<apex:inputField value="{!stud.State__c}"/>
<apex:inputField value="{!stud.Subject__c}"/>
<apex:inputField value="{!stud.Population__c}"/>
<apex:inputField value="{!stud.Gender__c}"/>
<apex:inputField value="{!stud.D_O_B__c}"/>
<apex:inputField value="{!stud.Age__c}"/>
<apex:inputField value="{!stud.City__c}"/>
<apex:inputField value="{!stud.Class__c}"/>\
</apex:pageBlockSection>
<apex:pageBlockButtons location="Bottom">

<apex:commandButton value="Save" action="{!Save}"/>
<apex:commandButton value="Cancel" action="{!Cancel}"/>
</apex:pageBlockButtons>

</apex:pageBlock>

</apex:form>
</apex:page>
User-added image
Inside the console it giving me an error like-->{status: 400, body: {…}, headers: {…}, ok: false, statusText: 'Bad Request', …}
body: {message: 'An error occurred while trying to update the record. Please try again.', statusCode: 400, enhancedErrorType: 'RecordError', output: {…}}
errorType: "fetchResponse"
headers: {}
ok: false
status: 400
statusText: "Bad Request"
[[Prototype]]: Object

And Here is my code-->can Some one please let me know where the problem and How I can create the Account  record.
Please Response with the soloution.
.html code
<template>
    <!-- Form this we have created the Account record form, -->
    <!-- but,Now as soon as the record the user will be inserted should be save -->
      <lightning-layout>
         <lightning-layout-item size="12">
               <lightning-card  title="AccountRecordForm">
                    <lightning-input type="text"  label="Name" onchange={handleName}>
                    </lightning-input>
                    <lightning-input type="text" label="Phone" onchange={handlePhone}>
                    </lightning-input>
                    <lightning-button  label="Save" onclick={handleSave}>  
                           
                    </lightning-button>
               </lightning-card>
         </lightning-layout-item>
      </lightning-layout>
</template>
.js
import { LightningElement,api } from 'lwc';
import { createRecord } from 'lightning/uiRecordApi';
export default class LDSFormMaking1 extends LightningElement {
    //Declare the variable
    Name;
    Phone;
    //Now I want to store the data which user will be inserted into the
    //Account Name-Rahul ,Phone-->784578455 As well as for the Save button
    //So that Record should be save
    //Now first I want to fetch the data of the User who is inserting the data
    //in the Name text box i.eName-->Rahul(I want to store the Rahul inside the Name)
    //So for that make the handleName inside the html.
    handleName(event)
    {
         //For the Name ,when the user will inserted any data
         //will be inside the Name text box
         //1)--> User will insert the data inside the Name
             //soon ,the user will be hitting the event
         //2)--> That,insert value will be inside the event
        this.Name=event.target.value;  //From this, the user value will be inside the Name
    }
    handlePhone(event)
    {
         this.Phone=event.target.value; //From this, the User value phone will be inside the Phone
    }
    handleSave()
    {
          //Now Inside the Save button ,When ever the user will
          //Inserting the value like the Name and Phone
          //Should be Save the Record into the Salesforce Org.
          //1)To Create the Record -->Fetch Create Record from the Lightning/uiRecordApi.
          //Now How to create the object let see,Hit on lightning/uiRecordApi
          //To create Record
          //I need to fetch first Fields for that
          let fields={'Name':this.Name,'Phone':this.Phone};
          //Now I want to fetch whole Record so for that,
          let Record={'apiName':'Account','Fields':fields};
          //Now I want to send the record
          //createRecord(Record); //From this you can send the record
                                //Which you have created.
          //But when the user will inserted any record or not
          //For that ,using the then Method for this
          createRecord(Record).then(x=>{
               //If the Record has been created it will print the value
               console.log(x);  
          }).catch(err=>{
              console.log(err);  //Else it will catch the error
          })          
    }
}
.metadeta file
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>57.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__AppPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__Tab</target>
    </targets>
</LightningComponentBundle>
Error-->Is coming that the allcars is not a function.but I want to retrive on patricular car from allcars.In this I have created Car1,Car2,and Car3 data,and put It into the AllCars={car1,car2,car3},If I want to use AllCar inside the filter on particular condition ,and I want to retrive the data of particular Car1 or car 2 or car 3 from the all car,but it saying all cars is not a function..How it will work please let me know.
 
Q1)What is getSobjectType?
Q2)How to fetch all the subject in the salesforce?
Q3)How to fetch the tabs info from Schema?
 
String accountdata='Hello';
String dyncquery='Select id, Name,     Industry , Type From Account';
if(accountdata=='Hello')
{
    dyncquery +='WHERE      Industry=\'Agriculture\'  AND Type=\'Prospect\'';
}else if(accountdata=='Helloworld')
{
    dyncquery +='WHERE      Industry=\'Banking\'  AND Type=\'Customer - Direct\'  ';
}
else{
    dyncquery +='WHERE     Industry=\'Construction\'     ';
}
List<Account> accounts=Database.query(dyncquery);
System.debug('Account Record:'+accounts);
System.debug('Account Size:'+accounts.size());Even if ,Inside the account object the industry field is present it showing the error like this.When I remove the Industry ,Then it show on Type that 
Line: 13, Column: 1
System.QueryException: unexpected token: Type
Line: 13, Column: 1
System.QueryException: unexpected token: Industry
 
trigger acctopp on Opportunity (after insert,after update,after delete) {
 Set<id> accid = new Set<id>();
  
        if(Trigger.isInsert ||  Trigger.isUpdate )
        {
            for(Opportunity opp:Trigger.new)
            {
               accid.add(opp.AccountId);//inserting accountid inside accid(inserting inside the set values)
            } 
        }
         if(Trigger.isdelete)
            {
                for(Opportunity opp:Trigger.old)
                {
                    accid.add(opp.AccountId);
                }
            }
        List<account> acclist = new List<account>();
        acclist = [Select id , name ,Account.Total_Opp__c,(Select id , name ,amount from Opportunities) from Account where Id IN:accid];//Query of account
        decimal total =0;
        for(account acc : acclist)
        {
            for(opportunity opp : acc.opportunities)
            {  
              
                total = total + opp.Amount;
                
            }
         
            acc.Total_Opp__c=total;
        }
    // update acclist;

}

The Scenario was-->When user go to Opportunity object and make some changes in Amount field or insert new record at that time in Account object there will be Total opp amount field will be there,And that changes which we made inside opportunity object in Amount field should reflect inside account object Total opp amount field automatically.
 
System.QueryException: List has no rows for assignment to SObject
public class sendEmail {
public List<String> toList{get;set;}
public List<String> ccList{get;set;}
public String To{get;set;}
public String cc{get;set;}
public String Subject{get;set;}
public String EmailBody{get;set;}
public CustomOpportunity__c Customopp{get;set;}
public Id  oppid{get;set;}

public sendEmail()
{
  ApexPages.PageReference Pageref=ApexPages.CurrentPage();
  oppid=Pageref.getParameters().get('Id');
  Customopp=[Select id, Name , AccountName__c,AccountName__r.Name,ContactName__r.Name,AccountName__r.Emailid__c FROM CustomOpportunity__c WHERE Id=:oppid];
  Subject='Opportunity Details For Account'+Customopp.AccountName__r.Name;
  EmailBody='<p><b>Account Status Update</b></p>'+'</br></br>'+
  'Dear'+'</br></br>'+Customopp.ContactName__r.Name+'</br></br>'+
  '<p>We are happy to inform you that your Account Order is under process.Please Find Below Current Status of your Account Ordered Product by you:</p>'+
   '<b>Account Name:</b>'+' '+Customopp.AccountName__r.Name+'<br/>'+
   '<b>Contact Name:</b>'+' '+Customopp.ContactName__r.Name+'<br/>'+
   '<b>Email ID:</b>'+' '+Customopp.AccountName__r.Emailid__c +'<br/><br/>'+
   'Please Contact your Account Service Manager For any queries releated to this update.For any Concerns,You can write to us at himanshughate2999@gmail.com.<br/><br/>'+
   
   'Regards,</br>'+
 '<b>IBM Accounts Team.</b>';
}
public pagereference SendingEmail()
{
tolist=new List<String>();
tolist.add(To);
cclist=new List<String>();
tolist.add(cc);
List<Messaging.Email> EmailObjs=new List<Messaging.Email>();
Messaging.SingleEmailMessage Emailobj=new Messaging.SingleEmailMessage();
Emailobj.setToAddresses(tolist);
Emailobj.setToAddresses(cclist);
Emailobj.SetReplyTo('support@acme.com');
Emailobj.SetSenderDisplayName('Salesforce Support');
Emailobj.SetSubject(Subject);
Emailobj.Sethtmlbody(EmailBody);
//EmailObj.SetBccSender(false);
//EmailObj.SetUseSignature(false);
EmailObjs.add(Emailobj);
Messaging.sendEmail(EmailObjs);
pagereference pr = new pagereference('/');
return pr;    
}
}
public class sendEmail {
public List<String> toList{get;set;}
public List<String> ccList{get;set;}
public String To{get;set;}
public String cc{get;set;}
public String Subject{get;set;}
public String EmailBody{get;set;}
public CustomOpportunity__c Customopp{get;set;}
public CustomOpportunity__c Id;

public sendEmail()
{
  ApexPages.PageReference Pageref=ApexPages.CurrentPage();
  Id=Pageref.getparameters().get('Id');
  Customopp=[Select Id,Name,AccountName__c,AccountName__r.Name,ContactName__r.Name,AccountName__r.Email__c FROM CustomOpportunity__c WHERE ID=:Id];
  Subject='Opportunity Details For Account'+Customopp.AccountName__r.Name;
  EmailBody='<p><b>Account Status Update</b></p>'+'</br></br>'+
  'Dear'+'</br></br>'+Customopp.ContactName__r.Name+'</br></br>'+
  '<p>We are happy to inform you that your Account Order is under process.Please Find Below Current Status of your Account Ordered Product by you:</p>'+
   '<b>Account Name:</b>'+' '+Customopp.AccountName__r.Name+'<br/>'+
   '<b>Contact Name:'</b>'+' '+Customopp.ContactName__r.Name+'<br/>'+
   '<b>Email ID:</b>'+' '+Customopp.ContactName__r.Email__c+'<br/><br/>'+
   'Please Contact your Account Service Manager For any queries releated to this update.For any Concerns,You can write to us at himanshughate2999@gmail.com.<br/><br/>'+
   
   'Regards,</br>'+
 '<b>IBM Accounts Team.</b>';
}
public pagereference SendingEmail()
{
tolist=new List<String>();
tolist.add(To);
cclist=new List<String>();
tolist.add(cc);
List<Messaging.Email> EmailObjs=new List<Messaging.Email>();
Messaging.SingleEmailMessage Emaiobj=new Messaging.SingleEmailMessage();
EmailObj.SettoAddress(tolist);
EmailObj.SetccAddress(cclist);
EmailObj.SetReplyTo('support@acme.com');
EmailObj.SetSenderDisplayName('Salesforce Support');
EmailObj.SetSubject(Subject);
EmailObj.Sethtmlbody(EmailBody);
//EmailObj.SetBccSender(false);
//EmailObj.SetUseSignature(false);
EmailObjs.add(EmailObj);
Messaging.sendEmail(EmailObjs);
pagereference pr = new pagereference('/');
return pr;    
}
}
pagereference pr = new pagereference('/'); -->It showing error,On this line of code.
Can someone till, the meaning that ,What happing in this SOQL quiers:
Where AccountId=:stdCtrl.getId()];
public class QuoteHW {
 public CustomOpportunity__c opp{get;set;}
    public CustomQuote__c quo {get;set;}
    public Id oppid{get;set;}
    public CustomOpportunitylineitem__c oppli{get;set;}
    public List<CustomOpportunitylineitem__c> opplilist{get;set;}
    public CustomQuotelineitem__c quoli{get;set;}
    
    public QuoteHW()
        
        
    {   
     ApexPages.Pagereference pageref = ApexPages.currentPage();
         oppid = pageRef.getParameters().get('Id');
      
      
        opp = new CustomOpportunity__c();
        opp = [Select Name, AccountName__c,Quantity__c, ContactName__c, Amount__c from CustomOpportunity__c where Id=: oppid ];
        opplilist = [SELECT Name , ActualPrice__c,DiscountValue__c, CustomOpportunity__c, CustomProduct__c, Quantity__c, UnitPrice__c from CustomOpportunitylineitem__c where CustomOpportunity__c=: opp.Id];
        
        
    }
    public pagereference Save()
       {
         quo = new CustomQuote__c();
         quo.AccountName__c= opp.AccountName__c;
         quo.CustomOpportunity__c = oppid;
         quo.Quantity__c= opp.Quantity__c;
         quo.ContactName__c= opp.ContactName__c;
         quo.Amount__c= opp.Amount__c;
         quo.Name = opp.Name;
         insert quo;
         
         for( CustomOpportunitylineitem__c a : opplilist)
         {
            quoli = new CustomQuotelineitem__c();
            quoli.ActualPrice__c= a.ActualPrice__c;
            quoli.DiscountValue__c= a.DiscountValue__c;
            quoli.CustomProduct__c= a.CustomProduct__c;
            quoli.Quantity__c = a.Quantity__c;
            quoli.UnitPrice__c = a.UnitPrice__c ;
            quoli.CustomOpportunitylineitem__c = a.Id;
            quoli.CustomOpportunity__c = a.CustomOpportunity__c ;
            quoli.CustomQuote__c = quo.Id;
            quoli.name = a.name;
            insert quoli;
          }
            
          
         pagereference pr = new pagereference('/' + quo.Id);
         return pr;
         
         
         
                    
       
       }
    

}IN SOQL showing an error ,Can someone please me out form this code.<apex:page controller="QuoteHW"  sidebar="false" >
 <apex:form >
  <apex:sectionHeader title="New Quote"/>
   <apex:pageBlock title="Edit Quote">
   
   <apex:pageBlockButtons >
    <apex:commandButton value="Save"  action="{!Save}"/>
    <apex:commandButton value="Cancel" />
   </apex:pageBlockButtons>
   
    <apex:pageBlockSection title="Quote">
     <apex:outputField label="Account Name" value="{!opp.AccountName__c}"/>
     <apex:outputField label="Quantity" value="{!opp.Quantity__c}"/>
     <apex:outputField label="Contact Name" value="{!opp.ContactName__c}"/>
     <apex:outputField label="Amount" value="{!opp.Amount__c}"/>
     </apex:pageBlockSection>
     <apex:pageBlockSection title="Product Details">
     
     <apex:pageBLockTable value="{!opplilist}" var="opl" >
     
      <apex:column value="{!opp.AccountName__c}" headerValue="Account Name"/>
      <apex:column value="{!opl.CustomOpportunity__c}" headerValue="Opportunity Name"/>
      
      <apex:column value="{!opl.Name}" headerValue="Opportunity Line Item Name"/>
      
      <apex:column headerValue="Actual Price"> 
       <apex:inputField value="{!opl.ActualPrice__c}" />
       </apex:column>
      
      <apex:column headervalue="Discount Value" >
      <apex:inputField value="{!opl.DiscountValue__c}" />
      </apex:column>
        <apex:column headervalue="Product">
      <apex:inputField value="{!opl.CustomProduct__c}" />
      </apex:column>
      
      
      <apex:column headerValue="Quantity">
       <apex:inputField value="{!opl.Quantity__c}" />
      </apex:column>
      <apex:column headervalue="Unit Price">
      <apex:inputField value="{!opl.UnitPrice__c}" />
      </apex:column>
     
      
      
     </apex:pageBLockTable>
    
    </apex:pageBlockSection>
   </apex:pageBlock>
 </apex:form>
</apex:page>


 
Apex Code of incentive object-->
public class incentive1 
{
public Incentitive1__c incen{get;set;}
public incentive1 ()
{
incen=new Incentitive1__c ();
}
public pagereference Save()
{
if(incen.Name!= Null)
{
   insert incen;
}
List<Incentitive1__c> incenlist=new List<Incentitive1__c>();
if(incen.Type__c=='Quarterly')
{
    for(integer i=1;i<=3;i++)
    {
        Incentitive1__c incenQuarterly=new Incentitive1__c (); //making Object to insert the details
        incenQuarterly.Name='IncentiveQuarterly'+i;
        incenQuarterly.Incentive__c=incen.id;
        incenQuarterly.Date__c=incen.Date__c;
        incenQuarterly.Type__c=incen.Type__c;
        incenQuarterly.TotalAmount__c=(incen.TotalAmount__c/3);
        incenlist.add(incenQuarterly);
    }insert incenlist;
}
if(incen.Type__c=='Monthly')
{
     for(integer i=1;i<=12;i++)
     {
        Incentitive1__c incenMonthly=new Incentitive1__c ();
        incenMonthly.Name='IncentiveMonthly'+i;
        incenMonthly.Incentive__c=incen.id;
        incenMonthly.Date__c=incen.Date__c;
        incenMonthly.Type__c=incen.Type__c;
        incenMonthly.TotalAmount__c=(incen.TotalAmount__c/12);
        incenlist.add(incenMonthly);
     }insert incenlist;
}
if(incen.Type__c=='Yearly')
{
    for(integer i=1;i<=1;i++)
    {
        Incentitive1__c incenYearly=new Incentitive1__c (); //making Object to insert the details
        incenYearly.Name='IncentiveYearly'+i;
        incenYearly.Incentive__c=incen.id;
        incenYearly.Date__c=incen.Date__c;
        incenYearly.Type__c=incen.Type__c;
        incenYearly.TotalAmount__c=(incen.TotalAmount__c/1);
        incenlist.add(incenYearly);
    }insert incenlist;
}   

if(incen.Type__c=='Half-Yearly')
{
   for(integer i=1;i<=6;i++)
   {
       Incentitive1__c incenHalfYearly=new Incentitive1__c (); //making Object to insert the details
       incenHalfYearly.Name='IncentiveHalf-Yearly'+i;
       incenHalfYearly.Incentive__c=incen.id;
       incenHalfYearly.Date__c=incen.Date__c;
       incenHalfYearly.Type__c=incen.Type__c;
       incenHalfYearly.TotalAmount__c=(incen.TotalAmount__c/6);
       incenlist.add(incenHalfYearly);
   }insert incenlist;
}

pagereference pg=new pagereference('/'+incen.id);
return pg;
}
public pagereference Cancel()
{
   pagereference pf=new pagereference('https://11com-b-dev-ed.develop.my.salesforce.com/a04/o');
   return pf;

}

}
Visualforce page code-->
<apex:page controller="incentive1">
<apex:form >
<apex:sectionHeader title="Incentive Edit"  subtitle="NewIncentive"/>
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!Save}"/>
<apex:commandButton value="Cancel" action="{!Cancel}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Information" columns="1">
<apex:inputField value="{!incen.Name}"/>
<apex:inputField value="{!incen.Incentive__c}"/>
<apex:inputField value="{!incen.Date__c}"/>
<apex:inputField value="{!incen.Type__c}"/>
<apex:inputField value="{!incen.TotalAmount__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>After creating new incentive record,it makes record only for monthly,When i choose montly type,its not working for Quarterly,Yearly,Half-Yearly why?
Error-->Is coming that the allcars is not a function.but I want to retrive on patricular car from allcars.In this I have created Car1,Car2,and Car3 data,and put It into the AllCars={car1,car2,car3},If I want to use AllCar inside the filter on particular condition ,and I want to retrive the data of particular Car1 or car 2 or car 3 from the all car,but it saying all cars is not a function..How it will work please let me know.
 
String accountdata='Hello';
String dyncquery='Select id, Name,     Industry , Type From Account';
if(accountdata=='Hello')
{
    dyncquery +='WHERE      Industry=\'Agriculture\'  AND Type=\'Prospect\'';
}else if(accountdata=='Helloworld')
{
    dyncquery +='WHERE      Industry=\'Banking\'  AND Type=\'Customer - Direct\'  ';
}
else{
    dyncquery +='WHERE     Industry=\'Construction\'     ';
}
List<Account> accounts=Database.query(dyncquery);
System.debug('Account Record:'+accounts);
System.debug('Account Size:'+accounts.size());Even if ,Inside the account object the industry field is present it showing the error like this.When I remove the Industry ,Then it show on Type that 
Line: 13, Column: 1
System.QueryException: unexpected token: Type
Line: 13, Column: 1
System.QueryException: unexpected token: Industry
 
trigger acctopp on Opportunity (after insert,after update,after delete) {
 Set<id> accid = new Set<id>();
  
        if(Trigger.isInsert ||  Trigger.isUpdate )
        {
            for(Opportunity opp:Trigger.new)
            {
               accid.add(opp.AccountId);//inserting accountid inside accid(inserting inside the set values)
            } 
        }
         if(Trigger.isdelete)
            {
                for(Opportunity opp:Trigger.old)
                {
                    accid.add(opp.AccountId);
                }
            }
        List<account> acclist = new List<account>();
        acclist = [Select id , name ,Account.Total_Opp__c,(Select id , name ,amount from Opportunities) from Account where Id IN:accid];//Query of account
        decimal total =0;
        for(account acc : acclist)
        {
            for(opportunity opp : acc.opportunities)
            {  
              
                total = total + opp.Amount;
                
            }
         
            acc.Total_Opp__c=total;
        }
    // update acclist;

}

The Scenario was-->When user go to Opportunity object and make some changes in Amount field or insert new record at that time in Account object there will be Total opp amount field will be there,And that changes which we made inside opportunity object in Amount field should reflect inside account object Total opp amount field automatically.
 
System.QueryException: List has no rows for assignment to SObject
public class sendEmail {
public List<String> toList{get;set;}
public List<String> ccList{get;set;}
public String To{get;set;}
public String cc{get;set;}
public String Subject{get;set;}
public String EmailBody{get;set;}
public CustomOpportunity__c Customopp{get;set;}
public Id  oppid{get;set;}

public sendEmail()
{
  ApexPages.PageReference Pageref=ApexPages.CurrentPage();
  oppid=Pageref.getParameters().get('Id');
  Customopp=[Select id, Name , AccountName__c,AccountName__r.Name,ContactName__r.Name,AccountName__r.Emailid__c FROM CustomOpportunity__c WHERE Id=:oppid];
  Subject='Opportunity Details For Account'+Customopp.AccountName__r.Name;
  EmailBody='<p><b>Account Status Update</b></p>'+'</br></br>'+
  'Dear'+'</br></br>'+Customopp.ContactName__r.Name+'</br></br>'+
  '<p>We are happy to inform you that your Account Order is under process.Please Find Below Current Status of your Account Ordered Product by you:</p>'+
   '<b>Account Name:</b>'+' '+Customopp.AccountName__r.Name+'<br/>'+
   '<b>Contact Name:</b>'+' '+Customopp.ContactName__r.Name+'<br/>'+
   '<b>Email ID:</b>'+' '+Customopp.AccountName__r.Emailid__c +'<br/><br/>'+
   'Please Contact your Account Service Manager For any queries releated to this update.For any Concerns,You can write to us at himanshughate2999@gmail.com.<br/><br/>'+
   
   'Regards,</br>'+
 '<b>IBM Accounts Team.</b>';
}
public pagereference SendingEmail()
{
tolist=new List<String>();
tolist.add(To);
cclist=new List<String>();
tolist.add(cc);
List<Messaging.Email> EmailObjs=new List<Messaging.Email>();
Messaging.SingleEmailMessage Emailobj=new Messaging.SingleEmailMessage();
Emailobj.setToAddresses(tolist);
Emailobj.setToAddresses(cclist);
Emailobj.SetReplyTo('support@acme.com');
Emailobj.SetSenderDisplayName('Salesforce Support');
Emailobj.SetSubject(Subject);
Emailobj.Sethtmlbody(EmailBody);
//EmailObj.SetBccSender(false);
//EmailObj.SetUseSignature(false);
EmailObjs.add(Emailobj);
Messaging.sendEmail(EmailObjs);
pagereference pr = new pagereference('/');
return pr;    
}
}
Can someone till, the meaning that ,What happing in this SOQL quiers:
Where AccountId=:stdCtrl.getId()];
Apex Code of incentive object-->
public class incentive1 
{
public Incentitive1__c incen{get;set;}
public incentive1 ()
{
incen=new Incentitive1__c ();
}
public pagereference Save()
{
if(incen.Name!= Null)
{
   insert incen;
}
List<Incentitive1__c> incenlist=new List<Incentitive1__c>();
if(incen.Type__c=='Quarterly')
{
    for(integer i=1;i<=3;i++)
    {
        Incentitive1__c incenQuarterly=new Incentitive1__c (); //making Object to insert the details
        incenQuarterly.Name='IncentiveQuarterly'+i;
        incenQuarterly.Incentive__c=incen.id;
        incenQuarterly.Date__c=incen.Date__c;
        incenQuarterly.Type__c=incen.Type__c;
        incenQuarterly.TotalAmount__c=(incen.TotalAmount__c/3);
        incenlist.add(incenQuarterly);
    }insert incenlist;
}
if(incen.Type__c=='Monthly')
{
     for(integer i=1;i<=12;i++)
     {
        Incentitive1__c incenMonthly=new Incentitive1__c ();
        incenMonthly.Name='IncentiveMonthly'+i;
        incenMonthly.Incentive__c=incen.id;
        incenMonthly.Date__c=incen.Date__c;
        incenMonthly.Type__c=incen.Type__c;
        incenMonthly.TotalAmount__c=(incen.TotalAmount__c/12);
        incenlist.add(incenMonthly);
     }insert incenlist;
}
if(incen.Type__c=='Yearly')
{
    for(integer i=1;i<=1;i++)
    {
        Incentitive1__c incenYearly=new Incentitive1__c (); //making Object to insert the details
        incenYearly.Name='IncentiveYearly'+i;
        incenYearly.Incentive__c=incen.id;
        incenYearly.Date__c=incen.Date__c;
        incenYearly.Type__c=incen.Type__c;
        incenYearly.TotalAmount__c=(incen.TotalAmount__c/1);
        incenlist.add(incenYearly);
    }insert incenlist;
}   

if(incen.Type__c=='Half-Yearly')
{
   for(integer i=1;i<=6;i++)
   {
       Incentitive1__c incenHalfYearly=new Incentitive1__c (); //making Object to insert the details
       incenHalfYearly.Name='IncentiveHalf-Yearly'+i;
       incenHalfYearly.Incentive__c=incen.id;
       incenHalfYearly.Date__c=incen.Date__c;
       incenHalfYearly.Type__c=incen.Type__c;
       incenHalfYearly.TotalAmount__c=(incen.TotalAmount__c/6);
       incenlist.add(incenHalfYearly);
   }insert incenlist;
}

pagereference pg=new pagereference('/'+incen.id);
return pg;
}
public pagereference Cancel()
{
   pagereference pf=new pagereference('https://11com-b-dev-ed.develop.my.salesforce.com/a04/o');
   return pf;

}

}
Visualforce page code-->
<apex:page controller="incentive1">
<apex:form >
<apex:sectionHeader title="Incentive Edit"  subtitle="NewIncentive"/>
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!Save}"/>
<apex:commandButton value="Cancel" action="{!Cancel}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Information" columns="1">
<apex:inputField value="{!incen.Name}"/>
<apex:inputField value="{!incen.Incentive__c}"/>
<apex:inputField value="{!incen.Date__c}"/>
<apex:inputField value="{!incen.Type__c}"/>
<apex:inputField value="{!incen.TotalAmount__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>After creating new incentive record,it makes record only for monthly,When i choose montly type,its not working for Quarterly,Yearly,Half-Yearly why?
I have search in Quick find,app manager also but not able to get the Quote object.