• KSorenson
  • NEWBIE
  • 10 Points
  • Member since 2015
  • IT Coordinator
  • Aunt Leah's Place

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 10
    Replies
Hello,

I am trying to write what should be a simple Apex trigger but am having issues figuring out the correct code and syntax.  This is what I have so far - please forgive me, I am an admin, not a developer/coder.

What we are trying to accomplish here, is a trigger that will automatically change the stage of a Recurring Donation (opportunity) that has a pledged date that has come due (due today or overdue). There are a few other criteria involved (can't be a C&P payment type, must be pledged status etc).

I am currently getting the error: "Error: Condition expression must be of type Boolean at line 11 column 17" but I cannot figure out how to correct it.  (the line reads  if (Op.StageName ='Pledged'))

There is likely more wrong with my code, but this is where I am currently stuck. If you can find a better way to accomplish what I am doing, please make a suggestion. 
 
trigger AutoPost on Opportunity (after update) {

date myDate = date.today();

for (Opportunity op: Trigger.new)              //check if record is a monthly donation, record is due/overdue,record is status Pledged, not C&P payment
    {
        if (op.RecordType = '012i0000000Rt6LAAS')
        { 
            if(Op.CloseDate <= myDate)
            {
                if (Op.StageName ='Pledged')
                {
                    if (op.Payment_Method__c != 'Click & Pledge')
         
                    Op.StageName ='Posted';                      // Change the Opportunity.Stage to posted
                    
                }
            } 
        }                                    
    }
}

Thanks to all eyes and fingers in advance.
 
Hello,

First of all, I am just the administrator, not a developer and not a coder. However today I am wearing all the hats.  I am hoping someone would be kind enough to help me with the following. I am not sure of even where to start, except that I should do this by a trigger. However I know nothing of how to actually accomplish this. I am hoping that someone could provide the code necessary as I am not savvy enough to write any of it myself. Being a non-profit, we do not have the budget to enlist a professional for this and the task has fallen to me to handle.

Short story - Due to a third party integration, we found that we needed an email address on the account page. However, with the one-to-one model, we are essentially unable to access the true Account record for an individual.  What I would like to accomplish is this:  a trigger that will copy the email address from our Contact object into our email field on the Account object. This would happen when the field is changed in any way.

I hope that I've provided enough information, but if not I will gladly elaborate where needed. Thanks in advance everyone.
Hello,

I am trying to write what should be a simple Apex trigger but am having issues figuring out the correct code and syntax.  This is what I have so far - please forgive me, I am an admin, not a developer/coder.

What we are trying to accomplish here, is a trigger that will automatically change the stage of a Recurring Donation (opportunity) that has a pledged date that has come due (due today or overdue). There are a few other criteria involved (can't be a C&P payment type, must be pledged status etc).

I am currently getting the error: "Error: Condition expression must be of type Boolean at line 11 column 17" but I cannot figure out how to correct it.  (the line reads  if (Op.StageName ='Pledged'))

There is likely more wrong with my code, but this is where I am currently stuck. If you can find a better way to accomplish what I am doing, please make a suggestion. 
 
trigger AutoPost on Opportunity (after update) {

date myDate = date.today();

for (Opportunity op: Trigger.new)              //check if record is a monthly donation, record is due/overdue,record is status Pledged, not C&P payment
    {
        if (op.RecordType = '012i0000000Rt6LAAS')
        { 
            if(Op.CloseDate <= myDate)
            {
                if (Op.StageName ='Pledged')
                {
                    if (op.Payment_Method__c != 'Click & Pledge')
         
                    Op.StageName ='Posted';                      // Change the Opportunity.Stage to posted
                    
                }
            } 
        }                                    
    }
}

Thanks to all eyes and fingers in advance.
 
Hello,

First of all, I am just the administrator, not a developer and not a coder. However today I am wearing all the hats.  I am hoping someone would be kind enough to help me with the following. I am not sure of even where to start, except that I should do this by a trigger. However I know nothing of how to actually accomplish this. I am hoping that someone could provide the code necessary as I am not savvy enough to write any of it myself. Being a non-profit, we do not have the budget to enlist a professional for this and the task has fallen to me to handle.

Short story - Due to a third party integration, we found that we needed an email address on the account page. However, with the one-to-one model, we are essentially unable to access the true Account record for an individual.  What I would like to accomplish is this:  a trigger that will copy the email address from our Contact object into our email field on the Account object. This would happen when the field is changed in any way.

I hope that I've provided enough information, but if not I will gladly elaborate where needed. Thanks in advance everyone.