• Stephen E 4
  • NEWBIE
  • 80 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 23
    Questions
  • 6
    Replies
We have a action that creates an opportunity from a case. When we put the action (which calls a flow) on the page layout, it does not show up with all the other actions or buttons, but rather it shows up on the feed tab on the page. How can we change this? Users do not want this on the feed tab, they want it at the top of the page with the rest of the buttons. 

User-added image
We replicate tickets/data from external APIs and would like if we could create tickets every 10 minutes. Is that possible with scheduled apex? I have been getting a lot of conflicting answers when googling (and a lot of answers are very old, dating back to 2011.)

Thank you!
For example, if I wanted to grab accounts and their contacts in a single SOQL query I could do this:

[SELECT Id,(SELECT Id FROM Contacts) FROM Account]


Is this possible to do with child accounts? (Using the Standard "Parent" field)

When I attempt this:

[SELECT Id,(SELECT Id FROM Accounts) FROM Account]

I get this error:

"Didn't understand relationship 'Accounts' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names."

Is this possible?
Hello!

I am trying to write some SOQL so that I can perform some bulk operations on opportunties. However, whenever I run this SOQL I get an error: "unexpected token: AND"

Here is the SOQL:
 
String query2 = 'SELECT Id FROM Opportunity WHERE NOT StageName LIKE \'%'+'closed'+'%\' AND division__c = \'IT Solutions\'';

Here is the System.debug output:
 
SELECT Id FROM Opportunity WHERE NOT StageName LIKE '%closed%' AND division__c = 'IT Solutions'

I am just unsure what is wrong with this SOQL, seems I am escpaing the single quotes correctly... 

Thank you!
I am trying to do a summary a a custom time object we have for Cases. I have embded the VFP on a cases page layout. When people enter time, it groups together the person entering the time, and the amount they have billed. But I keep getting the 'List has more than 1 row for assignment to SObject' error. I am not sure why, this query will 99% percent of the time have more than 1 record (or more than 1 person entering records) because of how our cases work. Why cant I display more than 1 record? Other Programs we have made will return multipe records and then we loop through them on the VFP to display. Not sure why there is a limit on this program though. 

Code:
 
public class TimeSummaryController {
    public string caseid {get;set;}
     private final Case cc;
    public AggregateResult timeq {get;set;}
    public TimeSummaryController(ApexPages.StandardController stdController){
        this.cc = (Case)stdController.getRecord();
        
    }
    
    public AggregateResult getTimes(){
        try {
       	 timeq = [SELECT Engineer_Name__r.Name enr,SUM(Total_Billed__c)total_billed FROM Time__c WHERE Case__c = :cc.Id GROUP BY Engineer_Name__r.Name ORDER BY SUM(Total_Billed__c) DESC];
        }catch(Exception e){
            System.debug(e);
        	ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'No Time To Display'));
    		return null;        
        }
        return timeq;
    }
}
 
<apex:page standardController="Case" extensions="TimeSummaryController" showHeader="false">
    <apex:pageMessages ></apex:pageMessages>
    <apex:pageBlock>
   <apex:pageBlockTable value="{!Times}" var="tt" id="rr">
		
        <apex:column value="{!tt['enr']}"/>
       <apex:column value="{!tt['total_billed']}"/>

    </apex:pageBlockTable>
        </apex:pageBlock>
</apex:page>