• krish@123
  • NEWBIE
  • 80 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 21
    Questions
  • 26
    Replies


Result = [SELECT Count(Id) Total , Count(Customer_Type1__c ) name FROM contact  where Lead_SourceteLOOKUP__c !=null And Customer_Type1__c ='Buyer'   Customer_Type1__c ='Seller' GROUP BY Lead_SourceLOOKUP__c ];  

I need to display count of records  on visualforce page 

but i have stuck here how can display data  on isualforce page block table  with using above query

if Customer_Type1__c ='Buyer' 

i need to show this count in 
<apex:column  headervalue ="Buyer " value="{!Result}
lly 
if Customer_Type1__c ='Seller' 
<apex:column  headervalue ="Selleer " value="{!Result}

How can i acheived this


below query is the sql query 
i need to convert soql

select s.Name, SUM(CASE WHEN c.type='Buyer' THEN 1 ELSE 0 END) as Buyers , SUM(CASE WHEN c.type='Seller' THEN 1 ELSE 0 END) as Seller, COUNT(c.ID) as Total   
from source s
left outer join contact c on c.SourceId = s.Id



Thanks in advance
Hi 
I have requirement  i need to display  in the table with contact count based on customer status value
on contact histroy
how can i write the soql for contact histroy
In dot net where 
select count()  name  as *assigned name from contact 
'lly in salesforce how can it is  acheivable 

Advance thanks
HI 

Please check the below trigger iam getting the same records count from contacts for all users .

but  i need to display the contact records count created by individual users




trigger contactrecordcountresult on contact (before insert, before update) {

list<contact>ulist = new List<contact>();
ulist =[select id ,name, No_of_Assigned_Contacts__c,No_of_Converted_Contacts__c,No_of_Closed_Contacts__c,CreatedById  from contact];

list<AggregateResult>aglst = new list<AggregateResult>();

aglst =[select count(id) ,CreatedById from contact where   Customer_status__c <>'buyer broker'  group by CreatedById  ];
system.debug('----------------aglst ----------------fore-----'+aglst );

list<AggregateResult>aglst1 = new list<AggregateResult>();

aglst1 =[select count(id) ,CreatedById from contact where   Customer_status__c ='buyer broker'  group by CreatedById  ];
system.debug('----------------aglst1 ---------------------'+aglst1 );

list<AggregateResult>aglst2 = new list<AggregateResult>();

aglst2 =[select count(id) ,CreatedById from contact where   Customer_status__c ='closed'  group by CreatedById  ];



for (AggregateResult ar : aglst )
{
  
   for(contact uu:trigger.new){
   
 
   uu.No_of_Assigned_Contacts__c =  Integer.valueOf(ar.get('expr0'));
  
  
 }
  
 }
 //update ulist;
 
  
 for (AggregateResult ar1 : aglst1 )
{
for(contact uu1:trigger.new){
   uu1.No_of_Converted_Contacts__c=  Integer.valueOf(ar1.get('expr0'));

 }
 
 }
 
  for (AggregateResult ar2 : aglst2 )
{
for(contact uu2:trigger.new){

   uu2.No_of_Closed_Contacts__c=  Integer.valueOf(ar2.get('expr0'));
   
 }

 }
 

It's vry urgent 


Thanks
Hi 

Please see the below Trigger

trigger CountFemales1 on Contact (after insert,after update,after delete) {

  List<Contact> contacts = Trigger.isdelete ? trigger.old : trigger.new;
  Set<Id> accountIds = new Set<Id>();

  for (Contact c : contacts) {
     if (c.lastname!= null) {
       accountIds.add(c.id);
    } 
  }

list<Contact> FemaleList = [select id from contact where  id In :accountIds AND Customer_status__c ='buyer broker'];

 for(Contact a :FemaleList)  {
   a.No_of_Converted_Contacts__c= FemaleList .size();
 
 }
 update FemaleList ;
}

when I try edit and save the record iam getting below error

Error: Invalid Data. 
Hi ,

  Any one suggest me for salesforce app I have a  requirment that I need to sync all incoming  and outgoing  emails  from office 365 to salesforce
Kindly please share the link if you find any


Thanks
Hi 
 I need a helo for resolving  for below code

Iam sending emails  from  selected usere on Contact VF and saving record while saving iam sending emails for users and aslo saving records.

Now i need  to pass  current record id ( which i have saved) in inbound emails
I tried to send the record id  as  email.subject 

I am getting but i need to pass this email.subject or current id in soql

so that while replying from email .there is a status custom  field on contact object will become true.






global class createMemberInbound implements Messaging.InboundEmailHandler {
    global Messaging.InboundEmailResult handleInboundEmail(Messaging.inboundEmail email, Messaging.InboundEnvelope env) {
    
        Messaging.InboundEmailResult result = new Messaging.InboundEmailResult(); 
        String myPlainText= '';     
        myPlainText = email.plainTextBody;  
        Event[] newevent= new Event[0];
        MailSendingDetailsDTO__c mail = new MailSendingDetailsDTO__c();
            
        try 
        {
                   contact mem;
                   memb = [Select Id, Name, Email,Status__c  From Contact where id= :apexpages.currentpagereference.getparameter().get('id') ;
                   System.debug('-------------Error is mem------------:'+email.fromAddress);
                   mem.Status__c= true;
                   mem.Accepted_By__c = email.fromname;
                   System.debug('-------------Error is mem.Status_for_invitation__C------------: ' +mem.Status_for_invitation__C);
                   upsert mem;
        } 
          
        catch (Exception e) 
        {
            System.debug('Error is: ' + e);
        }   
            result.success = true;
            return result;
    }
}

Thanks

Hi 

I have requirment that i need to send emails on schedule basis

I am displying all the users on VF page  with checkbox

and  I am selecting any 3 users  and sending email
but when first email went o first user .wait for  10min .if didn't reply so send email automatically  to second selected user


Please help me out...

 
HI

How to write trigger when contact created from visualforce page automaticaly event also create( on standard contact detail)
Please share a code

Thanks
HI my requirement is 

 From event object Send invitation to first user and if not accepted within 10mins, it should expire and email invitation to next selected user .

Thank in advance
 
HI
 
I  have requirement from client  that

I have user's list with check box  i need to send emails for selected users as salesforce ICS formate(outlook)
for suppose i have selected  3 users from contact 
 i need to send emails to these  users 
but first come first serve like 
if user 'accepts'  the mails  the contact should assign to that user 

If not  first user didn't  responsed with in 10 mins .
we need to get a reply from  outlook that user  does not respond 

It is possible for  sechuduling emails  for evry 10min  

Thanks

Iam able to dispaly only one record out of 4duplicate records.

kindly help for me 


<apex:commandButton action="{!Next}" value="Check for Duplicates" status="status" reRender="duplicate"/>

 <apex:outputPanel id="duplicate">
              <apex:pageBlock title="Potential duplicates">
          <apex:pagemessage strength="2" title="Error!!" severity="error" detail="This Record Already Exists !!!" rendered="{!errormsg}"/><!-- End of error message -->
               <apex:pageblocktable rendered="{!NOT(ISNULL(existingcon))}" value="{!existingcon}" var="case" id="dup">
                               <apex:column headervalue="Select">
                                       <apex:commandlink action="{!SelectDuplicates}">
                                           <input type="radio" name="ContactSel"/>
                                       </apex:commandlink>                                         
                              </apex:column>
                              <apex:column headervalue="Name"> <apex:outputtext value="{!newcon.lastname}"/>  </apex:column>
                              <apex:column headervalue="Description"> <apex:outputtext value="{!newcon.email}"/>  </apex:column>
               </apex:pageblocktable>
     
 </apex:pageBlock>  </apex:outputPanel>


public List<Contact> chkdup;
public Contact newcon= new Contact();
public contact getcon()
 {
     return con;
 }
 public contact getexistingcon()
 {
     if (chkdup!= NULL)
     {
     if(chkdup.size()>0)
         return con;
     else
         return null;
     }
     else
         return null;
 }
public pagereference Next()
{
 chkdup=[select id,Lastname,Email from Contact where Lastname=:con.Lastname ];
 if(chkdup.size()>=0)
 {
      String tnum=con.Lastname;
     
      return null;
 }
 else
 {
       
       return null;
 }

}

Thanks
Hi
I have requirment that
I  have new page  when I  cllick the command button a popwindow will dispalyed with all records in that page and after selecting some checkboxes  in a pop window it display those records on another page and it should redirect to parent page 

Please suggest me

Thanks
 
Hi 
I   have a requirment that
 
I want to send  meeting invitition mail from salesforce to outlook(which they can accept or reject) using visualforcepage
and have a custom field Date field 

For suppose
I  have selected date   and  user  on particular date and for particualr user I want a send email invitition from salesforce

Please if you have any code please share 

it's very urgent

Thanks
 
Hi 
I  have requirement that we need to update a field on user object from custom object .Here we dunable to create lookup field to custom object from user object .


for example 

we have Qulification  field in custom object and also  there in User object

I want to update the Qulification  field value on  user object 


Please share your code if you have 


Thanks
 
Hi
I have requirement that i need a user object related list in another custom object Please any body suggest me .

or 
 I need a custom lookup were we can select multiple users with single lookup.......


Please very urgent


Thanks
 

Hi 
Please suggest  me how to change the autonumber based on year in a custom object 

for example : i have created records in December 2014

my last record sequence is AP-0090
it's ended .

Then from January 2015
the record sequence start with again AP-0001

So please send  me a code if  possible  

Thanks








 
Hi
we have a requirement like 
1) inside sale agents to add appointments and assign to multiple agents to accept/reject the appointment
2)work flow to allow only one agent (first) to accept the appointment

Please very urgent
Thanks
Hi 

Please suggest me  how to display  picklist  field  and textbox  on selection of  values in muti-picklist field
and if I selected two values at at a time  in mutlpicklist field then how  could be displayed both fields(picklist and textbox) in visualforce page 


Please post sample code if you have
its very urgent 

Thanks

 
Hi 
Please any one suggest me that  when user login into the salesforce instance for the first time in the current month  we need to display alert message like 
"Hi username your are logging into the salesforce instance first time  in this April month"
only first time  we need to dispaly this message 



Please very urgent
Thanks 
 
HI,
Please find the below screen short

User-added image

Please help me that how to split the startdatetime  and Enddatetime in visualforce page .Actaully we have requirement that we need to create Visualforce page with Event object . I have created  4  Custom fields  in task object.
1.StartDate Field
2.StartCustom picklist (time values tobe taken aa custom picklist )
3.EndDate Field
4.EndCustom picklist (time values tobe taken aa custom picklist )


I need to update the standard startdatetime field in event object  from task object custom fields

Please see the below code 

  public String InDateTime {get;set;}
  public String endDateTime {get;set;}
   private final Task task;
   public Event eventOb;

InDateTime  =(task.StartDate__c + task.StartDateTime__c);
 endDateTime  =(task.EndDate__c+ task.EndDateTime__c);
 eventObj.StartDateTime =Datetime.ValueOf(InDateTime);
  eventObj.EndDateTime = Datetime.ValueOf(endDateTime) 


Please send the any  example if you found  any
Thanks


 
Hi 
I have requirement  i need to display  in the table with contact count based on customer status value
on contact histroy
how can i write the soql for contact histroy
In dot net where 
select count()  name  as *assigned name from contact 
'lly in salesforce how can it is  acheivable 

Advance thanks
Hi 
I have requirement  i need to display  in the table with contact count based on customer status value
on contact histroy
how can i write the soql for contact histroy
In dot net where 
select count()  name  as *assigned name from contact 
'lly in salesforce how can it is  acheivable 

Advance thanks

Hi 

I have requirment that i need to send emails on schedule basis

I am displying all the users on VF page  with checkbox

and  I am selecting any 3 users  and sending email
but when first email went o first user .wait for  10min .if didn't reply so send email automatically  to second selected user


Please help me out...

 
HI

How to write trigger when contact created from visualforce page automaticaly event also create( on standard contact detail)
Please share a code

Thanks
HI
 
I  have requirement from client  that

I have user's list with check box  i need to send emails for selected users as salesforce ICS formate(outlook)
for suppose i have selected  3 users from contact 
 i need to send emails to these  users 
but first come first serve like 
if user 'accepts'  the mails  the contact should assign to that user 

If not  first user didn't  responsed with in 10 mins .
we need to get a reply from  outlook that user  does not respond 

It is possible for  sechuduling emails  for evry 10min  

Thanks

Iam able to dispaly only one record out of 4duplicate records.

kindly help for me 


<apex:commandButton action="{!Next}" value="Check for Duplicates" status="status" reRender="duplicate"/>

 <apex:outputPanel id="duplicate">
              <apex:pageBlock title="Potential duplicates">
          <apex:pagemessage strength="2" title="Error!!" severity="error" detail="This Record Already Exists !!!" rendered="{!errormsg}"/><!-- End of error message -->
               <apex:pageblocktable rendered="{!NOT(ISNULL(existingcon))}" value="{!existingcon}" var="case" id="dup">
                               <apex:column headervalue="Select">
                                       <apex:commandlink action="{!SelectDuplicates}">
                                           <input type="radio" name="ContactSel"/>
                                       </apex:commandlink>                                         
                              </apex:column>
                              <apex:column headervalue="Name"> <apex:outputtext value="{!newcon.lastname}"/>  </apex:column>
                              <apex:column headervalue="Description"> <apex:outputtext value="{!newcon.email}"/>  </apex:column>
               </apex:pageblocktable>
     
 </apex:pageBlock>  </apex:outputPanel>


public List<Contact> chkdup;
public Contact newcon= new Contact();
public contact getcon()
 {
     return con;
 }
 public contact getexistingcon()
 {
     if (chkdup!= NULL)
     {
     if(chkdup.size()>0)
         return con;
     else
         return null;
     }
     else
         return null;
 }
public pagereference Next()
{
 chkdup=[select id,Lastname,Email from Contact where Lastname=:con.Lastname ];
 if(chkdup.size()>=0)
 {
      String tnum=con.Lastname;
     
      return null;
 }
 else
 {
       
       return null;
 }

}

Thanks
Hi 
I  have requirement that we need to update a field on user object from custom object .Here we dunable to create lookup field to custom object from user object .


for example 

we have Qulification  field in custom object and also  there in User object

I want to update the Qulification  field value on  user object 


Please share your code if you have 


Thanks
 

Hi 
Please suggest  me how to change the autonumber based on year in a custom object 

for example : i have created records in December 2014

my last record sequence is AP-0090
it's ended .

Then from January 2015
the record sequence start with again AP-0001

So please send  me a code if  possible  

Thanks








 
Hi
we have a requirement like 
1) inside sale agents to add appointments and assign to multiple agents to accept/reject the appointment
2)work flow to allow only one agent (first) to accept the appointment

Please very urgent
Thanks

Hello,

 

I'm a new user with a devil of a problem - I need to create a bit of code that wil allow me to send meeting requests to non-Salesforce users that will put my Salesforce meetings in their diaries, Outlook or other.

 

I put full details of my request on the General board, thinking it could be done from within the custom HTML email templates.  I now realise it's more of an Apex issue.  

 

Would you be so kind as to take a look?  The thread is http://boards.developerforce.com/t5/General-Development/sending-an-ICS-Outlook-compatible-calendar-request-with-workflow/td-p/658603.

 

Best regards,

 

Alex.