• meghanadh G
  • NEWBIE
  • 5 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies
Trigger poppulateFirstNameFromAccount on Contact (before insert, before update)
{
    for(Contact Con: trigger.new)
    {
    if(String.isBlank(contact.FirstName))
        {
        contact.FirstName = contact.Account.Name;
        }
    }
}
HI Everyone,

Can you help me write a handler class and a trigger for the below senario:
When a Contact (Account is null) is created with rating(a custom field - text type), check for existing Account record with Site(ex: www.emaildomain.com) and rating (as contact's rating), and relate that orphan contact with that account record.
I am having trouble completing the following Trailhead: Create a formula field that determines the number of days between the end date of a contract and today. This is the formula that I am using:

EndDate - TODAY() 

I keep getting the following error when I check the syntax:  Error: Formula result is data type (Number), incompatible with expected data type (Date).
Hi All,

I want calculate the "caseage" based on status changed value only for weekdays.

Example: here Caseage means : created case and closed cose 

i have picklist values of Status : In progress, pending and rejcted

Thanks in Advance

Chanti
I'm getting the same error even though I'm using the code provided by other users here. The new field is also created.
 
trigger AccountAddressTrigger on Account (before insert, before update) {
    for(Account a : Trigger.new){
        If (a.Match_Billing_Address__c == true) {
            a.ShippingPostalCode = a.BillingPostalCode;
        }   
    }
}

Is there anything wrong with it? 

Thanks in advance.