• kevincar64
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies

I'm in a little bit of a jam.

I need to find all the IDs of Leads that have duplicate emails.

In SQL it would be something like

 

SELECT ID, Email from Lead where Email IN (SELECT Email from Lead HAVING COUNT(Id) > 1)

 

Does anyone know ho I can do this?

 

Many thanks for any suggestions.

 

 

 

Hi team,
I defined a custom link on a lead page, with the idea of popping up  a timer page.
I defined the link as onclick javascript:
< script type="text/javascript">

    window.open ("https://na4.salesforce.com/apex/ApexClock","mywindow","menubar=0,resizable=1,width=350,height=250");

< /script>

...And the ApexClock is just a simple system-clock display:
< apex:page id="thePage" showHeader="false">

< html>

< body>

< center>

< div id="clock"></div> < /center> < br/>

< div align="right"> < button onclick="int=window.clearInterval(int);" id="stop">Stop Clock</button>

< /div>

< /body>

< script type="text/javascript">

var int = self.setInterval("clock()",1000); function clock()  {    

var d=new Date();    

var t=d.toLocaleTimeString();    

document.getElementById("clock").innerHTML = "<B>" + t + "</B>"; }

< /script>

< /html>

< /apex:page>

... I know I shouldn't  hard-code the server name - I'll fix that, but the  popup doesnt show, and I know popup blockers are disabled.
Anyone know what I'm doing wrong?  Any help is appreciated.

KC

I'm missing something fundamental - I need to get the Owner, Number of Leads, and the role description of the lead owners on a single  SOQL statement.  I'm trying the following:

 

SELECT Lead.Owner.Alias,Owner.Id, Lead.Owner.UserRoleId,
Lead.Owner.UserRoleId.Name,  Count(Id)
 FROM Lead  
 WHERE Lead.Owner.IsActive = TRUE
 AND IsUnreadByOwner = True
 GROUP BY Lead.Owner.Alias, Lead.Owner.Id, Lead.Owner.UserRoleId, Lead.Owner.UserRoleId.Name
 HAVING Count(Id) < 25
 ORDER BY Lead.Owner.Alias ASC
LIMIT 45

 ...but I get

INVALID_FIELD:
ERROR at Row:2:Column:1 Didn't understand relationship 'UserRoleId' in field path.

 If I don't try to return "Lead.Owner.UserRoleId.Name" it works fine... which I'm thinking is because I'm mixing child-to-parent and parent-to-child, but I thought that since I already grabbed Lead.Owner.UserRoleId successfully I could also get the name.

 Is there any way to do this?

Thanks in advance

 KC64


Hi all,

 

I'm missing something fundamental - I need to get the Owner, Number of Leads, and the role description of the lead owners on an SOQL statement.  I'm trying the following:

 

SELECT Lead.Owner.Alias,Owner.Id, Lead.Owner.UserRoleId,
Lead.Owner.UserRoleId.Name,  Count(Id)
 FROM Lead  
 WHERE Lead.Owner.IsActive = TRUE
 AND IsUnreadByOwner = True
 GROUP BY Lead.Owner.Alias, Lead.Owner.Id, Lead.Owner.UserRoleId, Lead.Owner.UserRoleId.Name
 HAVING Count(Id) < 25
 ORDER BY Lead.Owner.Alias ASC
LIMIT 45

 

...but I get

INVALID_FIELD:
ERROR at Row:2:Column:1 Didn't understand relationship 'UserRoleId' in field path.

 

If I don't try to return "Lead.Owner.UserRoleId.Name" it works fine... which I'm thinking is because I'm mixing child-to-parent and parent-to-child, but I thought that since I already grabbed Lead.Owner.UserRoleId successfully I could also get the name.

 

Is there any way to do this?

 

Thanks in advance

 

KC64