• fdacruz
  • NEWBIE
  • 15 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 7
    Replies
Seems like I'm not being able to pass a sObject list to my server-side controller.

I've seen articles and other forum answers that propose using JSON.stringify. I've tried that method, but my server-side controller throws an error stating: "null input to JSON parser". System.debug() shows a 'null' value for the input String parameter. Not sure what's going on.
If I try passing the sObject, I also get a null value, but no error. I have verified that the argument I'm passing from the server-side is not null via console.log().

For the stringify method, I'm changing the action2.setParam() to:
var action2 = component.get('c.relatedOpportunities');
action2.setParam({
    openOppsString: JSON.stringify(oppList)
});
Please note that I'm making two server calls for init.

Client-side Controller
({
doInit : function(component, event, helper) {

    var action = component.get('c.getOpenRenewals');
    action.setParams({
        accountId: component.get("v.recordId")
    })

    // the oppList variable below is to store the list of open renewals to pass on to the second server call
    var oppList = [];
    action.setCallback(this, function(actionResult) {
        component.set('v.openRenewals', actionResult.getReturnValue());
        oppList = actionResult.getReturnValue();

        // debugging
        console.log('>>> Log 1.0: ' + JSON.stringify(actionResult.getReturnValue()));
        console.log('>>> Log 1.1: ' + actionResult.getReturnValue());
        console.log('>>> Log 1.2: ' + JSON.stringify(oppList));
        console.log('>>> Log 1.3: ' + oppList);

        var action2 = component.get('c.relatedOpportunities');
        action2.setParam({  
            openOpps: oppList
        });

        action2.setCallback(this, function(actionResult) {
            component.set('v.associatedOpps', actionResult.getReturnValue());
            console.log('>>> Log 2: ' + JSON.stringify(actionResult.getReturnValue()));
        });

        $A.enqueueAction(action2);

    });

    $A.enqueueAction(action);
}
})
CLIENT LOGS
>>> Log 1.0: [{"Id":"0060x0000061FU0AAM","AccountId":"0014100000gZs1IAAS","Name":"Open Renewal - Test","StageName":"SBR 2 / Renewal Quote","Amount":1234,"CloseDate":"2018-08-03","OwnerId":"00541000001TeSwAAK","RecordTypeId":"012410000019XbpAAE","Owner":{"Name":"fdacruz","Id":"00541000001TeSwAAK"}}]

>>> Log 1.1: [object Object]

>>> Log 1.2: [{"Id":"0060x0000061FU0AAM","AccountId":"0014100000gZs1IAAS","Name":"Open Renewal - Test","StageName":"SBR 2 / Renewal Quote","Amount":1234,"CloseDate":"2018-08-03","OwnerId":"00541000001TeSwAAK","RecordTypeId":"012410000019XbpAAE","Owner":{"Name":"fdacruz","Id":"00541000001TeSwAAK"}}]

>>> Log 1.3: [object Object]

>>> Log 2: {}
Server-Side Controller (Snippet) 1
@auraEnabled     
public static Map<Id, List<Opportunity>> relatedOpportunities(List<Opportunity> openOpps) {

        system.debug(openOpps.size());
        system.debug(openOpps);
SERVER DEBUG LOGS 1
[43]|DEBUG|0
[44]|DEBUG|()
Server-Side Controller (Snippet) 2
(with this method, I am changing the input parameter in the client-side as well from 'openOpps' to 'openOppsString')
@auraEnabled
public static Map<Id, List<Opportunity>> relatedOpportunities(String openOppsString) {

    system.debug(openOppsString);
    List<Opportunity> openOpps;
    openOpps = (List<Opportunity>)System.JSON.deserializeStrict(openOppsString, List<Opportunity>.class);
    */

    system.debug(openOpps.size());
    system.debug(openOpps);
SERVER DEBUG LOGS 2
[37]|DEBUG|null
Hi all,

I'm looking to customize/override the New object page for various objects in order to remove the clutter - especially the main objects: Accounts, Leads, Contacts, and Opportunities.

What is the best to do this? It seems that Visualforce is the only way. Would there be any other alternatives if that's the case?
Hi everyone,

I'm creating a visualforce page to help the opp closing process and am making some of the fields required to ensure that proper process is followed. My page works as follows:
- only shows a few fields at first
- shows specifc fields with an "onchange" event depending on the Opp Stage selected

The issue that I'm running into at the moment is that if I select an option in the dropdown and then select another one, the field requirement rules are enforced. I'm looking to only have the rules enforced when the "Save" button is pressed.

Hopefully this is not too much code...below is the page and controller extension. Thank you in advance for the help!!
 
<apex:page standardController="Opportunity" extensions="closeOppExtension" sidebar="false" docType="html-5.0">
    
    <apex:messages />
    
    <apex:form >
        <apex:pageBlock title="Close Opportunity">
            
            <p/>
            <b> Please confirm that all of the information on this screen is accurate in order to close the opportunity. </b>

            
            <apex:pageBlockSection columns="1" >
                
                <apex:inputField value="{! Opportunity.Name }" required="true" />
                <apex:inputField value="{! Opportunity.CloseDate }" required="true" />
                <apex:inputField value="{! Opportunity.Type }" required="true" />
                
                
                <apex:selectList id="chooseStage" value="{! selectedValue }" size="1" required="true" label="Stage" >
                    <apex:selectOption itemValue="" itemLabel="Please select closed stage..." /> 
                    <apex:selectOption itemValue="Deal Won" itemLabel="Deal Won" />
                    <apex:selectOption itemValue="Deal Lost" itemLabel="Deal Lost" />
                    <apex:selectOption itemValue="Disqualified" itemLabel="Disqualified" />
                    <apex:actionSupport event="onchange" action="{! showSection }" />
                </apex:selectList>
                
            </apex:pageBlockSection>
            
            <apex:pageBlockSection rendered="{! renderWon }" columns="1" >
            
                <apex:inputField value="{! Opportunity.Amount }" required="true"/>
                <apex:inputField value="{! Opportunity.ARR_Amount__c }" required="true" />
                <apex:inputField value="{! Opportunity.Subscription_Start_Date__c }" required="true" />
                <apex:inputField value="{! Opportunity.Subscription_End_Date__c }" required="true" />
                <apex:inputText value="{! Renewal_Start }" label="Renewal License Start Date" onclick="DatePicker.pickDate(false, this, false);" onfocus="DatePicker.pickDate(false, this, false);" required="true"/>
                <apex:inputText value="{! Renewal_End }" label="Renewal License End Date"  onclick="DatePicker.pickDate(false, this, false);" onfocus="DatePicker.pickDate(false, this, false);" required="true"/>
                <apex:inputText value="{! Renewal_Name }" label="Renewal Opportunity Name"  required="true" />
                <apex:inputField value="{! Opportunity.Number_of_Devices__c }" required="true" />
                <apex:inputField value="{! Opportunity.Opportunity_Channel__c }" required="true" />
                <apex:inputField value="{! Opportunity.Product_Interest__c }" required="true" />
                
            </apex:pageBlockSection>
            
            <apex:pageBlockSection rendered="{! renderLost }" columns="1" >
            
                <apex:inputField value="{! Opportunity.Amount }" required="true" />
                <apex:inputField value="{! Opportunity.ARR_Amount__c }" />
                <apex:inputField value="{! Opportunity.DQ_Loss_Reason__c }" required="true" />
                <apex:inputField value="{! Opportunity.Number_of_Devices__c }" />
                <apex:inputField value="{! Opportunity.Opportunity_Channel__c }" required="true" />
                <apex:inputField value="{! Opportunity.Product_Interest__c }" required="true" />
                
            </apex:pageBlockSection>
            
            <apex:pageBlockSection rendered="{! renderDQ }" columns="1" >
            
                <apex:inputField value="{! Opportunity.Amount }" />
                <apex:inputField value="{! Opportunity.ARR_Amount__c }" />
                <apex:inputField value="{! Opportunity.Number_of_Devices__c }" />
                <apex:inputField value="{! Opportunity.Opportunity_Channel__c }" />
                <apex:inputField value="{! Opportunity.Product_Interest__c }" />
                
            </apex:pageBlockSection>
            
            
            <apex:pageBlockButtons >
                <apex:commandButton action="{! save }" value="Save" />
            </apex:pageBlockButtons>
            
        </apex:pageBlock>
                
    </apex:form>
    
</apex:page>
 
public with sharing class closeOppExtension {
    
    // get ID from URL
    // public void ApexPages.currentPage().getParameters().get('id')
    
    public List<SelectOption> getItems() {
        List<SelectOption> options = new List<SelectOption>();
        options.add(new SelectOption('Deal Won','Deal Won'));
        options.add(new SelectOption('Deal Lost','Deal Lost'));
        options.add(new SelectOption('Disqualified','Disqualified'));
        return options;
    }
    
    public String selectedValue {get; set;}
    public Boolean renderWon {get; set;}
    public Boolean renderLost {get; set;}
    public Boolean renderDQ {get; set;}
    
    // set all of the render pageblocks as false when the page opens
    public closeOppExtension() {
        renderWon = renderLost = renderDQ = false;
    }
    
    // show the appropiate pageblock based on the picklist selection
    // hide the other pageblocks - important if the user chooses another picklist value
    public void showSection() {
        if(selectedValue == 'Deal Won') {
            renderWon = true;
            renderLost = false;
            renderDQ = false;
        }
        else if(selectedValue == 'Deal Lost') {
            renderWon = false; 
            renderLost = true;
            renderDQ = false;
        }
        else if(selectedValue == 'Disqualified') {
            renderWon = false;
            renderLost = false;
            renderDQ = true;
        }
    }
    
    public Opportunity opp {get; set;}
    public Opportunity RenewalOpp {get; set;}
    // private ApexPages.StandardController stdController;
    
    private Date today = date.today();
    
    public Date Renewal_Start {get; set;}
    public Date Renewal_End {get; set;}
    public String Renewal_Name {get; set;}
    
    // calculate standard subscription start and end dates to prepopulate input field areas
	public closeOppExtension(ApexPages.StandardController stdController) {
		opp = (Opportunity)stdController.getRecord();
        opp.Subscription_Start_Date__c = date.newInstance(date.today().year(), date.today().month() + 1, 1);
        opp.Subscription_End_Date__c = date.newInstance(date.today().year() + 1, date.today().month() + 1, 1) - 1;
        Renewal_Start = date.newInstance(today.year() + 1, today.month() + 1, 1);
        // date Renewal_Start = RenewalOpp.Subscription_Start_Date__c;
        Renewal_End = date.newInstance(Renewal_Start.year() + 1, Renewal_Start.month() + 1, 1) - 1;
	}
    
    public ID oppID {get; set;}
    
}

 

I was under the impression that Flows were automatically bulkified, but every time that one of my users uploads a list to SF, I get the error below.

Can someone provide a tips to help with this? The flow is being triggered by a process.
 

Error element Lead_Lookup (FlowRecordLookup).
This error occurred when the flow tried to look up records: Too many SOQL queries: 101. For details, see API Exceptions.
This report lists the elements that the flow interview executed. The report is a beta feature.
We welcome your feedback on IdeaExchange.
Flow Details
Flow Name: Lead_Datestamp_Update
Type: Autolaunched Flow
Version: 10
Status: Active
Flow Interview Details
Interview Label: 
Current User: Felipe Da Cruz (00541000001TeSw)
Start time: 7/20/2017 2:52 PM
Duration: 0 seconds
How the Interview Started
Felipe Da Cruz (00541000001TeSw) started the flow interview.
Some of this flow's variables were set when the interview started.
OldStatus = Working
LeadId = 00Q4100000KYN1HEAX
FAST LOOKUP: Lead_Lookup
Find all Lead records where:
Id Equals {!LeadId} (00Q4100000KYN1HEAX)
Assign those records to {!Lead}.
Save these field values in the variable: Datestamp_Nurturing__c, Datestamp_Ready__c, Datestamp_Working__c, Datestamp_DQ__c, Datestamp_Qualified__c, Datestamp_Qualified_Rejected__c, Datestamp_Lead_Conversion__c, Status, Cycle_Counter__c, Ready_Source__c, Ready_Channel__c, Last_DQ_Rejection_Reason__c, DQ_Rejected_Reason__c, MQL_Created__c, Notification_Sent_Robin_Ready__c
Result
Successfully found records.

FAST LOOKUP: Lead_Lookup
Find all Lead records where:
Id Equals {!LeadId} (00Q4100000KYN1HEAX)
Assign those records to {!Lead}.
Save these field values in the variable: Datestamp_Nurturing__c, Datestamp_Ready__c, Datestamp_Working__c, Datestamp_DQ__c, Datestamp_Qualified__c, Datestamp_Qualified_Rejected__c, Datestamp_Lead_Conversion__c, Status, Cycle_Counter__c, Ready_Source__c, Ready_Channel__c, Last_DQ_Rejection_Reason__c, DQ_Rejected_Reason__c, MQL_Created__c, Notification_Sent_Robin_Ready__c
Result
Failed to find records.

Error Occurred: Too many SOQL queries: 101
Hi all - I just received the following internal server error while trying to run a flow from a visualforce button in an opportunity record. Unfortunately, support wasn't able to help me, so I'm hoping that one of you might be able to provide some insight in what is going on! I'm including the error message at the very end of the post.

I'm not sure if this has anything to do with the screen logic pilot program that I have enabled for my org, but would love to know if anyone else has seen the same error. I have tried debugging it for a while now, to the point of even creating a completely new flow from scratch to no avail.

Message:
An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. 

Thank you again for your patience and assistance. And thanks for using salesforce.com! 

Error ID: 283414078-21279 (1332366967)
Hi all,

I'm curious to know if there's a way to look at the runtime stats for a given process or flow interview like you can when looking at the log for an Apex trigger. The stats that I'm referring to are the stats towards the bottom of the log that shows things like SOQL queries and CPU time.

I'm asking since I konw that processes and flows have governor limits and am curious to know expecially what the CPU time is for a given interview in addition to the agreggate number SOQL queries.
Hi all - is there a way to change the dashboard panel hover details so that it shows more information?

User-added image
I've been trying to figure this error out for a while now and it seems that I just can't figure it out. When adding an opportunitylineitem to an opportunity, I keep receiving the "Attempt to de-reference a null object" error right after the `prod.inventory_forecast__c += (oli.quantity * opps.get(oli.OpportunityId).probability);` line
trigger InventoryForecast on OpportunityLineItem (after update, after insert) {
    
    Product2[] prods;
    Product2 prod;
    
    // creates a map of opportunities
    Set<ID> oppIds = new Set<ID>();
    for(OpportunityLineItem oli : Trigger.new) {oppIds.add(oli.opportunityId);}
    Map<ID, Opportunity> opps = new Map<ID, Opportunity>([SELECT Id, Probability FROM Opportunity WHERE Id IN :oppIds]);
    
    
    // creates a map of products
    Set<ID> prodIds = new Set<ID>();
    for(OpportunityLineItem oli : Trigger.new) {prodIds.add(oli.Product2Id);}
    System.debug(prodIds);
    Map<ID, Product2> prods2 = new Map<ID, Product2>([SELECT Id, inventory_forecast__c FROM Product2 WHERE Id IN :prodIds]);
    
    
    OpportunityLineItem oldOLI, newOLI;
    Decimal diff;
    
    for(OpportunityLineItem oli : Trigger.New){
        
        if(Trigger.isInsert){
            // increase forecast by amount * opp probability
            
            prod = prods2.get(oli.Product2Id);
            System.debug(prod);
            prod.inventory_forecast__c += (oli.quantity * opps.get(oli.OpportunityId).probability);
            
            prods.add(prod);
            
        }
        /*
        if(Trigger.isUpdate){
            // increase of decrease forecast by amount
            // compare Trigger.New to Trigger.Old
        
            // use newMap and oldMap as lists may not have same records and records may not be in same order
            oldOLI = Trigger.oldMap.get(oli.Id);
            newOLI = Trigger.newMap.get(oli.Id);
            
            if(newOLI.quantity == null) {newOLI.quantity = 0;}
            if(oldOLI.quantity == null) {oldOLI.quantity = 0;}
            
            diff = (newOLI.quantity - oldOLI.quantity) * opps.get(oli.OpportunityId).probability;
            
            
            prod = prods2.get(oli.Product2Id);
            prod.inventory_forecast__c += diff;
            
            prods.add(prod);
            
        }
        */
    }
    
    update prods;

}

 
Hi all - is there a way to change the dashboard panel hover details so that it shows more information?

User-added image
Seems like I'm not being able to pass a sObject list to my server-side controller.

I've seen articles and other forum answers that propose using JSON.stringify. I've tried that method, but my server-side controller throws an error stating: "null input to JSON parser". System.debug() shows a 'null' value for the input String parameter. Not sure what's going on.
If I try passing the sObject, I also get a null value, but no error. I have verified that the argument I'm passing from the server-side is not null via console.log().

For the stringify method, I'm changing the action2.setParam() to:
var action2 = component.get('c.relatedOpportunities');
action2.setParam({
    openOppsString: JSON.stringify(oppList)
});
Please note that I'm making two server calls for init.

Client-side Controller
({
doInit : function(component, event, helper) {

    var action = component.get('c.getOpenRenewals');
    action.setParams({
        accountId: component.get("v.recordId")
    })

    // the oppList variable below is to store the list of open renewals to pass on to the second server call
    var oppList = [];
    action.setCallback(this, function(actionResult) {
        component.set('v.openRenewals', actionResult.getReturnValue());
        oppList = actionResult.getReturnValue();

        // debugging
        console.log('>>> Log 1.0: ' + JSON.stringify(actionResult.getReturnValue()));
        console.log('>>> Log 1.1: ' + actionResult.getReturnValue());
        console.log('>>> Log 1.2: ' + JSON.stringify(oppList));
        console.log('>>> Log 1.3: ' + oppList);

        var action2 = component.get('c.relatedOpportunities');
        action2.setParam({  
            openOpps: oppList
        });

        action2.setCallback(this, function(actionResult) {
            component.set('v.associatedOpps', actionResult.getReturnValue());
            console.log('>>> Log 2: ' + JSON.stringify(actionResult.getReturnValue()));
        });

        $A.enqueueAction(action2);

    });

    $A.enqueueAction(action);
}
})
CLIENT LOGS
>>> Log 1.0: [{"Id":"0060x0000061FU0AAM","AccountId":"0014100000gZs1IAAS","Name":"Open Renewal - Test","StageName":"SBR 2 / Renewal Quote","Amount":1234,"CloseDate":"2018-08-03","OwnerId":"00541000001TeSwAAK","RecordTypeId":"012410000019XbpAAE","Owner":{"Name":"fdacruz","Id":"00541000001TeSwAAK"}}]

>>> Log 1.1: [object Object]

>>> Log 1.2: [{"Id":"0060x0000061FU0AAM","AccountId":"0014100000gZs1IAAS","Name":"Open Renewal - Test","StageName":"SBR 2 / Renewal Quote","Amount":1234,"CloseDate":"2018-08-03","OwnerId":"00541000001TeSwAAK","RecordTypeId":"012410000019XbpAAE","Owner":{"Name":"fdacruz","Id":"00541000001TeSwAAK"}}]

>>> Log 1.3: [object Object]

>>> Log 2: {}
Server-Side Controller (Snippet) 1
@auraEnabled     
public static Map<Id, List<Opportunity>> relatedOpportunities(List<Opportunity> openOpps) {

        system.debug(openOpps.size());
        system.debug(openOpps);
SERVER DEBUG LOGS 1
[43]|DEBUG|0
[44]|DEBUG|()
Server-Side Controller (Snippet) 2
(with this method, I am changing the input parameter in the client-side as well from 'openOpps' to 'openOppsString')
@auraEnabled
public static Map<Id, List<Opportunity>> relatedOpportunities(String openOppsString) {

    system.debug(openOppsString);
    List<Opportunity> openOpps;
    openOpps = (List<Opportunity>)System.JSON.deserializeStrict(openOppsString, List<Opportunity>.class);
    */

    system.debug(openOpps.size());
    system.debug(openOpps);
SERVER DEBUG LOGS 2
[37]|DEBUG|null
Hi everyone,

I'm creating a visualforce page to help the opp closing process and am making some of the fields required to ensure that proper process is followed. My page works as follows:
- only shows a few fields at first
- shows specifc fields with an "onchange" event depending on the Opp Stage selected

The issue that I'm running into at the moment is that if I select an option in the dropdown and then select another one, the field requirement rules are enforced. I'm looking to only have the rules enforced when the "Save" button is pressed.

Hopefully this is not too much code...below is the page and controller extension. Thank you in advance for the help!!
 
<apex:page standardController="Opportunity" extensions="closeOppExtension" sidebar="false" docType="html-5.0">
    
    <apex:messages />
    
    <apex:form >
        <apex:pageBlock title="Close Opportunity">
            
            <p/>
            <b> Please confirm that all of the information on this screen is accurate in order to close the opportunity. </b>

            
            <apex:pageBlockSection columns="1" >
                
                <apex:inputField value="{! Opportunity.Name }" required="true" />
                <apex:inputField value="{! Opportunity.CloseDate }" required="true" />
                <apex:inputField value="{! Opportunity.Type }" required="true" />
                
                
                <apex:selectList id="chooseStage" value="{! selectedValue }" size="1" required="true" label="Stage" >
                    <apex:selectOption itemValue="" itemLabel="Please select closed stage..." /> 
                    <apex:selectOption itemValue="Deal Won" itemLabel="Deal Won" />
                    <apex:selectOption itemValue="Deal Lost" itemLabel="Deal Lost" />
                    <apex:selectOption itemValue="Disqualified" itemLabel="Disqualified" />
                    <apex:actionSupport event="onchange" action="{! showSection }" />
                </apex:selectList>
                
            </apex:pageBlockSection>
            
            <apex:pageBlockSection rendered="{! renderWon }" columns="1" >
            
                <apex:inputField value="{! Opportunity.Amount }" required="true"/>
                <apex:inputField value="{! Opportunity.ARR_Amount__c }" required="true" />
                <apex:inputField value="{! Opportunity.Subscription_Start_Date__c }" required="true" />
                <apex:inputField value="{! Opportunity.Subscription_End_Date__c }" required="true" />
                <apex:inputText value="{! Renewal_Start }" label="Renewal License Start Date" onclick="DatePicker.pickDate(false, this, false);" onfocus="DatePicker.pickDate(false, this, false);" required="true"/>
                <apex:inputText value="{! Renewal_End }" label="Renewal License End Date"  onclick="DatePicker.pickDate(false, this, false);" onfocus="DatePicker.pickDate(false, this, false);" required="true"/>
                <apex:inputText value="{! Renewal_Name }" label="Renewal Opportunity Name"  required="true" />
                <apex:inputField value="{! Opportunity.Number_of_Devices__c }" required="true" />
                <apex:inputField value="{! Opportunity.Opportunity_Channel__c }" required="true" />
                <apex:inputField value="{! Opportunity.Product_Interest__c }" required="true" />
                
            </apex:pageBlockSection>
            
            <apex:pageBlockSection rendered="{! renderLost }" columns="1" >
            
                <apex:inputField value="{! Opportunity.Amount }" required="true" />
                <apex:inputField value="{! Opportunity.ARR_Amount__c }" />
                <apex:inputField value="{! Opportunity.DQ_Loss_Reason__c }" required="true" />
                <apex:inputField value="{! Opportunity.Number_of_Devices__c }" />
                <apex:inputField value="{! Opportunity.Opportunity_Channel__c }" required="true" />
                <apex:inputField value="{! Opportunity.Product_Interest__c }" required="true" />
                
            </apex:pageBlockSection>
            
            <apex:pageBlockSection rendered="{! renderDQ }" columns="1" >
            
                <apex:inputField value="{! Opportunity.Amount }" />
                <apex:inputField value="{! Opportunity.ARR_Amount__c }" />
                <apex:inputField value="{! Opportunity.Number_of_Devices__c }" />
                <apex:inputField value="{! Opportunity.Opportunity_Channel__c }" />
                <apex:inputField value="{! Opportunity.Product_Interest__c }" />
                
            </apex:pageBlockSection>
            
            
            <apex:pageBlockButtons >
                <apex:commandButton action="{! save }" value="Save" />
            </apex:pageBlockButtons>
            
        </apex:pageBlock>
                
    </apex:form>
    
</apex:page>
 
public with sharing class closeOppExtension {
    
    // get ID from URL
    // public void ApexPages.currentPage().getParameters().get('id')
    
    public List<SelectOption> getItems() {
        List<SelectOption> options = new List<SelectOption>();
        options.add(new SelectOption('Deal Won','Deal Won'));
        options.add(new SelectOption('Deal Lost','Deal Lost'));
        options.add(new SelectOption('Disqualified','Disqualified'));
        return options;
    }
    
    public String selectedValue {get; set;}
    public Boolean renderWon {get; set;}
    public Boolean renderLost {get; set;}
    public Boolean renderDQ {get; set;}
    
    // set all of the render pageblocks as false when the page opens
    public closeOppExtension() {
        renderWon = renderLost = renderDQ = false;
    }
    
    // show the appropiate pageblock based on the picklist selection
    // hide the other pageblocks - important if the user chooses another picklist value
    public void showSection() {
        if(selectedValue == 'Deal Won') {
            renderWon = true;
            renderLost = false;
            renderDQ = false;
        }
        else if(selectedValue == 'Deal Lost') {
            renderWon = false; 
            renderLost = true;
            renderDQ = false;
        }
        else if(selectedValue == 'Disqualified') {
            renderWon = false;
            renderLost = false;
            renderDQ = true;
        }
    }
    
    public Opportunity opp {get; set;}
    public Opportunity RenewalOpp {get; set;}
    // private ApexPages.StandardController stdController;
    
    private Date today = date.today();
    
    public Date Renewal_Start {get; set;}
    public Date Renewal_End {get; set;}
    public String Renewal_Name {get; set;}
    
    // calculate standard subscription start and end dates to prepopulate input field areas
	public closeOppExtension(ApexPages.StandardController stdController) {
		opp = (Opportunity)stdController.getRecord();
        opp.Subscription_Start_Date__c = date.newInstance(date.today().year(), date.today().month() + 1, 1);
        opp.Subscription_End_Date__c = date.newInstance(date.today().year() + 1, date.today().month() + 1, 1) - 1;
        Renewal_Start = date.newInstance(today.year() + 1, today.month() + 1, 1);
        // date Renewal_Start = RenewalOpp.Subscription_Start_Date__c;
        Renewal_End = date.newInstance(Renewal_Start.year() + 1, Renewal_Start.month() + 1, 1) - 1;
	}
    
    public ID oppID {get; set;}
    
}

 

I was under the impression that Flows were automatically bulkified, but every time that one of my users uploads a list to SF, I get the error below.

Can someone provide a tips to help with this? The flow is being triggered by a process.
 

Error element Lead_Lookup (FlowRecordLookup).
This error occurred when the flow tried to look up records: Too many SOQL queries: 101. For details, see API Exceptions.
This report lists the elements that the flow interview executed. The report is a beta feature.
We welcome your feedback on IdeaExchange.
Flow Details
Flow Name: Lead_Datestamp_Update
Type: Autolaunched Flow
Version: 10
Status: Active
Flow Interview Details
Interview Label: 
Current User: Felipe Da Cruz (00541000001TeSw)
Start time: 7/20/2017 2:52 PM
Duration: 0 seconds
How the Interview Started
Felipe Da Cruz (00541000001TeSw) started the flow interview.
Some of this flow's variables were set when the interview started.
OldStatus = Working
LeadId = 00Q4100000KYN1HEAX
FAST LOOKUP: Lead_Lookup
Find all Lead records where:
Id Equals {!LeadId} (00Q4100000KYN1HEAX)
Assign those records to {!Lead}.
Save these field values in the variable: Datestamp_Nurturing__c, Datestamp_Ready__c, Datestamp_Working__c, Datestamp_DQ__c, Datestamp_Qualified__c, Datestamp_Qualified_Rejected__c, Datestamp_Lead_Conversion__c, Status, Cycle_Counter__c, Ready_Source__c, Ready_Channel__c, Last_DQ_Rejection_Reason__c, DQ_Rejected_Reason__c, MQL_Created__c, Notification_Sent_Robin_Ready__c
Result
Successfully found records.

FAST LOOKUP: Lead_Lookup
Find all Lead records where:
Id Equals {!LeadId} (00Q4100000KYN1HEAX)
Assign those records to {!Lead}.
Save these field values in the variable: Datestamp_Nurturing__c, Datestamp_Ready__c, Datestamp_Working__c, Datestamp_DQ__c, Datestamp_Qualified__c, Datestamp_Qualified_Rejected__c, Datestamp_Lead_Conversion__c, Status, Cycle_Counter__c, Ready_Source__c, Ready_Channel__c, Last_DQ_Rejection_Reason__c, DQ_Rejected_Reason__c, MQL_Created__c, Notification_Sent_Robin_Ready__c
Result
Failed to find records.

Error Occurred: Too many SOQL queries: 101
Hi all - I just received the following internal server error while trying to run a flow from a visualforce button in an opportunity record. Unfortunately, support wasn't able to help me, so I'm hoping that one of you might be able to provide some insight in what is going on! I'm including the error message at the very end of the post.

I'm not sure if this has anything to do with the screen logic pilot program that I have enabled for my org, but would love to know if anyone else has seen the same error. I have tried debugging it for a while now, to the point of even creating a completely new flow from scratch to no avail.

Message:
An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. 

Thank you again for your patience and assistance. And thanks for using salesforce.com! 

Error ID: 283414078-21279 (1332366967)
I've been trying to figure this error out for a while now and it seems that I just can't figure it out. When adding an opportunitylineitem to an opportunity, I keep receiving the "Attempt to de-reference a null object" error right after the `prod.inventory_forecast__c += (oli.quantity * opps.get(oli.OpportunityId).probability);` line
trigger InventoryForecast on OpportunityLineItem (after update, after insert) {
    
    Product2[] prods;
    Product2 prod;
    
    // creates a map of opportunities
    Set<ID> oppIds = new Set<ID>();
    for(OpportunityLineItem oli : Trigger.new) {oppIds.add(oli.opportunityId);}
    Map<ID, Opportunity> opps = new Map<ID, Opportunity>([SELECT Id, Probability FROM Opportunity WHERE Id IN :oppIds]);
    
    
    // creates a map of products
    Set<ID> prodIds = new Set<ID>();
    for(OpportunityLineItem oli : Trigger.new) {prodIds.add(oli.Product2Id);}
    System.debug(prodIds);
    Map<ID, Product2> prods2 = new Map<ID, Product2>([SELECT Id, inventory_forecast__c FROM Product2 WHERE Id IN :prodIds]);
    
    
    OpportunityLineItem oldOLI, newOLI;
    Decimal diff;
    
    for(OpportunityLineItem oli : Trigger.New){
        
        if(Trigger.isInsert){
            // increase forecast by amount * opp probability
            
            prod = prods2.get(oli.Product2Id);
            System.debug(prod);
            prod.inventory_forecast__c += (oli.quantity * opps.get(oli.OpportunityId).probability);
            
            prods.add(prod);
            
        }
        /*
        if(Trigger.isUpdate){
            // increase of decrease forecast by amount
            // compare Trigger.New to Trigger.Old
        
            // use newMap and oldMap as lists may not have same records and records may not be in same order
            oldOLI = Trigger.oldMap.get(oli.Id);
            newOLI = Trigger.newMap.get(oli.Id);
            
            if(newOLI.quantity == null) {newOLI.quantity = 0;}
            if(oldOLI.quantity == null) {oldOLI.quantity = 0;}
            
            diff = (newOLI.quantity - oldOLI.quantity) * opps.get(oli.OpportunityId).probability;
            
            
            prod = prods2.get(oli.Product2Id);
            prod.inventory_forecast__c += diff;
            
            prods.add(prod);
            
        }
        */
    }
    
    update prods;

}