• Bryan Paldino
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies
Hi Everyone,
I'm new to Apex coding and can't seem to wrap my brain around how to create an Apex class to test a trigger I have developed.  I was wondering if anyone can help me.

trigger CreateRenEnrollmentrecord on Case (before update) {
    List<Enrollment__c> enrollments = new List<Enrollment__c>();

    //For each enrollment processed by the trigger, add a new  
    for (Case newEnrollment: Trigger.New) {
        if ((newEnrollment.Proactive_Renewal_override__c == 'Yes' & newEnrollment.Renewal_Enrollment_built__c <> 'Yes') || (newEnrollment.Begin_Reenroll_workflow__c== 'Yes' & newEnrollment.Renewal_Enrollment_built__c <> 'Yes')) {
            newEnrollment.Renewal_Enrollment_built__c = 'Yes';
            enrollments.add(new Enrollment__c(
                        Name = 'Renewal',
                        Case__c = newEnrollment.Id,
                        Type_2__c = 'Renewal',
                        Product__c= newEnrollment.Product__c,
                        Start_Date__c = newEnrollment.Next_Enrollment_Date__c,
                        Account_Manager_2__c = newEnrollment.Account_Manager__c,
                        Status__c = 'Re-enrollment Communication'));
        }
    }
    insert enrollments;
}

Thanks
Hi Everyone,
I am trying to create my own custom Accept button.  Must of the JavaScript code is working, but I can not figure out how  to identify what record is selected in the Queue.   Has anyone done this?

Here's the code that I have so far.
 {!REQUIRESCRIPT("/soap/ajax/31.0/connection.js")}

try{


    var changeRequestToUpdate = new sforce.SObject("Underwriting__c");

    changeRequestToUpdate.Id = "{!Underwriting__c.Id}";
    changeRequestToUpdate.OwnerId = "{!$User.Id}";
    changeRequestToUpdate.Status__c = "In Progress";

    var result = sforce.connection.update([changeRequestToUpdate]);

    if(result[0].success == "true"){
        location.reload();
    }
    else{
        alert(
            "An Error has Occurred. Error: " + 
            result[0].errors.message
        );
    }
}
catch(e){
    alert(
        "An Error has Occurred. Error: " + 
        e
    );
}

Thanks
Hi,
I am tring to update a custom field on the opportunity object using a custom button.  I was able to create the button but I get an "Unexpected Identifier" error whenever the button is pressed.   I'm new to writing to JavaScipt code, so I'm having some trouble troubleshooting the error.


{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}

Var Opp = new sforce.SObject("Opportunity")
Opp.Id = '{!Opportunity.Id}'
Opp.Submit_to_UW__c = 'Yes'

var results = sforce.connection.update([Opp])
window.location.reload()


Hi Everyone,
My company has successfully integrated SFDC and Silverpop, but we have recently encountered an issue with the SFDC credentials that Silverpop uses.  The original user is no longer with the company and we now need to update the SFDC credential information in the CRM settings in Silverpop.   Is there a way to avoid having to do this in the future every time an employee leaves? 
 
Hi,
I am tring to update a custom field on the opportunity object using a custom button.  I was able to create the button but I get an "Unexpected Identifier" error whenever the button is pressed.   I'm new to writing to JavaScipt code, so I'm having some trouble troubleshooting the error.


{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}

Var Opp = new sforce.SObject("Opportunity")
Opp.Id = '{!Opportunity.Id}'
Opp.Submit_to_UW__c = 'Yes'

var results = sforce.connection.update([Opp])
window.location.reload()