• Prabhat Gangwar007
  • NEWBIE
  • 0 Points
  • Member since 2014
  • Wipro LTD

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 6
    Replies

i want display inside vf page with bifurcate each API

Like Soap : 20 Used  , 10 Remains

I  want dispaly into visualforce page 

how to Get number of total used \remaining API calls for ORG in APEX  , bifurcate each API call

like

Soap API : 20 used , 10 Remain

Rest API : 10 Used , 10 Remain 

how ?

 

Hi All,
i have a field on Account called “Only_Default_Contact”, checkbox, default off
 
When a new Account is created, create a new Contact that has the following data points:
First Name = “Info”
Last Name = “Default”
Email = “info@websitedomain.tld”
and set Account Field Only_Default_Contact = TRUE

When the Account has more than 1 Contact, update Account field  Only_Default_Contact to FALSE.
public class TriggerAccountHelper {
    public static List<Account> newAccount = new List<Account>();
    public static List<Account> oldAccount = new List<Account>();
    public static Map<Id, Account> newMapAccount = new Map<Id, Account>();
    public static Map<Id, Account> oldMapAccount = new Map<Id, Account>();
  

    public static void CreatContact(){
         List<Contact> contactToInsert = new List<Contact>();
        for(Account acc : newAccount){
            Contact con = new Contact(LastName = 'test30',
                                      AccountId=acc.id
                                     );
            contactToInsert.add(con);
            if(contactToInsert.size() == 0){
                acc.OnlyDefaultContact__c = True;
            }
            else{
                acc.OnlyDefaultContact__c = False;
            }
        }
        
        if(!contactToInsert.isEmpty()){ 
            insert contactToInsert; 
         }
    
     }
}
i am executing the trigger on After insert.
its showing me this error:-Trigger_Account: execution of AfterInsert caused by: System.FinalException: Record is read-only Class.TriggerAccountHelper.CreatContact: line 19, column 1 Trigger.Trigger_Account: line 12, column 1
Hello, I wonder if anyone could help on this please. Fairly new to the coding on buttons.

I have a custom object 'Match' which is not related to Contacts.  I'm trying to create a custom button that has two functions:
  1. Default the To email address to the value in the Volunteer_Email__c on the Match object
  2. When email is sent update the Volunteer_Email_Sent_Date__c on the Match object to the date sent
The code I currently have is:
location.replace('/email/author/emailauthor.jsp?retURL=/{!Match__c.Id}&p3_lkid={!Match__c.Id}&rtype=003&template_id=00X0Y000000IQvm');

It appears to me with (1) above that I can add parameters to default the 'Additional To' and 'CC' to the value you in Volunteer_Email__c but not the To address. (I think it it is looking for a contact which in this case I do not have).

Many thanks for any advice, Rob 

I  want dispaly into visualforce page 

how to Get number of total used \remaining API calls for ORG in APEX  , bifurcate each API call

like

Soap API : 20 used , 10 Remain

Rest API : 10 Used , 10 Remain 

how ?