• Evan C. Decker
  • NEWBIE
  • 10 Points
  • Member since 2012


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 7
    Replies
Hello, I'm trying to deploy a class to production and I'm receiving the following error:

line 36, column 53: Method does not exist or incorrect signature: void selfRegister(String, String, String, String, String, String, String, String, String, String) from the type Gears_SelfRegisterController 
Stack Trace: null

This is the code that's referring to:
Test.startTest();
error = Gears_SelfRegisterController.selfRegister('', '', 'First', 'Last', 'customer.contact@gearscrm.com', 'GearsCRM', 'Portland', 'Maine', 'United States', 'Customer');
Test.stopTest();

System.assertEquals(null, error);
And the method from the class is:
@AuraEnabled
public static String selfRegister(String regConfirmUrl, String regPendingUrl, String firstName, String lastName, String email, String company, String city, String state, String country, String userType)
{ Savepoint sp = null;
Any idea what's going on here? I've been digging around online but can't find a solution. Thanks!
Hello, we have the following button that creates a new case record automatically, the problem is this doesn't take into account required fields on the case and completely bypasses the requirement:
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 

// Save url 
var url = parent.location.href; 

var bug = new sforce.SObject('Case'); 

bug.RecordTypeId='012U0000000Qqxb'; 
bug.ParentId='{!Case.Id}'; 
bug.Service_Product__c='{!Case.Service_Product__c}'; 
bug.Product_Version__c='{!Case.Product_Version__c}'; 
bug.OwnerId='00GU0000001gEO8'; 
bug.SR__c='{!Case.SR__c}'; 
bug.ES__c='{!Case.ES__c}'; 
bug.Subject='{!Case.Service_Product__c}'+ ' ' + '{!Case.Product_Version__c}' + ' - ' +'Doc Defect' 


var result = sforce.connection.create([bug]); 


// Process result, if success refresh page 
if( result[0].getBoolean("success") ){ 
window.location.href = 'https://calabrio.my.salesforce.com'+'/' + result[0].id; 

} 
else { 
log("Failed to update project: " + result[0]); 
}
Based on other questions asked in the community, I've come up with the following, adding the required fields into if statements, but it still doesn't work:
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 


/*Required fields*/ 
var DocTitle = '{!Case.Book_Title__c}'; 
var SectionTitle = '{!Case.Section_Title__c}'; 
var Description = '{!Case.Description}'; 


/*Field requirements*/ 
if(DocTitle == ''){ 
alert('The Doc Title field is required.') 
} 

ifSectionTitle == ''){ 
alert('The Section Title field is required.'); 
} 

if(Description == ''){ 
alert('The Description field is required.') 
} 


/*Once required fields are filled in*/ 
else{ 
// Save url 
var url = parent.location.href; 

var bug = new sforce.SObject('Case'); 

bug.RecordTypeId='012U0000000Qqxb'; 
bug.ParentId='{!Case.Id}'; 
bug.Service_Product__c='{!Case.Service_Product__c}'; 
bug.Product_Version__c='{!Case.Product_Version__c}'; 
bug.OwnerId='00GU0000001gEO8'; 
bug.SR__c='{!Case.SR__c}'; 
bug.ES__c='{!Case.ES__c}'; 
bug.Subject='{!Case.Service_Product__c}'+ ' ' + '{!Case.Product_Version__c}' + ' - ' +'Doc Defect' 


var result = sforce.connection.create([bug]); 


// Process result, if success refresh page 
if( result[0].getBoolean("success") ){ 
window.location.href = 'https://calabrio.my.salesforce.com'+'/' + result[0].id; 

} 
else { 
log("Failed to update project: " + result[0]); 
} 
}

I receive the error "A problem with the OnClick JavaScript for this button or link was encountered: Unexpected token )" Any ideas? Thanks in advance!

Hello - I have a Visualforce page that's working in the sandbox but not production. There's one field that isn't being saved when the user saves the record, the field is called Date_of_Gift__c. It displays but the value isn't saved. I'm thinking there's an issue with the controller. Here it is:
 
public with sharing class CharitableContributionEditLayoutCont {
    private final Charitable_Contribution__c charity;
    public Charitable_Contribution__c newcharity {get; set;}
    public Charitable_Contribution__c oldcharity {get; set;}   
    public String fromAccount {get; set;}
    public List<SelectOption> fromAccounts {get; set;}
    public Attachment attachment {get; set;} 
    public String cloneValue {get; set;}
    public String toAccount {get; set;}
    public List<SelectOption> toAccounts {get; set;}
    public String fciRecordTypeId {get; set;}
    public String notfciRecordTypeId {get; set;}
    
    public CharitableContributionEditLayoutCont(ApexPages.StandardController sc)
    {
        this.charity = (Charitable_Contribution__c)sc.getRecord();
        attachment = new Attachment();
        cloneValue = ApexPages.currentPage().getParameters().get('clone');
        
        if (String.isBlank(cloneValue) && String.isBlank(charity.Id))
        {
            newcharity = charity;
            newcharity.RecordTypeId = ApexPages.currentPage().getParameters().get('RecordType');
        } else {
            oldcharity = [SELECT Id, Amount__c, RecordTypeId, Additional_Comments_Requirements__c, Additional_Internal_Instructions__c,
                                Client__c, Client_Analyst__c, Client_Specialist__c, New_Unlisted_Organization_Contact_Name__c, To_Account_Client_Lookup__c, 
                                Designation__c, RecordType.Name, Disposition_Method__c, Donor_s_Name_s__c, FC__c, Fidelity_Account__c, To_Account__c,
                                High_Price__c, Low_Price__c, Need_Client_Signature__c, Notes__c, Organization__c, New_Unlisted_Organization_Name__c,
                                Phone__c, Request_Date__c, Status__c, Stock_Ticker_Name_and_CUSIP_Lookup__c, Final_of_Shares__c, Pending_Collateral_Transfer__c, Date_of_Gift__c
                                FROM Charitable_Contribution__c WHERE Id = :charity.Id];
        }
        
        if (String.isNotBlank(cloneValue))
        {
            newcharity = oldcharity.clone(false, true);
            newcharity.Status__c = Constants.CHARITABLE_CONTRIBUTION_STATUS_NEW;
        } else if (String.isNotBlank(charity.Id)) {
            newcharity = oldcharity.clone(true, true);
        }
        
        fciRecordTypeId = Utils.GetRecordTypeIdFromName(new Charitable_Contribution__c(), Constants.CHARITABLE_CONTRIBUTION_RECORDTYPE_FCI_MANAGED);
        notfciRecordTypeId = Utils.GetRecordTypeIdFromName(new Charitable_Contribution__c(), Constants.CHARITABLE_CONTRIBUTION_RECORDTYPE_NOT_FCI_MANAGED);     
        
        if (String.isNotBlank(charity.Id))
        {
            fromAccount = newcharity.Fidelity_Account__c;
            toAccount = newcharity.To_Account__c;
            getFromAccounts();
            getToAccounts();
        }
    }
    
    public PageReference getFromAccounts()
    {
        fromAccounts = new List<SelectOption>();
        List<SelectOption> accounts = new List<SelectOption>();

        for (Bank_Account__c ba : [SELECT Id, Name, Account_Type__c, Account_Number__c  
                                    FROM Bank_Account__c 
                                    WHERE Entity__c = :newcharity.Client__c ORDER BY Account_Number__c])
        {
            accounts.add(new SelectOption(ba.Id, ba.Account_Type__c + ' - ' + ba.Account_Number__c));
        }
        
        if (accounts.size() > 1)
            fromAccounts.add(new SelectOption('', 'Select One'));
            
        fromAccounts.addAll(accounts);
        return null;
    }
    
    public PageReference GetToAccounts()
    {
        toAccounts = new List<SelectOption>();
        List<SelectOption> toaccts = new List<SelectOption>();

        for (Bank_Account__c ba : [SELECT Id, Name, Account_Type__c, Account_Number__c  
                                    FROM Bank_Account__c 
                                    WHERE Entity__c = :newcharity.To_Account_Client_Lookup__c ORDER BY Account_Number__c])
        {
                toaccts.add(new SelectOption(ba.Id, ba.Account_Type__c + ' - ' + ba.Account_Number__c));    
        }
            
        if (toaccts.size() > 1)
            toAccounts.add(new SelectOption('', 'Select One'));
            
        toAccounts.addAll(toaccts);
        return null;    
    }    
    
    public Boolean getIsLocked()
    {
        if (String.isNotBlank(newcharity.Id) && !(String.isBlank(newcharity.Status__c) 
            || newcharity.Status__c == Constants.CHARITABLE_CONTRIBUTION_STATUS_NEW))
        {
            return true;
        }
        return false;
    }
    
    public String getFinalValuationUserId()
    {
        String userName = FCICommunitySettings__c.getInstance().FinalValuationUserName__c;

        if(Test.isRunningTest())
                userName = 'DeDe Connors';

        return [SELECT Id FROM User WHERE Name = :userName AND IsActive = true LIMIT 1].Id;
    }
    
    public Boolean getCharitableContributionUser()
    {
        Group groupId = [SELECT Id, (SELECT UserOrGroupId FROM GroupMembers) FROM Group WHERE DeveloperName = 'Charitable_Contribution_Users' AND Type = 'Queue'];
        
        for (GroupMember g : groupId.GroupMembers)
        {
            if (g.UserOrGroupId == UserInfo.getUserId())
            {
                return true;
            }
        }
        return false;
    }
    
    public PageReference save()
    {
        if (newcharity.Status__c == Constants.CHARITABLE_CONTRIBUTION_STATUS_FINAL_VALUATION && UserInfo.getUserId() == getFinalValuationUserId())
        {
            SaveHighLowShares s = new SaveHighLowShares();
            s.SaveHighLow(newcharity.Id, newcharity.High_Price__c, newcharity.Low_Price__c, newcharity.Final_of_Shares__c);
            return new PageReference('/' + newcharity.Id);
        }
        
        if (newcharity.Status__c == Constants.CHARITABLE_CONTRIBUTION_STATUS_DRAFT_VALUATION && getCharitableContributionUser())
        {
            SaveHighLowShares s = new SaveHighLowShares();
            s.SaveShares(newcharity.Id, newcharity.Final_of_Shares__c);
            return new PageReference('/' + newcharity.Id);
        }
        
        if (String.isBlank(fromAccount))
        {
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'The From Account is a required field.'));
        } else {
            newcharity.Fidelity_Account__c = fromAccount;
            newcharity.To_Account__c = toAccount;
            upsert newcharity;
            
            if (attachment.body != null)
            {
                attachment.ParentId = newcharity.Id;
                insert attachment;
            }
                
            if (String.isNotBlank(cloneValue))
            {   
                List<Attachment> attachmentsInsert = new List<Attachment>();
                List<Note> notesInsert = new List<Note>();
                
                for (Attachment a : [SELECT Name, Body FROM Attachment WHERE ParentId = :charity.Id])
                {
                    Attachment att = new Attachment(
                        Name = a.Name,
                        Body = a.Body,
                        ParentId = newcharity.Id
                    );
                    attachmentsInsert.add(att);
                }
                
                for (Note n : [SELECT Title, Body FROM Note WHERE ParentId = :charity.Id])
                {
                    Note nt = new Note(
                        Title = n.Title,
                        Body = n.Body,
                        ParentId = newcharity.Id
                    );
                    notesInsert.add(nt);
                }
                
                if (attachmentsInsert.size() > 0)
                    insert attachmentsInsert;  
                    
                if (notesInsert.size() > 0)
                    insert notesInsert;             
            }   
                
            return new PageReference('/' + newcharity.Id);
        }       
        return null;
    } 
    
    public without sharing class SaveHighLowShares {
        public void SaveHighLow(Id id, Decimal high, Decimal low, Decimal shares)
        {
            Charitable_Contribution__c c = new Charitable_Contribution__c(
                Id = id,
                High_Price__c = high,
                Low_Price__c = low,
                Final_of_Shares__c = shares
            );
            update c;
        }
        
        public void SaveShares(Id id, Decimal shares)
        {
            Charitable_Contribution__c c = new Charitable_Contribution__c(
                Id = id,
                Final_of_Shares__c = shares
            );
            update c;           
        }
    }           
}

Specifically I think the issue is on line 130, this one:
 
s.SaveHighLow(newcharity.Id, newcharity.High_Price__c, newcharity.Low_Price__c, newcharity.Final_of_Shares__c);

That line references the other fields that are visible on the Visualforce page, but when I try to add the new field (Date_of_Gift__c) it gives me the following error:

Error: Compile Error: Method does not exist or incorrect signature: [CharitableContributionEditLayoutCont.SaveHighLowShares].SaveHighLow(Id, Decimal, Decimal, Decimal, Date) at line 130 column 13

I'm not sure what I'm doing wrong. Anyone have any ideas? Thank you in advance!
Hello - we have a VisualForce page and controller that are identical in our production org and full sandbox, but are functioning differently. The page displays a list of records and has a few picklists at the top that allow you to filter and sort the records. In the sandbox the sort is working, but in production it's not. Is there a setting somewhere that may be different between the two environments and causing this issue? Thank you in advance.

User-added image
Hi everyone, I have a question about two apex triggers in our org. The first works as expected. Here's the code:

trigger LinkToInstallation on Plan_Design_Detail__c (before insert, before update) {
  
    set<ID> salesSummaryIds = new set<ID>();
    Map<Id, Id> SCInsMap = new Map<Id, Id>();
  
    for(Plan_Design_Detail__c pdd: trigger.new){
        if(pdd.Sales_Summary__c!= null){
            salesSummaryIds.add(pdd.Sales_Summary__c);
        } 
    }
    if(!salesSummaryIds.isEmpty()){
        // prepare Inst - SC Map
        for(Installation__c ins: [select Id, Sales_Summary__c
                                          from Installation__c
                                          where Sales_Summary__c  IN :salesSummaryIds]){
            SCInsMap.put(ins.Sales_Summary__c, ins.Id);
        }
        for(Plan_Design_Detail__c pdd: trigger.new){
            pdd.Installation__c = SCInsMap.get(pdd.Sales_Summary__c);
        } 
    }
                                                      
}

This trigger involves three objects - Sale Confirmations (api name is Sales_Summary__c), Plan Design Details, and Installation. A Sale Confirmation is always created first, then a Plan Design Detail record, then an Installation record. Plan Design Details and Installations are both related to Sale Confirmations. The action this trigger does is link the Installation to the Plan Design Detail record based on the related Sale Confirmation. Once the Installation record is created the Plan Design Detail can be refreshed and the Installation record will be linked.

The second does not work as expected. I recreated the above, except it's for a new object called CBA. I need it to function in the same way. Here's the code:

trigger LinkToInstallation2 on CBA__c (before insert, before update) {
  
    set<ID> salesSummaryIds = new set<ID>();
    Map<Id, Id> SCInsMap = new Map<Id, Id>();
  
    for(CBA__c cba: trigger.new){
        if(cba.Sale_Confirmation__c!= null){
            salesSummaryIds.add(cba.Sale_Confirmation__c);
        } 
    }
    if(!salesSummaryIds.isEmpty()){
        // prepare Inst - SC Map
        for(Installation__c ins: [select Id, Sales_Summary__c
                                          from Installation__c
                                          where Sales_Summary__c  IN :salesSummaryIds]){
            SCInsMap.put(ins.Sales_Summary__c, ins.Id);
        }
        for(CBA__c cba: trigger.new){
            cba.Installation__c = SCInsMap.get(cba.Sale_Confirmation__c);
        } 
    }
                                                      
}

When I refresh the CBA record after creating the Installation the link is not there. However, if I edit and save the CBA record the link is made. I thought I could replace all the appropriate fields in the trigger and it would function the same but I'm finding that isn't the case. Does anyone have any ideas? Thank you very much!

Here is what I am trying to do:

 

Starting on an opportunity, when someone clicks the New Task button under the Open Activities section, I want to pull in a value from a field on the opportunity to the Assigned To field on the new task for a particular record type. Does anyone know if this is possible?

 

Let me know if further information is needed. Thanks!

Here is what I am trying to do:

 

Starting on an opportunity, when someone clicks the New Task button under the Open Activities section, I want to pull in a value from a field on the opportunity to the Assigned To field on the new task for a particular record type. Does anyone know if this is possible?

 

Let me know if further information is needed. Thanks!

Hello, I'm trying to deploy a class to production and I'm receiving the following error:

line 36, column 53: Method does not exist or incorrect signature: void selfRegister(String, String, String, String, String, String, String, String, String, String) from the type Gears_SelfRegisterController 
Stack Trace: null

This is the code that's referring to:
Test.startTest();
error = Gears_SelfRegisterController.selfRegister('', '', 'First', 'Last', 'customer.contact@gearscrm.com', 'GearsCRM', 'Portland', 'Maine', 'United States', 'Customer');
Test.stopTest();

System.assertEquals(null, error);
And the method from the class is:
@AuraEnabled
public static String selfRegister(String regConfirmUrl, String regPendingUrl, String firstName, String lastName, String email, String company, String city, String state, String country, String userType)
{ Savepoint sp = null;
Any idea what's going on here? I've been digging around online but can't find a solution. Thanks!
Hello - I have a Visualforce page that's working in the sandbox but not production. There's one field that isn't being saved when the user saves the record, the field is called Date_of_Gift__c. It displays but the value isn't saved. I'm thinking there's an issue with the controller. Here it is:
 
public with sharing class CharitableContributionEditLayoutCont {
    private final Charitable_Contribution__c charity;
    public Charitable_Contribution__c newcharity {get; set;}
    public Charitable_Contribution__c oldcharity {get; set;}   
    public String fromAccount {get; set;}
    public List<SelectOption> fromAccounts {get; set;}
    public Attachment attachment {get; set;} 
    public String cloneValue {get; set;}
    public String toAccount {get; set;}
    public List<SelectOption> toAccounts {get; set;}
    public String fciRecordTypeId {get; set;}
    public String notfciRecordTypeId {get; set;}
    
    public CharitableContributionEditLayoutCont(ApexPages.StandardController sc)
    {
        this.charity = (Charitable_Contribution__c)sc.getRecord();
        attachment = new Attachment();
        cloneValue = ApexPages.currentPage().getParameters().get('clone');
        
        if (String.isBlank(cloneValue) && String.isBlank(charity.Id))
        {
            newcharity = charity;
            newcharity.RecordTypeId = ApexPages.currentPage().getParameters().get('RecordType');
        } else {
            oldcharity = [SELECT Id, Amount__c, RecordTypeId, Additional_Comments_Requirements__c, Additional_Internal_Instructions__c,
                                Client__c, Client_Analyst__c, Client_Specialist__c, New_Unlisted_Organization_Contact_Name__c, To_Account_Client_Lookup__c, 
                                Designation__c, RecordType.Name, Disposition_Method__c, Donor_s_Name_s__c, FC__c, Fidelity_Account__c, To_Account__c,
                                High_Price__c, Low_Price__c, Need_Client_Signature__c, Notes__c, Organization__c, New_Unlisted_Organization_Name__c,
                                Phone__c, Request_Date__c, Status__c, Stock_Ticker_Name_and_CUSIP_Lookup__c, Final_of_Shares__c, Pending_Collateral_Transfer__c, Date_of_Gift__c
                                FROM Charitable_Contribution__c WHERE Id = :charity.Id];
        }
        
        if (String.isNotBlank(cloneValue))
        {
            newcharity = oldcharity.clone(false, true);
            newcharity.Status__c = Constants.CHARITABLE_CONTRIBUTION_STATUS_NEW;
        } else if (String.isNotBlank(charity.Id)) {
            newcharity = oldcharity.clone(true, true);
        }
        
        fciRecordTypeId = Utils.GetRecordTypeIdFromName(new Charitable_Contribution__c(), Constants.CHARITABLE_CONTRIBUTION_RECORDTYPE_FCI_MANAGED);
        notfciRecordTypeId = Utils.GetRecordTypeIdFromName(new Charitable_Contribution__c(), Constants.CHARITABLE_CONTRIBUTION_RECORDTYPE_NOT_FCI_MANAGED);     
        
        if (String.isNotBlank(charity.Id))
        {
            fromAccount = newcharity.Fidelity_Account__c;
            toAccount = newcharity.To_Account__c;
            getFromAccounts();
            getToAccounts();
        }
    }
    
    public PageReference getFromAccounts()
    {
        fromAccounts = new List<SelectOption>();
        List<SelectOption> accounts = new List<SelectOption>();

        for (Bank_Account__c ba : [SELECT Id, Name, Account_Type__c, Account_Number__c  
                                    FROM Bank_Account__c 
                                    WHERE Entity__c = :newcharity.Client__c ORDER BY Account_Number__c])
        {
            accounts.add(new SelectOption(ba.Id, ba.Account_Type__c + ' - ' + ba.Account_Number__c));
        }
        
        if (accounts.size() > 1)
            fromAccounts.add(new SelectOption('', 'Select One'));
            
        fromAccounts.addAll(accounts);
        return null;
    }
    
    public PageReference GetToAccounts()
    {
        toAccounts = new List<SelectOption>();
        List<SelectOption> toaccts = new List<SelectOption>();

        for (Bank_Account__c ba : [SELECT Id, Name, Account_Type__c, Account_Number__c  
                                    FROM Bank_Account__c 
                                    WHERE Entity__c = :newcharity.To_Account_Client_Lookup__c ORDER BY Account_Number__c])
        {
                toaccts.add(new SelectOption(ba.Id, ba.Account_Type__c + ' - ' + ba.Account_Number__c));    
        }
            
        if (toaccts.size() > 1)
            toAccounts.add(new SelectOption('', 'Select One'));
            
        toAccounts.addAll(toaccts);
        return null;    
    }    
    
    public Boolean getIsLocked()
    {
        if (String.isNotBlank(newcharity.Id) && !(String.isBlank(newcharity.Status__c) 
            || newcharity.Status__c == Constants.CHARITABLE_CONTRIBUTION_STATUS_NEW))
        {
            return true;
        }
        return false;
    }
    
    public String getFinalValuationUserId()
    {
        String userName = FCICommunitySettings__c.getInstance().FinalValuationUserName__c;

        if(Test.isRunningTest())
                userName = 'DeDe Connors';

        return [SELECT Id FROM User WHERE Name = :userName AND IsActive = true LIMIT 1].Id;
    }
    
    public Boolean getCharitableContributionUser()
    {
        Group groupId = [SELECT Id, (SELECT UserOrGroupId FROM GroupMembers) FROM Group WHERE DeveloperName = 'Charitable_Contribution_Users' AND Type = 'Queue'];
        
        for (GroupMember g : groupId.GroupMembers)
        {
            if (g.UserOrGroupId == UserInfo.getUserId())
            {
                return true;
            }
        }
        return false;
    }
    
    public PageReference save()
    {
        if (newcharity.Status__c == Constants.CHARITABLE_CONTRIBUTION_STATUS_FINAL_VALUATION && UserInfo.getUserId() == getFinalValuationUserId())
        {
            SaveHighLowShares s = new SaveHighLowShares();
            s.SaveHighLow(newcharity.Id, newcharity.High_Price__c, newcharity.Low_Price__c, newcharity.Final_of_Shares__c);
            return new PageReference('/' + newcharity.Id);
        }
        
        if (newcharity.Status__c == Constants.CHARITABLE_CONTRIBUTION_STATUS_DRAFT_VALUATION && getCharitableContributionUser())
        {
            SaveHighLowShares s = new SaveHighLowShares();
            s.SaveShares(newcharity.Id, newcharity.Final_of_Shares__c);
            return new PageReference('/' + newcharity.Id);
        }
        
        if (String.isBlank(fromAccount))
        {
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'The From Account is a required field.'));
        } else {
            newcharity.Fidelity_Account__c = fromAccount;
            newcharity.To_Account__c = toAccount;
            upsert newcharity;
            
            if (attachment.body != null)
            {
                attachment.ParentId = newcharity.Id;
                insert attachment;
            }
                
            if (String.isNotBlank(cloneValue))
            {   
                List<Attachment> attachmentsInsert = new List<Attachment>();
                List<Note> notesInsert = new List<Note>();
                
                for (Attachment a : [SELECT Name, Body FROM Attachment WHERE ParentId = :charity.Id])
                {
                    Attachment att = new Attachment(
                        Name = a.Name,
                        Body = a.Body,
                        ParentId = newcharity.Id
                    );
                    attachmentsInsert.add(att);
                }
                
                for (Note n : [SELECT Title, Body FROM Note WHERE ParentId = :charity.Id])
                {
                    Note nt = new Note(
                        Title = n.Title,
                        Body = n.Body,
                        ParentId = newcharity.Id
                    );
                    notesInsert.add(nt);
                }
                
                if (attachmentsInsert.size() > 0)
                    insert attachmentsInsert;  
                    
                if (notesInsert.size() > 0)
                    insert notesInsert;             
            }   
                
            return new PageReference('/' + newcharity.Id);
        }       
        return null;
    } 
    
    public without sharing class SaveHighLowShares {
        public void SaveHighLow(Id id, Decimal high, Decimal low, Decimal shares)
        {
            Charitable_Contribution__c c = new Charitable_Contribution__c(
                Id = id,
                High_Price__c = high,
                Low_Price__c = low,
                Final_of_Shares__c = shares
            );
            update c;
        }
        
        public void SaveShares(Id id, Decimal shares)
        {
            Charitable_Contribution__c c = new Charitable_Contribution__c(
                Id = id,
                Final_of_Shares__c = shares
            );
            update c;           
        }
    }           
}

Specifically I think the issue is on line 130, this one:
 
s.SaveHighLow(newcharity.Id, newcharity.High_Price__c, newcharity.Low_Price__c, newcharity.Final_of_Shares__c);

That line references the other fields that are visible on the Visualforce page, but when I try to add the new field (Date_of_Gift__c) it gives me the following error:

Error: Compile Error: Method does not exist or incorrect signature: [CharitableContributionEditLayoutCont.SaveHighLowShares].SaveHighLow(Id, Decimal, Decimal, Decimal, Date) at line 130 column 13

I'm not sure what I'm doing wrong. Anyone have any ideas? Thank you in advance!
Hello - we have a VisualForce page and controller that are identical in our production org and full sandbox, but are functioning differently. The page displays a list of records and has a few picklists at the top that allow you to filter and sort the records. In the sandbox the sort is working, but in production it's not. Is there a setting somewhere that may be different between the two environments and causing this issue? Thank you in advance.

User-added image
I was wondering how to share badges on linkedin that I've already earned. I know when I complete a module, I am prompted to share future badges but is there no way to share ones I have to date? I had not synced up my linkedin account to trailhead and now wish to display the badges. I would prefer not to just share a URL of my profile. 

Thanks
Hi everyone, I have a question about two apex triggers in our org. The first works as expected. Here's the code:

trigger LinkToInstallation on Plan_Design_Detail__c (before insert, before update) {
  
    set<ID> salesSummaryIds = new set<ID>();
    Map<Id, Id> SCInsMap = new Map<Id, Id>();
  
    for(Plan_Design_Detail__c pdd: trigger.new){
        if(pdd.Sales_Summary__c!= null){
            salesSummaryIds.add(pdd.Sales_Summary__c);
        } 
    }
    if(!salesSummaryIds.isEmpty()){
        // prepare Inst - SC Map
        for(Installation__c ins: [select Id, Sales_Summary__c
                                          from Installation__c
                                          where Sales_Summary__c  IN :salesSummaryIds]){
            SCInsMap.put(ins.Sales_Summary__c, ins.Id);
        }
        for(Plan_Design_Detail__c pdd: trigger.new){
            pdd.Installation__c = SCInsMap.get(pdd.Sales_Summary__c);
        } 
    }
                                                      
}

This trigger involves three objects - Sale Confirmations (api name is Sales_Summary__c), Plan Design Details, and Installation. A Sale Confirmation is always created first, then a Plan Design Detail record, then an Installation record. Plan Design Details and Installations are both related to Sale Confirmations. The action this trigger does is link the Installation to the Plan Design Detail record based on the related Sale Confirmation. Once the Installation record is created the Plan Design Detail can be refreshed and the Installation record will be linked.

The second does not work as expected. I recreated the above, except it's for a new object called CBA. I need it to function in the same way. Here's the code:

trigger LinkToInstallation2 on CBA__c (before insert, before update) {
  
    set<ID> salesSummaryIds = new set<ID>();
    Map<Id, Id> SCInsMap = new Map<Id, Id>();
  
    for(CBA__c cba: trigger.new){
        if(cba.Sale_Confirmation__c!= null){
            salesSummaryIds.add(cba.Sale_Confirmation__c);
        } 
    }
    if(!salesSummaryIds.isEmpty()){
        // prepare Inst - SC Map
        for(Installation__c ins: [select Id, Sales_Summary__c
                                          from Installation__c
                                          where Sales_Summary__c  IN :salesSummaryIds]){
            SCInsMap.put(ins.Sales_Summary__c, ins.Id);
        }
        for(CBA__c cba: trigger.new){
            cba.Installation__c = SCInsMap.get(cba.Sale_Confirmation__c);
        } 
    }
                                                      
}

When I refresh the CBA record after creating the Installation the link is not there. However, if I edit and save the CBA record the link is made. I thought I could replace all the appropriate fields in the trigger and it would function the same but I'm finding that isn't the case. Does anyone have any ideas? Thank you very much!

Here is what I am trying to do:

 

Starting on an opportunity, when someone clicks the New Task button under the Open Activities section, I want to pull in a value from a field on the opportunity to the Assigned To field on the new task for a particular record type. Does anyone know if this is possible?

 

Let me know if further information is needed. Thanks!

Here is what I am trying to do:

 

Starting on an opportunity, when someone clicks the New Task button under the Open Activities section, I want to pull in a value from a field on the opportunity to the Assigned To field on the new task for a particular record type. Does anyone know if this is possible?

 

Let me know if further information is needed. Thanks!