• Sasid
  • NEWBIE
  • 10 Points
  • Member since 2016


  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 4
    Questions
  • 6
    Replies
Whenever a live agent receives a message from the visitor there should be be a desktop notification to be fired.
  • March 19, 2019
  • Like
  • 0
Could you please help me to write a trigger on Cross Object Record deletion.

Assume object A (Opportunity) and B (Contact Roles).
Object B is in related list of A.
Assume that there is a record in object B related to object A's record with name "ABCD".
Whenever a record is created on object B related to object A's record with name other than "ABCD", then the existing object B record named "ABCD" should be deleted.
  • January 01, 2018
  • Like
  • 0
public with sharing class SessionControllerExtension {

    public Integer counter {get; set;}

    public blob picture { get; set; }
    public String errorMessage { get; set; }

    private final Session__c session;
    private ApexPages.StandardController stdController;

    public SessionControllerExtension(ApexPages.StandardController controller) {
        this.session = (Session__c)stdController.getRecord();
        this.stdController = stdController;
        counter = 0;
    }

    public void increment() {
        counter++;
    }
}
  • August 22, 2016
  • Like
  • 0
Hello, I'm hoping someone can help me out!

I am trying to write a trigger on Borrowed_book__c to update a field on a related object Member__c, linked through a lookup field. I am created  picklist in trigger object and number data type field on related object (Active_Books__c).
 
 Now I have written the code based on the condition below;
increment or decrement a number field (Active_Books__c) on the related object.
If  Borrowed_book__c.Status_of_books__c = Is taking, Active_Books__c needs to be the previous value + 1.
If Borrowed_book__c.Status_of_books__c = Is giving, Active_Books__c needs to be the previous value -1. But i got an error like (execution of AfterInsert caused by: System.NullPointerException: Attempt to de-reference a null object). I have question marks at those places in the code. 

trigger BorrowerBookStatusTrigger on Borrowed_book__c (after insert, after update) {
    {
        
        Map<Id,Id> MappingToBbMap = new Map<Id,Id>();
        for(Borrowed_book__c Bb : trigger.new)
            MappingToBbMap.put(Bb.Member_ID__c,Bb.Id);
        
        List<Member__c> MembersToUpdate = new List<Member__c>();
        
        for (Member__c m: [SELECT Id,Active_Books__c FROM Member__c WHERE Id IN:  MappingToBbMap.keySet()])
        {
            Id Bb2Id = MappingToBbMap.get(m.Id);
            Borrowed_book__c Bb2 = trigger.newMap.get(Bb2Id);
            if (Bb2.Status_of_books__c =='Is taking'){
                m.Active_Books__c = m.Active_Books__c + 1 ;
                MembersToUpdate.add(m);
                
            }else if (Bb2.Status_of_books__c == 'Is giving') {
                m.Active_Books__c = m.Active_Books__c - 1;
                MembersToUpdate.add(m);
            }
        }
        if( !MembersToUpdate.isEmpty())
            Database.update(MembersToUpdate);
        
    }
}I got this error message
 

  "Results": [
    {
      "Result": {
        "IsDB": "True",
        "Spend": 453,
        "Paths": [
          {
            "Technologies": [
              {
                "IsPremium": "no",
                "Name": "SPF",
                "Description": "The Sender Policy Framework is an open standard specifying a technical method to prevent sender address forgery.",
                "Link": "http://www.openspf.org/",
                "Tag": "mx",
                "FirstDetected": 1566774000000,
                "LastDetected": 1629702000000
              }
            ]
          }
        ]
      }
    }
  ]
}
From the app exchange I just installed a package called Lead Converter into my sandbox and received a confirmation email stating my request was successful. I would like to begin testing this app but I'm unable to find it anywhere. Can someone tell me where it could be hiding? On my Installed Packed page I can see it at the very top of the list with the package name and description.
Could you please help me to write a trigger on Cross Object Record deletion.

Assume object A (Opportunity) and B (Contact Roles).
Object B is in related list of A.
Assume that there is a record in object B related to object A's record with name "ABCD".
Whenever a record is created on object B related to object A's record with name other than "ABCD", then the existing object B record named "ABCD" should be deleted.
  • January 01, 2018
  • Like
  • 0

  "Results": [
    {
      "Result": {
        "IsDB": "True",
        "Spend": 453,
        "Paths": [
          {
            "Technologies": [
              {
                "IsPremium": "no",
                "Name": "SPF",
                "Description": "The Sender Policy Framework is an open standard specifying a technical method to prevent sender address forgery.",
                "Link": "http://www.openspf.org/",
                "Tag": "mx",
                "FirstDetected": 1566774000000,
                "LastDetected": 1629702000000
              }
            ]
          }
        ]
      }
    }
  ]
}