• Akshay Garg 15
  • 30 Points
  • Member since 2021

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
  • 0
Hi, I want to get cookies when I log in into client's website but cookies with HttpOnly flags are not included in getHeaders. Only cookies without HttpOnly flag are returned in headers map. Pls help me with how to resolve this issue.
How can we set session token and cookie inside a mock callout class? Is it possible to set both the things together?
How can I set Data Security in such a way that I am able to hide particular field of an object, where other user has Standard user profile
Hey, Please help me out with the following trigger scenario..

Write an Apex Trigger on Account which adds all the Closed won Opportunity amounts of that Account and shows it on the Account record.

Create an account with name 'test account' & create a field on account - > number of contacts. Write a trigger such that when whenever a new contact is created it is automatically added to 'test account'.

Please help me writing this trigger. I have written the following code. Pls tell me where am I going wrong.

trigger InsertContact1 on Contact (after insert) {
    Account acList = [Select id, Name from Account where Name = 'Test Account'];
    List<Contact> contList = new List<contact>();
    for(Contact c: trigger.new){
    }    insert contList;
        for(Contact c: contList){
            c.AccountId = acList.id;
            acList.Number_Of_Contacts__c = integer.valueOf(contList.size());