• JasonGonzales
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
Hi - very new to writing Apex and I'm stumped on this requirement: display an message when user clicks on the New Opportunity button in the Contact record if the Account where it belongs has the Prohibited field set to "Embargoed Country". Below is what I've written so far:
 
trigger ProhibitedOpp1 on Opportunity (before insert) {
    Map<Id,Opportunity> opps = new Map<Id,Opportunity>([Select Id,Account.Prohibited__c From Opportunity Where Id in : Trigger.new]);
    for (Opportunity opp: trigger.new)
    { if (opp.account.Prohibited__c=='Embargoed Country') {
        opp.adderror('You cannot create an Opportunity from an Account located in a restricted or embargoed country');
    }
   
    }
}

Can somebody please tell me what I need to change/update in my code? Thanks in advance! :)
Hello,

I'm building a VF email template and ran across a problem. The RecipientType is a Contact and RelatedTo is Opportunity. However, I would like to pull the name of the Billing Contact (a lookup) in the Opportunity but I keep on getting an error when I replace merge field for the email greeting. I tried {!RelatedToType.Billing_Contact_FirstName} but got an error: Unknown: String.Billing_Contact_FirstName. How can I pull that field into the email template? Any idea is definitely appreciated! :)
Hi - very new to writing Apex and I'm stumped on this requirement: display an message when user clicks on the New Opportunity button in the Contact record if the Account where it belongs has the Prohibited field set to "Embargoed Country". Below is what I've written so far:
 
trigger ProhibitedOpp1 on Opportunity (before insert) {
    Map<Id,Opportunity> opps = new Map<Id,Opportunity>([Select Id,Account.Prohibited__c From Opportunity Where Id in : Trigger.new]);
    for (Opportunity opp: trigger.new)
    { if (opp.account.Prohibited__c=='Embargoed Country') {
        opp.adderror('You cannot create an Opportunity from an Account located in a restricted or embargoed country');
    }
   
    }
}

Can somebody please tell me what I need to change/update in my code? Thanks in advance! :)
Hello,

I'm building a VF email template and ran across a problem. The RecipientType is a Contact and RelatedTo is Opportunity. However, I would like to pull the name of the Billing Contact (a lookup) in the Opportunity but I keep on getting an error when I replace merge field for the email greeting. I tried {!RelatedToType.Billing_Contact_FirstName} but got an error: Unknown: String.Billing_Contact_FirstName. How can I pull that field into the email template? Any idea is definitely appreciated! :)

Hi All,

 

While Sending an email to the salesforce.We got the following error.Does anybody has any idea what could cause the below given error.

 

This message was created automatically by the mail system.

A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:

>>> emailtosalesforce@jdm6g0a8jnln9wgahzdjsbwj.8dea8eae.c.le.salesforce.
>>> com (Undelivered): 551 Failed due to: SenderAuthorization