• NicGaller
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 3
    Replies
I have recently discovered the Queueable interface and thought this might be the perfect solution for my problem.  I need to process records in a trigger.  For each record I need to do between 4 and 8 callouts (dealing with a chatty API).  So I thought:

 * Get a list of the record
 * Enqueue the list
 * In the queueable, process the first record and re-enqueue the rest

This was great because I would only have one job executing at a time so I wouldn't overload the API, and I could even build a retry logic by putting a failed record back on the list.  BUT when I tried it with more than 1 record I started getting "maximum callout depth has been reached".  Reading about it it seems like it is just not possible to chain queueable with callouts... soo is that true?  It seems like a pretty big chunk of use cases for queueable that is neglected.  I'm puzzled too that it is not mentioned at all in the queueable documentation.  I can redo the code using batch Apex,  or maybe enqueue all my jobs from the trigger instead of chaining them, but I am surprised as I thought Queueable was here to solve this exact type of issue - hopefully I am just missing something.
I need to override the "New Account" page with a custom version.
I can do that using a VisualForce page with a standard controller and this works on both Salesforce1 and Salesforce Classic.  However it shows using the Classic UI instead of lightning.  Is there a way to override the page so that it is better integrated?
Hello all,

I have recently started using Visual Workflows to replace regular workflow and Apex code.  In general I like it, though they can be hard to troubleshoot they are a lot easier to put together and for the end user to manage.

Here is a problem I am having with a flow I use to submit opportunities.  The process is submitted from Apex code - this can run either from a trigger or a VisualForce page.  Basically the flow has some custom logic to figure out if the opportunity is eligible to submit, then it launches the submission using a "Submit for Approval" element.  There is more logic going on in the approval process entry criteria and if the opportunity does not match it will give an error "No applicable approval process was found".  What I would like is to capture this error into an output variable of my flow.  If it was started from the VF page, I can capture the output variable and show it to the user.  If it was started from the trigger I can just discard it.  And this is mostly working - I am getting the error status back in the VF page - BUT I am also still getting an "Unhandled process fault" email.  

Is there something I need to do to mark the error as "Handled" so that I do not get that email?

This is the relevant portion of my flow:

Approval flow
And this is how I invoke it:
 
Map<String,Object> params = new Map<String, Object> ();
params.put('OpportunityId', oppId);
Flow.Interview.MyFlow flow = new Flow.Interview.MyFlow(params);
flow.start();
String status = (String)flow.getVariableValue('OpportunityApprovalStatus');

Thanks!!
I have a flow that is lanched from Apex code:
 
Flow.Interview.MyCustomApprovalFlow flow = new Flow.Interview.MyCustomApprovalFlow(params);
flow.start();


It does some custom logic to check over the opportunity line items then submits the opportunity for approval.  There is no UI (in fact this is being launched from a future method).

This works great except for the error handling.  I have connected a "FAULT" connector from the "Submit for Approval" element to send an error message to the opportunity's owner, but that is not being followed - instead I get a generic "Unhandled process fault" email.

What do I need to do to properly handle the errors?  Do I need to handle them in the code that launches the flow somehow?  This is how the element is set up right now:

 Submit for approval element
 
Hello,

Here is the scenario:
  • I want to edit multiple records on a page inside of a table
  • Most of the edits are done via <apex:inputField> components and those work great
  • I have a few fields that need to be edited with custom controls instead (so I use <apex:inputText> then decorate them with javascript)
  • I have a button for saving the table.  This works great.
  • I have a button at the bottom of the list for adding a new record.  On that button I set immediate=true, since I did not want validation rules to be applied until the user was ready to commit their work.  When they click that button, the <inputField> values are persisted, but the <inputText> values are getting reset.
  • I can set immediate=false on that "add" button and everything appears to work fine, even when some records are incomplete, so maybe I am just misunderstanding what it does?

I set up a simple example with a contact edit page... here is the page, I put an "Add" and an "Add-Immediate" button, the "Add" button works but the "Add-Immediate" resets edited contacts:
<apex:page controller="GridEditController">
    <apex:form >
        <apex:dataTable id="tbl" value="{!contacts}" var="c">                            
            <apex:column value="{!c.Id}"/>
            <apex:column headerValue="Department">
                <apex:inputText value="{!c.Department}"/>
            </apex:column>
        </apex:dataTable>
        <apex:commandButton value="Add" action="{!addToList}" rerender="tbl" immediate="false"/>
        <apex:commandButton value="Add-Immediate" action="{!addToList}" rerender="tbl" immediate="true"/>        
        <apex:commandButton value="Save" action="{!save}" />
    </apex:form>
</apex:page>

and the controller:
public class GridEditController {
    public List<Contact> contacts { get; set; }
    
    public GridEditController(){
        contacts = [select Id, Department from Contact];
    }
    
    public PageReference addToList(){
        contacts.add(new Contact());
        return null;
    }
    
    public PageReference save(){
        upsert contacts;
        return null;
    }
}

I appreciate any insight.

I apologize in advance for the very newbish question.

 

I have just installed the force.com IDE in eclipse 3.4.  Trying to run the following code:

System.debug('hello');

 

The view comes back with "Anonymous execution was successful" but should it not print the "Hello" statement?  The other settings are default - Log category "Apex Code" and Log Level Debug

 

 Here is a screenshot:

 

 

 

Is there another setting I could check for this?

Thanks!

I have recently discovered the Queueable interface and thought this might be the perfect solution for my problem.  I need to process records in a trigger.  For each record I need to do between 4 and 8 callouts (dealing with a chatty API).  So I thought:

 * Get a list of the record
 * Enqueue the list
 * In the queueable, process the first record and re-enqueue the rest

This was great because I would only have one job executing at a time so I wouldn't overload the API, and I could even build a retry logic by putting a failed record back on the list.  BUT when I tried it with more than 1 record I started getting "maximum callout depth has been reached".  Reading about it it seems like it is just not possible to chain queueable with callouts... soo is that true?  It seems like a pretty big chunk of use cases for queueable that is neglected.  I'm puzzled too that it is not mentioned at all in the queueable documentation.  I can redo the code using batch Apex,  or maybe enqueue all my jobs from the trigger instead of chaining them, but I am surprised as I thought Queueable was here to solve this exact type of issue - hopefully I am just missing something.

As of today, I cannot deploy change sets from my sandbox to the production site. I get emails that the upload worked but it just doesnt apper in the list of inbound change sets.  Any Infos about this issue? 

I apologize in advance for the very newbish question.

 

I have just installed the force.com IDE in eclipse 3.4.  Trying to run the following code:

System.debug('hello');

 

The view comes back with "Anonymous execution was successful" but should it not print the "Hello" statement?  The other settings are default - Log category "Apex Code" and Log Level Debug

 

 Here is a screenshot:

 

 

 

Is there another setting I could check for this?

Thanks!