• Andrew Aldis 6
  • NEWBIE
  • 60 Points
  • Member since 2015
  • Business Software Analyst
  • Four Winds Interactive

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 5
    Replies
I am having trouble combining the following 2 sets of SOQL Queries.  I cannot do a join because they are pulling from the same object.  Basically I need to combine
Select Owner.Name, Owner.ID, Calendar_Month(CloseDate), SUM(Amount)
From Opportunity
Where CloseDate=This_Year AND StageName='Closed/Won'
GROUP BY ROllup(Owner.Name, Owner.Id, Calendar_Month(CloseDate))
With
Select Owner.Name, Owner.ID, Owner.SmallPhotoUrl
From Opportunity
Where CloseDate=This_Year AND StageName='Closed/Won'

I also need to combine
Select COUNT(CaseNumber), Calendar_Month(CreatedDate)
From Case
Where CreatedDate=This_Year
GROUP BY Calendar_Month(CreatedDate)
with
Select COUNT(CaseNumber), Calendar_Month(ClosedDate)
From Case
Where         ClosedDate=This_Year
GROUP BY Calendar_Month(ClosedDate)
We wrote a SOQL query to pull in chatter messages that have a badge attached the badges are small icons that can be used to congratulate or tell an employee good job.  The query pulls in the message but when the message containg "@employee name"  it comes accross as the user ID.  Does anyone know of a way to pull in the literal name.  So basically if I write @joe schmoe the query pulls in @000123456789XLR or something like that.  I need it to pull @joe schmoe. 
I am working on a controller that will allow me to only show child records that have a shipdate populated.  The situation is this I am creating a VF page with 3 sets of information involving 1 parent object and 2 of that parents child objects.  We have an installation object that is used by project managers to track project information we want to show all hardware related to the installation and all serial numbers which have been shipped to the customer which is also related to the object.  I am currently using a Rendered If formula on the pageblockTable to show shipped serial numbers but it looks sloppy on the PDF.  I am trying to create a simple controller to pull serial numbers that have a ship date that is not null.  So the situation is this the Installation parent object is SFDC_Project__c, and the Serial Number Child object is Serial_Numbers__r, the hardware object is working fine. 

Here is my class, I keep getting an error that says Invalid Type: installs.  I am not a developer but am trying to learn I can us VF with standard controllers but want to figure out extensions and other controllers. 

public with sharing class hardwareShippingSerialNumbers {

    public List<SFDC_Project__c> installs { get; set; }
    
   
    /**
     * Name: Parameterised Constructor
     * Desc: To initialize values
    **/
   public hardwareShippingSerialNumbers(ApexPages.StandardSetController controller)
    {
        // To get the install record
        installs ins = (installs)stdController.getRecord();
        
        if( ins != null )
        {
           installs = [ Select Id,
                            (SELECT  Id, Installation__c, SCMC__Serial_Number__c, Shipment_Date_Time__c, Warranty_Level__c,
                            Warranty_Expiration_Date1__c FROM Serial_Numbers__r  Where Shipment_Date_Time__c!=Null)
                            FROM SFDC_Project__c ];
        }
    }}
I am trying to create a VF page to display on the account page I have an installation object account__r which is a child of account, I also have a Hardware Information object that is a child object of the Installation object.  I would like to create a VF page that displays a pageblock table of the installations and under each installation an expandable sub-table that displays the hardware information records.  I wrote the VF page below and get the following error.  Anyone want to help out a newby on getting this done?

My Error:  
Object type not accessible. Please check permissions and make sure the object is not in development mode: SOQL statements cannot query aggregate relationships more than 1 level away from the root entity object.. Original queryString was: 'SELECT (SELECT (SELECT Carrier_for_Shipment__c, Id, Item_Master__c, Quantity_Ordered__c, Quantity_Shipped__c, Sales_Order__c, Sales_Order_Line_Item__c, Serial_Number_Shipped_from_Denver_Whs__c, Ship_Date__c, Ship_to_Address__c, Shipment_Type__c, Tracking_Number__c FROM Hardware_Information__r), Id, Name, SFDC_Project_Manager__c, SFDC_Project_Name__c, SFDC_Project_Status__c FROM account__r), Id FROM Account WHERE id = '000000000000000''


My Code:
<apex:page standardController="Account">
    <apex:pageBlock >
       <apex:pageBlockTable value="{!Account.account__r}" var="install">
           <apex:column value="{!install.Name}"/>
           <apex:column value="{!install.SFDC_Project_Manager__c}"/>
           <apex:column value="{!install.SFDC_Project_Name__c}"/>
           <apex:column value="{!install.SFDC_Project_Status__c}"/>
           <apex:column breakBefore="True" colspan="2"/>
                   <apex:pageBlockSection title="Hardware Shipment Information" showHeader="true" collapsible="True">
                    <apex:pageBlockTable value="{!install.Hardware_Information__r}" var="hardware">
                      <apex:column value="{!hardware.Shipment_Type__c}"/>
                      <apex:column value="{!hardware.Ship_Date__c}"/>
                      <apex:column value="{!hardware.Item_Master__c}"/>
                      <apex:column value="{!hardware.Sales_Order__c}"/>
                      <apex:column value="{!hardware.Sales_Order_Line_Item__c}"/>
                      <apex:column value="{!hardware.Serial_Number_Shipped_from_Denver_Whs__c}" />
                      <apex:column value="{!hardware.Quantity_Ordered__c}"/>
                      <apex:column value="{!hardware.Quantity_Shipped__c}"/>
                      <apex:column value="{!hardware.Carrier_for_Shipment__c}"/>
                      <apex:column value="{!hardware.Tracking_Number__c}"/>
                      <apex:column value="{!hardware.Ship_to_Address__c}"/>
                   </apex:pageBlockTable>
               </apex:pageBlockSection>
   </apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
I am trying to create a VF page with 2 page block tables both related to the same object.  I ultimately want to render the page as a PDF to print, but I can only seem to get one page block table to work.  When I add the second I get an Error stating Invalid field SFDC_Project__r for SObject Account, but SFDC_Project__r is a child object of Accounts.  The API name on the child object itself is SFDC_Project__c which gets the same error what am I doing wrong?

Here is my code.

<apex:page standardController="Account">
    <apex:pageBlock >
    
    <apex:pageBlockTable value="{!Account.Hardware_Information__r}" var="hardware">
      <apex:column value="{!hardware.Shipment_Type__c}"/>
      <apex:column value="{!hardware.Ship_Date__c}"/>
      <apex:column value="{!hardware.Item_Master__c}"/>
      <apex:column value="{!hardware.Sales_Order__c}"/>
      <apex:column value="{!hardware.Sales_Order_Line_Item__c}"/>
      <apex:column value="{!hardware.Serial_Number_Shipped_from_Denver_Whs__c}" />
      <apex:column value="{!hardware.Quantity_Ordered__c}"/>
      <apex:column value="{!hardware.Quantity_Shipped__c}"/>
      <apex:column value="{!hardware.Carrier_for_Shipment__c}"/>
      <apex:column value="{!hardware.Tracking_Number__c}"/>
      <apex:column value="{!hardware.Ship_to_Address__c}"/>
   </apex:pageBlockTable>
       <apex:pageBlockTable value="{!Account.SFDC_Project__r}" var="install">
       </apex:pageBlockTable>
</apex:pageBlock>

    </apex:page>
I am trying to add some custom buttons to a VF page and kept getting the following error when ever I try to add it.  Field $label.Retunt_To_Corporate_Transportation_Pro_Serv does not exist.  Check spelling.  I was told that the button I wanted to add did not have a label so I went and created a custom label then added the action of action="{!URLFOR($Action.SFDC_Project__c.Conga_Professional_Services_Preview_Report, SFDC_Project__c.Id)}".  I saved and everything seemed fine but when I click the button it pulls up the wrong template and report.  I checked the button and it is correct it even works when I click on a standard SF page layout, however when I click it on the VF page it pulls up a completely different conga template.  There is another button on the page that pulls up the same template.  Basically all it looks like I did was duplicate the conga button that was already there.  What could I be missing?

<apex:commandButton value="{!$Label.Conga_Professional_Services_Preview_Report}" action="{!URLFOR($Action.SFDC_Project__c.Conga_Professional_Services_Preview_Report, SFDC_Project__c.Id)}" onclick="openConga(); return false;"/>
I am trying to add some custom buttons to a VF page and keep getting the following error when ever I try to add it.  Field $label.Retunt_To_Corporate_Transportation_Pro_Serv does not exist.  Check spelling.  The spelling is correct and the button is set up exactly the same as other buttons that have been added to the VF page.  I am pretty new to this so I am definately missing many of the nuances of VF development but I cannot see why it will not let me add the field.  I also created 3 other fields on the same object and none will work with the page either I just get the same error.
My company has a pretty straight forward entitlement process, we basically have 3 levels and I was able to create an enitlement process to cover all 3 levels based on custom fields on the case.  We really want to be able to take advatage of milestones so a simple workflow will not suffice.  I want to create a trigger to update the entitlement name field on the case when ever an entitlement is created but cannot seem to get it right.  Have written simple triggers like this before that have updated a field but this one keeps giving my the following error on line 4.  Comparison Arguments must be compatible types entitlement, string.  If anyone can help me I would appreciate it.  I would like to move more into development and have set a personal goal to get a working apex trigger into production by the end of April.  Beleive me there is plenty of need for this skill set at my job.

trigger DefaultEntitlementUpdate on Case (before insert) {
    for(Case c : trigger.new){
        if(c.Entitlement == Null){
            c.Entitlement == 'Standard Entitlement';
        }
    }
}
I am working on a controller that will allow me to only show child records that have a shipdate populated.  The situation is this I am creating a VF page with 3 sets of information involving 1 parent object and 2 of that parents child objects.  We have an installation object that is used by project managers to track project information we want to show all hardware related to the installation and all serial numbers which have been shipped to the customer which is also related to the object.  I am currently using a Rendered If formula on the pageblockTable to show shipped serial numbers but it looks sloppy on the PDF.  I am trying to create a simple controller to pull serial numbers that have a ship date that is not null.  So the situation is this the Installation parent object is SFDC_Project__c, and the Serial Number Child object is Serial_Numbers__r, the hardware object is working fine. 

Here is my class, I keep getting an error that says Invalid Type: installs.  I am not a developer but am trying to learn I can us VF with standard controllers but want to figure out extensions and other controllers. 

public with sharing class hardwareShippingSerialNumbers {

    public List<SFDC_Project__c> installs { get; set; }
    
   
    /**
     * Name: Parameterised Constructor
     * Desc: To initialize values
    **/
   public hardwareShippingSerialNumbers(ApexPages.StandardSetController controller)
    {
        // To get the install record
        installs ins = (installs)stdController.getRecord();
        
        if( ins != null )
        {
           installs = [ Select Id,
                            (SELECT  Id, Installation__c, SCMC__Serial_Number__c, Shipment_Date_Time__c, Warranty_Level__c,
                            Warranty_Expiration_Date1__c FROM Serial_Numbers__r  Where Shipment_Date_Time__c!=Null)
                            FROM SFDC_Project__c ];
        }
    }}
I am trying to create a VF page to display on the account page I have an installation object account__r which is a child of account, I also have a Hardware Information object that is a child object of the Installation object.  I would like to create a VF page that displays a pageblock table of the installations and under each installation an expandable sub-table that displays the hardware information records.  I wrote the VF page below and get the following error.  Anyone want to help out a newby on getting this done?

My Error:  
Object type not accessible. Please check permissions and make sure the object is not in development mode: SOQL statements cannot query aggregate relationships more than 1 level away from the root entity object.. Original queryString was: 'SELECT (SELECT (SELECT Carrier_for_Shipment__c, Id, Item_Master__c, Quantity_Ordered__c, Quantity_Shipped__c, Sales_Order__c, Sales_Order_Line_Item__c, Serial_Number_Shipped_from_Denver_Whs__c, Ship_Date__c, Ship_to_Address__c, Shipment_Type__c, Tracking_Number__c FROM Hardware_Information__r), Id, Name, SFDC_Project_Manager__c, SFDC_Project_Name__c, SFDC_Project_Status__c FROM account__r), Id FROM Account WHERE id = '000000000000000''


My Code:
<apex:page standardController="Account">
    <apex:pageBlock >
       <apex:pageBlockTable value="{!Account.account__r}" var="install">
           <apex:column value="{!install.Name}"/>
           <apex:column value="{!install.SFDC_Project_Manager__c}"/>
           <apex:column value="{!install.SFDC_Project_Name__c}"/>
           <apex:column value="{!install.SFDC_Project_Status__c}"/>
           <apex:column breakBefore="True" colspan="2"/>
                   <apex:pageBlockSection title="Hardware Shipment Information" showHeader="true" collapsible="True">
                    <apex:pageBlockTable value="{!install.Hardware_Information__r}" var="hardware">
                      <apex:column value="{!hardware.Shipment_Type__c}"/>
                      <apex:column value="{!hardware.Ship_Date__c}"/>
                      <apex:column value="{!hardware.Item_Master__c}"/>
                      <apex:column value="{!hardware.Sales_Order__c}"/>
                      <apex:column value="{!hardware.Sales_Order_Line_Item__c}"/>
                      <apex:column value="{!hardware.Serial_Number_Shipped_from_Denver_Whs__c}" />
                      <apex:column value="{!hardware.Quantity_Ordered__c}"/>
                      <apex:column value="{!hardware.Quantity_Shipped__c}"/>
                      <apex:column value="{!hardware.Carrier_for_Shipment__c}"/>
                      <apex:column value="{!hardware.Tracking_Number__c}"/>
                      <apex:column value="{!hardware.Ship_to_Address__c}"/>
                   </apex:pageBlockTable>
               </apex:pageBlockSection>
   </apex:pageBlockTable>
</apex:pageBlock>
</apex:page>