• Zachary Springer
  • NEWBIE
  • 10 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
I've got a trigger and I want to make sure that once a field has a value, it does not get updated. This seems really close but apex throws an error and won't allow the if check to go through. It says that the == must be for two booleans. I simply want to check if the two string values are equal.

trigger SourceUpdate on Contact (before update) {
    for(Contact con: Trigger.new)
    {
      Contact oldCon = Trigger.oldMap.get(con.Id);
        system.debug(con.Source__c == oldCon.Source__c);
        if(oldCon.Source__c && con.Source__c != oldCon.Source__c) {
            con.Source__c = oldCon.Source__c;
        }
    }
}
 have a very strange error, and frankly I don't have any clue what's causing it. I'm attempting to set up outbound messages for a salesforce account (which send SOAP messages) and I'm running a Ubuntu server through Digital ocean. I've installed and configured Nginx. Now, every message that salesforce attempts to send fails out with a 403 error which points me to the server and Nginx. But when I tail the logs (both regular and access) I don't see any indication that the post is even making it to the server. I have a firewall UFW, but it shouldn't be blocking it from making it to Nginx and shouldn't be sending a 403. And we use cloudflare, but I don't have any inbound rules set up that should be blocking this. The weirdest part is that I can send a postman post request and it works just fine. I see the logs show up and everything. Any ideas here?
I've got a trigger and I want to make sure that once a field has a value, it does not get updated. This seems really close but apex throws an error and won't allow the if check to go through. It says that the == must be for two booleans. I simply want to check if the two string values are equal.

trigger SourceUpdate on Contact (before update) {
    for(Contact con: Trigger.new)
    {
      Contact oldCon = Trigger.oldMap.get(con.Id);
        system.debug(con.Source__c == oldCon.Source__c);
        if(oldCon.Source__c && con.Source__c != oldCon.Source__c) {
            con.Source__c = oldCon.Source__c;
        }
    }
}