• Allan Noland
  • NEWBIE
  • 30 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 8
    Replies
Hello,

Please help it says the id does not exist but it does.  Why is it throwing this error and how can i stop it and get it to run?

Here is the Trigger that I have written.  It executes when an opportunity is inserted or updated
 
trigger OpportunityOwnership on Opportunity (after insert, after update) {
    List<OpportunityShare> OpptyOwnerShares = New List<OpportunityShare>();
    List<OpportunityShare> OpptyOwnerUnShares = New List<OpportunityShare>();
    For(Opportunity opp : Trigger.New){
        List<OpportunityShare> Unshares = [Select id From OpportunityShare Where Opportunityid = :opp.id];
            If(Unshares.size()>0){
            	For(OpportunityShare unshare : Unshares){
                	OpptyOwnerUnshares.Add(unshare);
            	}
    		}
    
    }
    If(OpptyOwnerUnshares.size()>0){
        Database.Delete(OpptyOwnerUnshares);
    }
    For (Opportunity opp2 : Trigger.New){
        OpportunityShare Sales = New OpportunityShare();
        OpportunityShare CodingManager = New OpportunityShare();
        
        Sales.OpportunityID = opp2.Id;
        Sales.OpportunityAccessLevel = 'Edit';
        Sales.UserOrGroupId = opp2.Current_Sales_Resource__c;
		
        CodingManager.OpportunityID = opp2.Id;
        CodingManager.OpportunityAccessLevel = 'Edit';
        CodingManager.UserOrGroupId = opp2.Coding_Manager_Lookup__c;
        
        OpptyOwnerShares.add(Sales);
        OpptyOwnerShares.add(CodingManager);
    }
    If(OpptyOwnerShares.size()>0){
        Insert OpptyOwnerShares;
    }
}
It says that the id it can't find is First exception on row 0 with id 00t0j00000Rat90AAB

here is a shot of the query editor wherein clearly one can see the id above

User-added imageUser-added image

Please help me figure this out.

Thanks,
Allan


 

Hello,

I am building up a search string for use in a database.query(string).  I keep getting this error System.QueryException: unexpected token: Includes.  I have reworked the code several times with different ' ' escape methods.  Please help me figure out what i am doing wrong.  I have pasted the code that builds up the string along with the debug log to show what the string is once it is built up.
 

Here is the Code that builds up the string

Coder_Request__c coderrequestparams = [SELECT General_Specialties__c,Minimum_Experience_Requirement__c,Requested_EM_Specialties__c,Requested_Inpatient_Facility_Specialties__c,
            Requested_Outpatient_Specialties__c,Requested_Surgical_Specialties__c,Required_Credentials__c From Coder_Request__c Where id = 'a35M0000000398G']; //:pageid];
        string findGeneral_Specialties = coderrequestparams.General_Specialties__c;
        string findMinimum_Experience_Requirement = coderrequestparams.Minimum_Experience_Requirement__c;
        string findRequested_EM_Specialties = coderrequestparams.Requested_EM_Specialties__c;
        string findRequested_Inpatient_Facility_Specialties = coderrequestparams.Requested_Inpatient_Facility_Specialties__c;
        string findOutpatient_Specialties = coderrequestparams.Requested_Outpatient_Specialties__c;
        string findRequested_Surgical_Specialties = coderrequestparams.Requested_Surgical_Specialties__c;
        string findRequired_Credentials = coderrequestparams.Required_Credentials__c;
        string searchstring = '';
            IF(findGeneral_Specialties !=null)searchstring = searchstring + 'General_Specialties__c Includes(\''+ findGeneral_Specialties +'\''+ ')';
        	//IF(findMinimum_Experience_Requirement !=''&& searchstring =='')searchstring = searchstring + 'Minimum_Experience_Requirement__c Like'+'\''+'findMinimum_Experience_Requirement+ '%\'';
              // Else IF(findMinimum_Experience_Requirement !=''&& searchstring != '')searchstring = searchstring + 'AND Minimum_Experience_Requirement__c Like '+ '\''+ findMinimum_Experience_Requirement+ '%\'';
        	IF(findRequested_EM_Specialties !=null&& searchstring =='')searchstring = searchstring + 'E_M_Specialties__c Includes(\''+ findRequested_EM_Specialties+'\'' +')';
                Else IF(findRequested_EM_Specialties !=null&& searchstring != '')searchstring = searchstring + 'AND E_M_Specialties__c Includes(\''+ findRequested_EM_Specialties + '\'' +')';
        	IF(findRequested_Inpatient_Facility_Specialties !=null&& searchstring =='')searchstring = searchstring + 'Facility_Inpatient_Specialties__c Includes(\''+ findRequested_Inpatient_Facility_Specialties+'\''+ ')';
                Else IF(findRequested_Inpatient_Facility_Specialties !=null&& searchstring != '')searchstring = searchstring + 'AND Facility_Inpatient_Specialties__c Includes(\''+ findRequested_Inpatient_Facility_Specialties+ '\'' +')';
        	IF(findOutpatient_Specialties !=null&& searchstring =='')searchstring = searchstring + 'Facility_Outpatient_Specialities__c Includes(\''+ findOutpatient_Specialties+ '\'' +')';
                Else IF(findOutpatient_Specialties !=Null&& searchstring != '')searchstring = searchstring + 'AND Facility_Outpatient_Specialities__c Includes(\''+ findOutpatient_Specialties+ '\'' +')';
        	IF(findRequested_Surgical_Specialties !=null&& searchstring =='')searchstring = searchstring + 'Surgical_Specialties__c Includes(\''+ findRequested_Surgical_Specialties+'\'' + ')';
                Else IF(findRequested_Surgical_Specialties !=null&& searchstring != '')searchstring = searchstring + 'AND Surgical_Specialties__c Includes(\''+ findRequested_Surgical_Specialties+ '\'' +')';
        	IF(findRequired_Credentials !=null&& searchstring =='')searchstring = searchstring + 'Credentials__c Includes(\''+ findRequired_Credentials+ '\'' +')';
                Else IF(findRequired_Credentials !=null&& searchstring != '')searchstring = searchstring + 'AND Credentials__c Includes(\''+ findRequired_Credentials+ '\'' +')';
        	searchstring ='SELECT Name From Contract_Coder__c Where' + searchstring;
        	System.debug(SearchString);
			Database.Query(SearchString);
Here is the Debug Log so you can see the string it is generating

11:57:19:050 USER_DEBUG [26]|DEBUG|SELECT Name From Contract_Coder__c WhereGeneral_Specialties__c Includes('Anesthesiology')
 
See the picture below I want the dropdown for Revenue Projections to appear and i can't figure out how to make it happen.  Really new to the lightning experience can you tell :)

User-added image
Hello,

I am pretty green when it comes to programming in general so this is probably simple for the experienced folks out there, but this is vexing me quite severly.  I am trying to determine by page location when a link is clicked what row of data it refers to and more specifically what opportunity id. 

There are two objects in play here: 
Opportunity: Standard object we are all familiar with.
Revenue Projection: This is a child of the opportunity object and it is custom object in master detail relationship

I am using the standard list controller for the Opportunity object with an extension controller to make this page do what i want.

My issue is with the add new button.  How do i feed the id of the opportunity into my controller extension so i can create a new revenue projection tied to that opportunity and then refresh the page so that when they click add new it actually adds new.  

Main Objective: get possesion of the opportunity id in question so i can use it in the code.

Here is the visualforce markup
 
<apex:page Standardcontroller="Opportunity" recordSetVar="Opp" standardStylesheets="True" showHeader="false" Extensions="EditRevProjectionController"    >
    <apex:Form >
        <apex:pageBlock title="Revenue List" mode="Edit">
        <apex:pageBlockButtons location="both">
            <apex:commandButton action="{!previous}" value="Previous"/>
            <apex:commandButton action="{!quickSave}" value="Save"/>
            <apex:commandButton action="{!cancel}" value="Cancel"/>
            <apex:commandButton action="{!next}" value="Next"/>
        </apex:pageBlockButtons> 
        <apex:selectList value="{!filterid}" size="1">
          <apex:selectOptions value="{!listviewoptions}"/>
      </apex:selectList>
      <apex:commandButton action="{!first}" value="Apply"/>    
            <apex:pageBlockTable value="{!Opp}" var="op" width="100%">
              <!--<apex:Column width="100 (px)" value="{!op.Ownerid}" headerValue="Owner"></apex:Column>-->
              <apex:Column value="{!op.id}"></apex:Column>
              <apex:Column width="200 (px)" value="{!op.Name}" headerValue="Opportunity"></apex:Column>
              <apex:Column headerValue="Stage"><apex:inputfield value="{!op.StageName}" /><Apex:commandLink action="{!AddNewProjection}" Value="Add New"/></apex:Column>
            <apex:column >
            <apex:pageBlockTable value="{!Op.RevenueProjections__r}" var="re">
              <apex:Column width="50(px)"  headerValue="Year"><apex:inputfield value="{!re.Year__c}" /></apex:Column>
              <apex:Column width="50(px)"  headerValue="January"><apex:inputfield value="{!re.January__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="February"><apex:inputfield value="{!re.February__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="March"><apex:inputfield value="{!re.March__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="April"><apex:inputfield value="{!re.April__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="May"><apex:inputfield value="{!re.May__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="June"><apex:inputfield value="{!re.June__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="July"><apex:inputfield value="{!re.July__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="August"><apex:inputfield value="{!re.August__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="Setember"><apex:inputfield value="{!re.September__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="October"><apex:inputfield value="{!re.October__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="November"><apex:inputfield value="{!re.November__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="December"><apex:inputfield value="{!re.December__c}"/></apex:Column>
          </apex:pageBlockTable>           
          </apex:column>
        </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:Form>
</apex:page>
As you can see from the mark up each row in the pageblock table has an add new link which references a method of the controller extension. 

Here is the code for the extension with the opportunity id hard coded i want to make that dynamic
 
public class EditRevProjectionController {

    public EditRevProjectionController(ApexPages.StandardSetController controller) {}



        Public PageReference AddNewProjection(){
        revenueprojection__c projection = new revenueprojection__c();
        projection.April__c = 0;
        projection.August__c = 0;
        projection.December__c = 0;
        projection.February__c = 0;
        projection.January__c = 0;
        projection.July__c = 0;
        projection.June__c = 0;
        projection.March__c = 0;
        projection.November__c = 0;
        projection.May__c = 0;
        projection.November__c = 0;
        projection.October__c = 0;
        projection.September__c = 0;
        projection.Year__c = '2015';
        projection.Opportunity__c = '006M000000CsqMI';
        insert projection;
        PageReference editpage = New PageReference('https://aviacode--partialsan--c.cs7.visual.force.com/'+projection.id);
        Return editpage;        
    }

I have looked at get element by id and seen references to the $component variable but,  I am so very green it doesn't make a lot of sense to me.  Can somebody give some guidance on how best to go about this?

I have added bold and underline to emphasize key parts of the code.

Thanks,
Allan



 
Hello,

I am using the opportunity standard controller to create an input screen for some information.  Part of the captured information resides on a child object of the opportunity.  using the quicksave action of the standard controller saves information relative to the opportunity how do i get it to save information on the child record too.  Here is the code i am using
 
<apex:page Standardcontroller="Opportunity" recordSetVar="Opp" standardStylesheets="True" showHeader="false"    >
    <apex:Form >
        <apex:pageBlock title="Revenue List" mode="Edit">
        <apex:pageBlockButtons location="both">
            <apex:commandButton action="{!previous}" value="Previous"/>
            <apex:commandButton action="{!quickSave}" value="Save"/>
            <apex:commandButton action="{!cancel}" value="Cancel"/>
            <apex:commandButton action="{!next}" value="Next"/>
        </apex:pageBlockButtons> 
        <apex:selectList value="{!filterid}" size="1">
          <apex:selectOptions value="{!listviewoptions}"/>
      </apex:selectList>
      <apex:commandButton action="{!first}" value="Apply"/>    
            <apex:pageBlockTable value="{!Opp}" var="op" width="100%">
              <apex:Column width="100 (px)" value="{!op.Ownerid}" headerValue="Owner"></apex:Column>
              <apex:Column value="{!op.id}"></apex:Column>
              <apex:Column width="200 (px)" value="{!op.Name}" headerValue="Opportunity"></apex:Column>
              <apex:Column headerValue="Stage"><apex:inputfield value="{!op.StageName}" /></apex:Column>
            <apex:column >
            <apex:pageBlockTable value="{!Op.RevenueProjections__r}" var="re">
              <apex:Column width="50(px)"  headerValue="Year"><apex:inputfield value="{!re.Year__c}" /></apex:Column>
              <apex:Column width="50(px)"  headerValue="January"><apex:inputfield value="{!re.January__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="February"><apex:inputfield value="{!re.February__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="March"><apex:inputfield value="{!re.March__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="April"><apex:inputfield value="{!re.April__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="May"><apex:inputfield value="{!re.May__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="June"><apex:inputfield value="{!re.June__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="July"><apex:inputfield value="{!re.July__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="August"><apex:inputfield value="{!re.August__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="Setember"><apex:inputfield value="{!re.September__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="October"><apex:inputfield value="{!re.October__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="November"><apex:inputfield value="{!re.November__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="December"><apex:inputfield value="{!re.December__c}"/></apex:Column>
          </apex:pageBlockTable>           
          </apex:column>
        </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:Form>
</apex:page>

 
Hi,

I am trying to create a page similar to this but the quicksave function is not working.  When i hit the save button it refreshes the page but the data is unchanged.  What is wrong with this code?
 
<apex:page StandardController="Opportunity" RecordSetVar="opp">
 <apex:form >
     <apex:commandbutton action="{!quicksave}" value="Save"/>
     <apex:pageblock mode="inlineedit">
         <apex:pageBlockTable value="{!opp}" var="o">
             <apex:column value="{!o.name}"/>
         </apex:pageBlockTable>
     
     </apex:pageblock>
 
 </apex:form>
 </apex:page>

 
Hi, 
I am pretty new to Salesforce development and for that matter development in general.  Can somebody help the rookie out?  I have a child object of the system object opportunity.  it is revenueProjection__c.  I want to create a page where the revenue projection can be easily edited by the sales folks.  I am trying to use the __r notation to traverse to the child relationship but no matter how i try it it doesn't work.  In reading all of the documentation i can find on the subject it seems like i am doing it correctly.  Of course it always does :)  Here is my code what am i doing wrong? 
 
<apex:page Standardcontroller="Opportunity" recordSetVar="Opp" standardStylesheets="True" showHeader="false"    >
    <apex:Form >
        <apex:pageBlock title="Revenue List" mode="inlineEdit">
        <apex:pageBlockButtons location="both">
            <apex:commandButton action="{!quickSave}" value="Save"/>
        </apex:pageBlockButtons>
        
            <apex:pageBlockTable value="{!Opp}" var="op" width="100%">
              <apex:Column width="100 (px)" >
                <apex:outputfield value="{!op.Name}"/>
                <apex:facet name="header">Opportunity</apex:facet>
              </apex:Column>
        </apex:pageBlockTable>
        </apex:pageBlock>
        <apex:pageBlock>
            <apex:pageBlockTable value="{!Opp.RevenueProjection__r}" var="re">
              <apex:Column width="50(px)" >
                  <apex:facet name="header">January</apex:facet>
                    <apex:outputfield value="{!re.January__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">February</apex:facet>
                  <apex:inputfield value="{!re.February__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">March</apex:facet>
                  <apex:inputfield value="{!re.March__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">April</apex:facet>
                  <apex:inputfield value="{!re.April__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">May</apex:facet>
                  <apex:inputfield value="{!re.May__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">June</apex:facet>
                  <apex:inputfield value="{!re.June__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">July</apex:facet>
                  <apex:inputfield value="{!re.July__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">August</apex:facet>
                  <apex:inputfield value="{!re.August__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">September</apex:facet>
                  <apex:inputfield value="{!re.September__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">October</apex:facet>
                  <apex:inputfield value="{!re.October__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">November</apex:facet>
                  <apex:inputfield value="{!re.November__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">December</apex:facet>
                  <apex:inputfield value="{!re.August__c}"/>
              </apex:Column> 
          </apex:pageBlockTable>
       </apex:pageBlock>
    </apex:Form>
</apex:page>

 

Hello,

I am building up a search string for use in a database.query(string).  I keep getting this error System.QueryException: unexpected token: Includes.  I have reworked the code several times with different ' ' escape methods.  Please help me figure out what i am doing wrong.  I have pasted the code that builds up the string along with the debug log to show what the string is once it is built up.
 

Here is the Code that builds up the string

Coder_Request__c coderrequestparams = [SELECT General_Specialties__c,Minimum_Experience_Requirement__c,Requested_EM_Specialties__c,Requested_Inpatient_Facility_Specialties__c,
            Requested_Outpatient_Specialties__c,Requested_Surgical_Specialties__c,Required_Credentials__c From Coder_Request__c Where id = 'a35M0000000398G']; //:pageid];
        string findGeneral_Specialties = coderrequestparams.General_Specialties__c;
        string findMinimum_Experience_Requirement = coderrequestparams.Minimum_Experience_Requirement__c;
        string findRequested_EM_Specialties = coderrequestparams.Requested_EM_Specialties__c;
        string findRequested_Inpatient_Facility_Specialties = coderrequestparams.Requested_Inpatient_Facility_Specialties__c;
        string findOutpatient_Specialties = coderrequestparams.Requested_Outpatient_Specialties__c;
        string findRequested_Surgical_Specialties = coderrequestparams.Requested_Surgical_Specialties__c;
        string findRequired_Credentials = coderrequestparams.Required_Credentials__c;
        string searchstring = '';
            IF(findGeneral_Specialties !=null)searchstring = searchstring + 'General_Specialties__c Includes(\''+ findGeneral_Specialties +'\''+ ')';
        	//IF(findMinimum_Experience_Requirement !=''&& searchstring =='')searchstring = searchstring + 'Minimum_Experience_Requirement__c Like'+'\''+'findMinimum_Experience_Requirement+ '%\'';
              // Else IF(findMinimum_Experience_Requirement !=''&& searchstring != '')searchstring = searchstring + 'AND Minimum_Experience_Requirement__c Like '+ '\''+ findMinimum_Experience_Requirement+ '%\'';
        	IF(findRequested_EM_Specialties !=null&& searchstring =='')searchstring = searchstring + 'E_M_Specialties__c Includes(\''+ findRequested_EM_Specialties+'\'' +')';
                Else IF(findRequested_EM_Specialties !=null&& searchstring != '')searchstring = searchstring + 'AND E_M_Specialties__c Includes(\''+ findRequested_EM_Specialties + '\'' +')';
        	IF(findRequested_Inpatient_Facility_Specialties !=null&& searchstring =='')searchstring = searchstring + 'Facility_Inpatient_Specialties__c Includes(\''+ findRequested_Inpatient_Facility_Specialties+'\''+ ')';
                Else IF(findRequested_Inpatient_Facility_Specialties !=null&& searchstring != '')searchstring = searchstring + 'AND Facility_Inpatient_Specialties__c Includes(\''+ findRequested_Inpatient_Facility_Specialties+ '\'' +')';
        	IF(findOutpatient_Specialties !=null&& searchstring =='')searchstring = searchstring + 'Facility_Outpatient_Specialities__c Includes(\''+ findOutpatient_Specialties+ '\'' +')';
                Else IF(findOutpatient_Specialties !=Null&& searchstring != '')searchstring = searchstring + 'AND Facility_Outpatient_Specialities__c Includes(\''+ findOutpatient_Specialties+ '\'' +')';
        	IF(findRequested_Surgical_Specialties !=null&& searchstring =='')searchstring = searchstring + 'Surgical_Specialties__c Includes(\''+ findRequested_Surgical_Specialties+'\'' + ')';
                Else IF(findRequested_Surgical_Specialties !=null&& searchstring != '')searchstring = searchstring + 'AND Surgical_Specialties__c Includes(\''+ findRequested_Surgical_Specialties+ '\'' +')';
        	IF(findRequired_Credentials !=null&& searchstring =='')searchstring = searchstring + 'Credentials__c Includes(\''+ findRequired_Credentials+ '\'' +')';
                Else IF(findRequired_Credentials !=null&& searchstring != '')searchstring = searchstring + 'AND Credentials__c Includes(\''+ findRequired_Credentials+ '\'' +')';
        	searchstring ='SELECT Name From Contract_Coder__c Where' + searchstring;
        	System.debug(SearchString);
			Database.Query(SearchString);
Here is the Debug Log so you can see the string it is generating

11:57:19:050 USER_DEBUG [26]|DEBUG|SELECT Name From Contract_Coder__c WhereGeneral_Specialties__c Includes('Anesthesiology')
 
See the picture below I want the dropdown for Revenue Projections to appear and i can't figure out how to make it happen.  Really new to the lightning experience can you tell :)

User-added image
Hello,

I am pretty green when it comes to programming in general so this is probably simple for the experienced folks out there, but this is vexing me quite severly.  I am trying to determine by page location when a link is clicked what row of data it refers to and more specifically what opportunity id. 

There are two objects in play here: 
Opportunity: Standard object we are all familiar with.
Revenue Projection: This is a child of the opportunity object and it is custom object in master detail relationship

I am using the standard list controller for the Opportunity object with an extension controller to make this page do what i want.

My issue is with the add new button.  How do i feed the id of the opportunity into my controller extension so i can create a new revenue projection tied to that opportunity and then refresh the page so that when they click add new it actually adds new.  

Main Objective: get possesion of the opportunity id in question so i can use it in the code.

Here is the visualforce markup
 
<apex:page Standardcontroller="Opportunity" recordSetVar="Opp" standardStylesheets="True" showHeader="false" Extensions="EditRevProjectionController"    >
    <apex:Form >
        <apex:pageBlock title="Revenue List" mode="Edit">
        <apex:pageBlockButtons location="both">
            <apex:commandButton action="{!previous}" value="Previous"/>
            <apex:commandButton action="{!quickSave}" value="Save"/>
            <apex:commandButton action="{!cancel}" value="Cancel"/>
            <apex:commandButton action="{!next}" value="Next"/>
        </apex:pageBlockButtons> 
        <apex:selectList value="{!filterid}" size="1">
          <apex:selectOptions value="{!listviewoptions}"/>
      </apex:selectList>
      <apex:commandButton action="{!first}" value="Apply"/>    
            <apex:pageBlockTable value="{!Opp}" var="op" width="100%">
              <!--<apex:Column width="100 (px)" value="{!op.Ownerid}" headerValue="Owner"></apex:Column>-->
              <apex:Column value="{!op.id}"></apex:Column>
              <apex:Column width="200 (px)" value="{!op.Name}" headerValue="Opportunity"></apex:Column>
              <apex:Column headerValue="Stage"><apex:inputfield value="{!op.StageName}" /><Apex:commandLink action="{!AddNewProjection}" Value="Add New"/></apex:Column>
            <apex:column >
            <apex:pageBlockTable value="{!Op.RevenueProjections__r}" var="re">
              <apex:Column width="50(px)"  headerValue="Year"><apex:inputfield value="{!re.Year__c}" /></apex:Column>
              <apex:Column width="50(px)"  headerValue="January"><apex:inputfield value="{!re.January__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="February"><apex:inputfield value="{!re.February__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="March"><apex:inputfield value="{!re.March__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="April"><apex:inputfield value="{!re.April__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="May"><apex:inputfield value="{!re.May__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="June"><apex:inputfield value="{!re.June__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="July"><apex:inputfield value="{!re.July__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="August"><apex:inputfield value="{!re.August__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="Setember"><apex:inputfield value="{!re.September__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="October"><apex:inputfield value="{!re.October__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="November"><apex:inputfield value="{!re.November__c}"/></apex:Column>
              <apex:Column width="50(px)"  headerValue="December"><apex:inputfield value="{!re.December__c}"/></apex:Column>
          </apex:pageBlockTable>           
          </apex:column>
        </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:Form>
</apex:page>
As you can see from the mark up each row in the pageblock table has an add new link which references a method of the controller extension. 

Here is the code for the extension with the opportunity id hard coded i want to make that dynamic
 
public class EditRevProjectionController {

    public EditRevProjectionController(ApexPages.StandardSetController controller) {}



        Public PageReference AddNewProjection(){
        revenueprojection__c projection = new revenueprojection__c();
        projection.April__c = 0;
        projection.August__c = 0;
        projection.December__c = 0;
        projection.February__c = 0;
        projection.January__c = 0;
        projection.July__c = 0;
        projection.June__c = 0;
        projection.March__c = 0;
        projection.November__c = 0;
        projection.May__c = 0;
        projection.November__c = 0;
        projection.October__c = 0;
        projection.September__c = 0;
        projection.Year__c = '2015';
        projection.Opportunity__c = '006M000000CsqMI';
        insert projection;
        PageReference editpage = New PageReference('https://aviacode--partialsan--c.cs7.visual.force.com/'+projection.id);
        Return editpage;        
    }

I have looked at get element by id and seen references to the $component variable but,  I am so very green it doesn't make a lot of sense to me.  Can somebody give some guidance on how best to go about this?

I have added bold and underline to emphasize key parts of the code.

Thanks,
Allan



 
Hi,

I am trying to create a page similar to this but the quicksave function is not working.  When i hit the save button it refreshes the page but the data is unchanged.  What is wrong with this code?
 
<apex:page StandardController="Opportunity" RecordSetVar="opp">
 <apex:form >
     <apex:commandbutton action="{!quicksave}" value="Save"/>
     <apex:pageblock mode="inlineedit">
         <apex:pageBlockTable value="{!opp}" var="o">
             <apex:column value="{!o.name}"/>
         </apex:pageBlockTable>
     
     </apex:pageblock>
 
 </apex:form>
 </apex:page>

 
Hi, 
I am pretty new to Salesforce development and for that matter development in general.  Can somebody help the rookie out?  I have a child object of the system object opportunity.  it is revenueProjection__c.  I want to create a page where the revenue projection can be easily edited by the sales folks.  I am trying to use the __r notation to traverse to the child relationship but no matter how i try it it doesn't work.  In reading all of the documentation i can find on the subject it seems like i am doing it correctly.  Of course it always does :)  Here is my code what am i doing wrong? 
 
<apex:page Standardcontroller="Opportunity" recordSetVar="Opp" standardStylesheets="True" showHeader="false"    >
    <apex:Form >
        <apex:pageBlock title="Revenue List" mode="inlineEdit">
        <apex:pageBlockButtons location="both">
            <apex:commandButton action="{!quickSave}" value="Save"/>
        </apex:pageBlockButtons>
        
            <apex:pageBlockTable value="{!Opp}" var="op" width="100%">
              <apex:Column width="100 (px)" >
                <apex:outputfield value="{!op.Name}"/>
                <apex:facet name="header">Opportunity</apex:facet>
              </apex:Column>
        </apex:pageBlockTable>
        </apex:pageBlock>
        <apex:pageBlock>
            <apex:pageBlockTable value="{!Opp.RevenueProjection__r}" var="re">
              <apex:Column width="50(px)" >
                  <apex:facet name="header">January</apex:facet>
                    <apex:outputfield value="{!re.January__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">February</apex:facet>
                  <apex:inputfield value="{!re.February__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">March</apex:facet>
                  <apex:inputfield value="{!re.March__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">April</apex:facet>
                  <apex:inputfield value="{!re.April__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">May</apex:facet>
                  <apex:inputfield value="{!re.May__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">June</apex:facet>
                  <apex:inputfield value="{!re.June__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">July</apex:facet>
                  <apex:inputfield value="{!re.July__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">August</apex:facet>
                  <apex:inputfield value="{!re.August__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">September</apex:facet>
                  <apex:inputfield value="{!re.September__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">October</apex:facet>
                  <apex:inputfield value="{!re.October__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">November</apex:facet>
                  <apex:inputfield value="{!re.November__c}"/>
              </apex:Column>
              <apex:Column width="50px" >
                  <apex:facet name="header">December</apex:facet>
                  <apex:inputfield value="{!re.August__c}"/>
              </apex:Column> 
          </apex:pageBlockTable>
       </apex:pageBlock>
    </apex:Form>
</apex:page>

 

Hi,

I am just starting off with VF and I am grappling with a simple UI problem.

I need to create a VF page with the following requirement:

There are three containers which need to be side by side. Each one would perhaps be used to show a list of items

What tags should I use to have this arrangement?

I tried using panelGrid with 3 columns and a pageBlockSection in each column but I got all of them in one column of the panelGrid.

It seems that there is no editor or a reference material which I could use to actually visually see how each component works and fits in each other.

Please help me understand how is it easy to develop? Am I missing something?

Thanks,

Shashank