• vivek ravi
  • NEWBIE
  • 30 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 6
    Replies
i have custom object name milestone and i have fields in tha called percentage
i have created custom fields in task name has percentage
now what i need is when ever im creating the task for particular milestone  record. the milestone record fields percentage has to be update with the sum of the percentage field in the task, when ever im creating new task the milestone record percentage fields has to be change

can any suggest me any code for this are any blogs  
im just wan o control the dublicate in emails ids in the contacts in accoun so that i wan to use set method

can i write my query like this

set <contact> conids=[select id,email from contact where id=:accountid];
set <id> contactemail=new set<id>();
for(contact con:conids)
{
contactemail.add(con.id)

}
can i write like this
if any one knw help me in this
im just wan o control the dublicate in emails ids in the contacts in accoun so that i wan to use set method

can i write my query like this

set <contact> conids=[select id,email from contact where id=:accountid];
set <id> contactemail=new set<id>();
for(contact con:conids)
{
contactemail.add(con.id)

}
can i write like this
if any one knw help me in this
im trying to send the notes and attachment of custom object to the contacts of accounts through a apex page if any one did this before can u refere me any blog r code for this im working this requriment about 2 days bt i can send the mail bt i dnt knw how to fetch the notes with the mail
can any knw pls help me in this requirement
public PageReference send()
    {
        List<Contact> contacts=[Select Id,Email From Contact Where AccountId='001i000000g7erl'];
        List<Id> Conids=new List<string>();
        for(Contact mail: contacts)
        {
            Conids.add(mail.Email);
        }
      
        Messaging.MassEmailMessage emails=new Messaging.MassEmailMessage();
        emails.setTargetObjectIds(Conids);
        emails.setTemplateId('00Xi0000000J9hx');
        emails.setsubject('note');
        emails.setplainTextBody('body');
      
        Messaging.SendEmail(New Messaging.MassEmailMessage[] {emails});

return null;
}

when im clicking the send button
the error is ::System.StringException: Invalid id: vivekravi@gmail.com
Error is in expression '{!send}' in component <apex:commandButton> in page brand

this the error can any one solve this error for me
public PageReference send()
    {
        List<Contact> contacts=[Select Id,Email From Contact Where AccountId='001i000000g7erl'];
        List<Id> Conids=new List<string>();
        for(Contact mail: contacts)
        {
            Conids.add(mail.Email);
        }
       
        Messaging.MassEmailMessage emails=new Messaging.MassEmailMessage();
        emails.setTargetObjectIds(Conids);
        emails.setTemplateId('00Xi0000000J9hx');
        emails.setsubject('note');
        emails.setplainTextBody('body');
       
        Messaging.SendEmail(New Messaging.MassEmailMessage[] {emails});

return null;
}

when im clicking the send button
the error is ::System.StringException: Invalid id: vivekravi@gmail.com
Error is in expression '{!send}' in component <apex:commandButton> in page brand

this the error can any one solve this error for me
List<Contact> accounts=[SELECT Email FROM Contact WHERE AccountId ='001i000000g7erl' ORDER BY Email ASC NULLS FIRST LIMIT 3];
list<Id> emailid=new list<id>();
for(id acc: Email)
{
acc.emailid[Email];
}
wat is worng in this can u explain me im new to apex code
List<Contact> accounts=[SELECT Email FROM Contact WHERE AccountId ='001i000000g7erl' ORDER BY Email ASC NULLS FIRST LIMIT 3];
list<Id> emailid=new list<id>(); 
for(id acc: Email)
{
acc.emailid[Email];
}
wat is worng in this can u explain me im new to apex code
Hi guys my requirment is to send the email the notes and attachment which i have in the custom object to the email in the particular account contacts
in this case how i can give the target object id string
how to give the query for fetching the accounts contact in the setTarget Object Id ()
can any one give me some examles  code for this
Hi I need to send the custom object record Notes Title and Body to the particular mail id my code
public with sharing class mail
{
public mail(ApexPages.StandardController controller)
{
string save=ApexPages.currentPage().getParameters().get('id');
List<NotesAndAttachments> n=[Select Title,Body From Brand__c.NotesAndAttachments Where parentid='01Ii0000001aNoy']; 
}  

public PageReference Send()
{
   
    String[]address=new String[] {sinffer@gmai.com'}; 
    Messaging.SingleEmailMessage emails = new Messaging.SingleEmailMessage();
    emails.setTargetObjectId('005i0000002nxZ6');
    emails.setTemplateId('00Xi0000000J9hx');
    emails.SaveAsActivity=(false);
    emails.setsubject('Simple Subject');
    emails.setplaintextbody('simple');
    emails.setToAddresses(address);
    Messaging.sendEmail(new Messaging.SingleEmailMessage[] { emails });
  

   
    return null;
   
}

when im using this code im getting error like this ::First SObject of the FROM statement must be a valid SObject type. at line 11 column 29

can any one help out from this
hi guys i jus want to send the notes of cutom object to the mail id which i have created in the contacts and account
can any one help me out from this i jus need some example for this
i have a custom oject name has brand and i need show  the notes and atachment records in the new window i already done with standard controller but nw i need to use the extension controller how can i fetch that with soql query

 
hi im new to the apex code can any one explain me with some example to show the notes and attahment of the cutom record in new window i knw that related list is there but i need help on that related list how to fetch the fields of notes and attachment in that
im just wan o control the dublicate in emails ids in the contacts in accoun so that i wan to use set method

can i write my query like this

set <contact> conids=[select id,email from contact where id=:accountid];
set <id> contactemail=new set<id>();
for(contact con:conids)
{
contactemail.add(con.id)

}
can i write like this
if any one knw help me in this
im just wan o control the dublicate in emails ids in the contacts in accoun so that i wan to use set method

can i write my query like this

set <contact> conids=[select id,email from contact where id=:accountid];
set <id> contactemail=new set<id>();
for(contact con:conids)
{
contactemail.add(con.id)

}
can i write like this
if any one knw help me in this
List<Contact> accounts=[SELECT Email FROM Contact WHERE AccountId ='001i000000g7erl' ORDER BY Email ASC NULLS FIRST LIMIT 3];
list<Id> emailid=new list<id>(); 
for(id acc: Email)
{
acc.emailid[Email];
}
wat is worng in this can u explain me im new to apex code
Hi I need to send the custom object record Notes Title and Body to the particular mail id my code
public with sharing class mail
{
public mail(ApexPages.StandardController controller)
{
string save=ApexPages.currentPage().getParameters().get('id');
List<NotesAndAttachments> n=[Select Title,Body From Brand__c.NotesAndAttachments Where parentid='01Ii0000001aNoy']; 
}  

public PageReference Send()
{
   
    String[]address=new String[] {sinffer@gmai.com'}; 
    Messaging.SingleEmailMessage emails = new Messaging.SingleEmailMessage();
    emails.setTargetObjectId('005i0000002nxZ6');
    emails.setTemplateId('00Xi0000000J9hx');
    emails.SaveAsActivity=(false);
    emails.setsubject('Simple Subject');
    emails.setplaintextbody('simple');
    emails.setToAddresses(address);
    Messaging.sendEmail(new Messaging.SingleEmailMessage[] { emails });
  

   
    return null;
   
}

when im using this code im getting error like this ::First SObject of the FROM statement must be a valid SObject type. at line 11 column 29

can any one help out from this
hi im new to the apex code can any one explain me with some example to show the notes and attahment of the cutom record in new window i knw that related list is there but i need help on that related list how to fetch the fields of notes and attachment in that