• Nicholas Shepard 7
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
I've created an SalesForce Process that automates the creation of Asana projects for my org. This works well in small-scale, however when many data updates happen at once, we receive an error;

```Error Occurred: An Apex error occurred: System.LimitException: AsanaPublic: Too many future calls: 51```

I'm not sure that this can be solved using the process builder alone, so I'm thinking that I'll have to translate the process to an Apex Trigger that implements Queueable, but I'm not sure if this is the correct route. Here is what my process looks like: https://gyazo.com/a367dd0a94a8bfae2466f2dbda6fbccc

Note that "Evaluate the next criteria" is needed there to account for cases where both fields get updated in the same save operation.

Thank you in advance for the help!
Hello! So I'm extremely new to SalesForce and I'm having some problems with accessing fields I need. I'm trying to access certain fields of a custom object to graph them, and given that this object cannot be set as a controller, I'm pretty lost on what to do. Basically, I need to access the fields you see between lines 27 & 60. Below is my current code.

Thank you in advance!

VisualForce Page
<!-- Displays a Contact's account information in SF. --->
<apex:page standardController="Contact" extensions="NewAcctTimelineController, AcctTimelineFinancialController">
  <html>
	<head>
	  <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
      <script type="text/javascript">
		// Required Google Chart Lines.
		google.charts.load("current", {packages:["corechart"]});
		function collectData()
        {    
			// Variable Declaration
			var numAccts, data;
			var accountIds = {!listOfAccountNums};
			// For each account a contact has, collect the specific data for that account
			for(account in accountIds)
            {
            	var i = 0, acctDataSet = [];
                tempAcctId.set(account);
                acctDataSet.push(["Year", "Total"]);
                for(i = 1; i <= 12; i++)
                {
                    monthCount.set(i);
					var dateToGraph = new Date({!YEAR(TODAY())},{!MONTH(TODAY())-monthCount});
                    var moneyToGraph = null;
                    switch(i){
                    	case 1:
                            moneyToGraph = {!tempVal.ACTDDEV__FAPriorMonthTotal__c};
                            break;
                        case 2:
                            moneyToGraph = {!tempVal.ACTDDEV__FA2MonthsAgoTotal__c};
                            break;
                        case 3:
                            moneyToGraph = {!tempVal.ACTDDEV__FA3MonthsAgoTotal__c};
                            break;
                        case 4:
                            moneyToGraph = {!tempVal.ACTDDEV__FA4MonthsAgoTotal__c};
                            break;
                        case 5:
                            moneyToGraph = {!tempVal.ACTDDEV__FA5MonthsAgoTotal__c};
                            break;
                        case 6:
                            moneyToGraph = {!tempVal.ACTDDEV__FA6MonthsAgoTotal__c};
                            break;
                        case 7:
                            moneyToGraph = {!tempVal.ACTDDEV__FA7MonthsAgoTotal__c};
                            break;
                        case 8:
                            moneyToGraph = {!tempVal.ACTDDEV__FA8MonthsAgoTotal__c};
                            break;
                        case 9:
                            moneyToGraph = {!tempVal.ACTDDEV__FA9MonthsAgoTotal__c};
                            break;
                        case 10:
                            moneyToGraph = {!tempVal.ACTDDEV__FA10MonthsAgoTotal__c};
                            break;
                        case 11:
                            moneyToGraph = {!tempVal.ACTDDEV__FA11MonthsAgoTotal__c};
                            break;
                        case 12:
                            moneyToGraph = {!tempVal.ACTDDEV__FA12MonthsAgoTotal__c};
                            break;
                        default:
                            console.log("Error! No Value Found.");
                            break;
                    }
                    acctDataSet.push([dateToGraph, moneyToGraph]);
                }
                var processedData = google.visualization.arrayToDataTable(acctDataSet);
                var options = {
         			title: 'Account Timeline',
           			hAxis: {title: 'Date'},
           			vAxis: {title: 'Value'},
         			legend: 'none',
         			crosshair: { trigger: 'both', orientation: 'both' },
           			pointShape: 'diamond',
           			pointSize: 12,
            	}
                var chart = new google.visualization.AreaChart(document.getElementById('chart_pointSize'));
       			chart.draw(processedData, options);
		}
      </script>
	</head>
	<body>
        <div id='chart_pointSize' style='width: 1200px; height: 500px;'></div>
    </body>
  </html>
</apex:page>
Custom Extension
public with sharing class NewAcctTimelineController {
	
    public Integer monthCount {get;set;}
    public String tempAcctId {get;set;}
    private final Contact contact {get;set;}
    private final String contactId {get;set;}
    public ACTDDEV__EAST_FinancialAccount__c tempVal {get;set;}
    public List<ACTDDEV__EAST_FinancialAccount__c> listOfAccountNums{get;set;}
    
    // Constructor.
    public NewAcctTimelineController(ApexPages.StandardController stdController){
        this.contactId = stdController.getId();
        listOfAccountNums = [SELECT acct.Name FROM ACTDDEV__EAST_FinancialAccount__c acct where acct.ACTDDEV__AccountOwner__c =: this.contactId];
        this.tempVal = (ACTDDEV__EAST_FinancialAccount__c)stdController.getRecord();
    }
}