• Nicholas Zuaro
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 8
    Replies

Hello,
I have heard that a Visual Work Flow is simply just giving a user friendly interface to APEX, right?
Well, in one of my flows that has a few loops in it, and must loop through over 1,000 records I happen to surpass the 2,000 executable elements per flow limitation. 
With this being said, I'd like to create the corresponding APEX for the actions that my flow goes through. If I could achieve what I'm trying to do via APEX since there wouldn't be any flow limitations, that would be perfect!
 

Only problem, is that I know little to none about writing APEX, so I was actually also hoping to use this as a learning opportunity.
But I can't find any documentation regarding what corresponds to what.
Like for example, 
"In a flow, you have a fast-create, in APEX, to achieve the same functionality you have to write in '.......' to achieve '......', and so on and so forth", etc.
Since I enjoy creating flows, I think looking at APEX from this perspective would greatly help me learn APEX because I have functionality to compare it to from flows.

I don't know if anyone knows anywhere that I can find some type of directory or other source of information similar to what I'm describing.

Here's the aforementioned flow that I was having an issue with. It was simpler at one point, but I had (once again) hit a flow limitation. A Fast Create can only create 200 records at once. So since that's the case, I had to route the flow back to the beginning so that it can use that Fast Create 5 or 6 times in order to create all 1,000 records. Obviously now that that's laid out for you, you can see that that's clearly going to blow right past the 2,000 executable elements limitation.
User-added image

Hello,
I'd like to preface this with the fact that I'm incredibly new to Salesforce Development and most coding in general, actually. So please bear with me.
Ok, 
I'm trying to create a handy little time-saving flow-powered button to help people create a New Sales Order as quickly as possible.
So the button is located on the Account page, so this way, it already has all of the accounts information to enter into the Sales Order. So basically, the flow looks up the account, Creates a Sales Order, and then is finished. 
Initially I wanted the user to be redirected to the Sales Order they just created.

Initially, I had a functioning controller that looked like this:
<apex:page standardController="Account"> 

    <flow:interview name="New_Sales_Order_From_Account_Page" 

    <apex:param name="vExistingAccount" value="{!Account.Id}"></apex:param>

    </flow:interview>

​</apex:page>

Then, before seeing your post, I tried to do something like this:
<apex:page standardController="Account"> 

    <flow:interview name="New_Sales_Order_From_Account_Page" 
        finishLocation="{!URLFOR('/' + Account.ID)}">
    <apex:param name="vExistingAccount" value="{!Account.Id}"></apex:param>
        <apex:param name="New_SalesOrder_ID" 
            value="{!$CurrentPage.parameters.New_SalesOrder_ID}" />
    </flow:interview>

​</apex:page>
Which I believe to have turned out to be a disaster.
Then, after seeing your post, I tried this:
<apex:page controller="flowController">
<flow:interview name="New_Sales_Order_From_Account_Page" interview="{!flDemo}" finishLocation="{!prFinishLocation}" />

public class flowController{
public Flow.Interview.New_Sales_Order_From_Account_Page flDemo {get;set;}
public PageReference prFinishLocation {
 get {
PageReference prRef = new PageReference('/' + strOutputVariable); prRef.setRedirect(true);
 return prRef;
 }
 set { prFinishLocation = value; }
 }
public String strOutputVariable {
 get {
 String strTemp = '';
 if(flDemo != null) {
 strTemp = string.valueOf(flDemo.getVariableValue(New_SalesOrder_ID));
 }
 return strTemp;
 }
 set { strOutputVariable = value; }
 }
}
</apex:page>

Which failed so miserably, I couldn't even save it. (Pretty sure my first error was something along the lines of "controller="flowController" doesn't exist."
Is the controller and then this other set of code supposed to be two different pages? or one in the same?
I'd like to reiterate how new I am to all of this, but I'm trying to learn by working off of and disecting good examples like these!
Thanks so much for your help!
Hello,
I'm trying to create a handy little time-saving flow-powered button to help people create a New Sales Order as quickly as possible.
So the button is located on the Account page, so this way, it already has all of the accounts information to enter into the Sales Order. So basically, the flow looks up the account, Creates a Sales Order, and then is finished. 
I wanted the user to be redirected to the Sales Order they just created.
My button looks like this:

/apex/NewSOManager?vExistingAccount={!Account.Id}

NewSOManager is a visualforce page like this:
 
<apex:page > 

    <flow:interview name="New_Sales_Order_From_Account_Page" 
        finishLocation="/{!$CurrentPage.parameters.New_SalesOrder_ID}">
    
        <apex:param name="New_SalesOrder_ID" 
            value="{!$CurrentPage.parameters.New_SalesOrder_ID}" />

    </flow:interview>

​</apex:page>

Now I'm EXTREMELY new to Apex/Visualforce, etc. and just coding in general.
After doing some more research it is to my understanding that I need to write the code for a controller or something and I've been looking through the documentation and the books that I have and I just can't figure out how to write it all from scratch with what little knowledge I have.
I'm just trying to get everything that I'm going to need squared away.
So i'm only going to need 1 visualforce page?
and 1 "controller"?
and is my visualforce page even remotely on the right track?
How do I build a controller from scratch?
Sorry I know I'm asking a lot but I need some help, I have nothing to go on and a deadline to meet!
Thanks so much in advanced for your help!
Hello,
I'm trying to create a handy little time-saving flow-powered button to help people create a New Sales Order as quickly as possible.
So the button is located on the Account page, so this way, it already has all of the accounts information to enter into the Sales Order. So basically, the flow looks up the account, Creates a Sales Order, and then is finished. 
I wanted the user to be redirected to the Sales Order they just created.
My button looks like this:

/apex/NewSOManager?vExistingAccount={!Account.Id}

NewSOManager is a visualforce page like this:
<apex:page > 

    <flow:interview name="New_Sales_Order_From_Account_Page" 
        finishLocation="/{!$CurrentPage.parameters.New_SalesOrder_ID}">
    
        <apex:param name="New_SalesOrder_ID" 
            value="{!$CurrentPage.parameters.New_SalesOrder_ID}" />

    </flow:interview>

​</apex:page>

Now I'm EXTREMELY new to Apex/Visualforce, etc. and just coding in general.
After doing some more research it is to my understanding that I need to write the code for a controller or something and I've been looking through the documentation and the books that I have and I just can't figure out how to write it all from scratch with what little knowledge I have.
I'm just trying to get everything that I'm going to need squared away.
So i'm only going to need 1 visualforce page?
and 1 "controller"?
and is my visualforce page even remotely on the right track?
How do I build a controller from scratch?
Sorry I know I'm asking a lot but I need some help, I have nothing to go on and a deadline to meet!
Thanks so much in advanced for your help!

Hello,
I have heard that a Visual Work Flow is simply just giving a user friendly interface to APEX, right?
Well, in one of my flows that has a few loops in it, and must loop through over 1,000 records I happen to surpass the 2,000 executable elements per flow limitation. 
With this being said, I'd like to create the corresponding APEX for the actions that my flow goes through. If I could achieve what I'm trying to do via APEX since there wouldn't be any flow limitations, that would be perfect!
 

Only problem, is that I know little to none about writing APEX, so I was actually also hoping to use this as a learning opportunity.
But I can't find any documentation regarding what corresponds to what.
Like for example, 
"In a flow, you have a fast-create, in APEX, to achieve the same functionality you have to write in '.......' to achieve '......', and so on and so forth", etc.
Since I enjoy creating flows, I think looking at APEX from this perspective would greatly help me learn APEX because I have functionality to compare it to from flows.

I don't know if anyone knows anywhere that I can find some type of directory or other source of information similar to what I'm describing.

Here's the aforementioned flow that I was having an issue with. It was simpler at one point, but I had (once again) hit a flow limitation. A Fast Create can only create 200 records at once. So since that's the case, I had to route the flow back to the beginning so that it can use that Fast Create 5 or 6 times in order to create all 1,000 records. Obviously now that that's laid out for you, you can see that that's clearly going to blow right past the 2,000 executable elements limitation.
User-added image

Hello,
I'd like to preface this with the fact that I'm incredibly new to Salesforce Development and most coding in general, actually. So please bear with me.
Ok, 
I'm trying to create a handy little time-saving flow-powered button to help people create a New Sales Order as quickly as possible.
So the button is located on the Account page, so this way, it already has all of the accounts information to enter into the Sales Order. So basically, the flow looks up the account, Creates a Sales Order, and then is finished. 
Initially I wanted the user to be redirected to the Sales Order they just created.

Initially, I had a functioning controller that looked like this:
<apex:page standardController="Account"> 

    <flow:interview name="New_Sales_Order_From_Account_Page" 

    <apex:param name="vExistingAccount" value="{!Account.Id}"></apex:param>

    </flow:interview>

​</apex:page>

Then, before seeing your post, I tried to do something like this:
<apex:page standardController="Account"> 

    <flow:interview name="New_Sales_Order_From_Account_Page" 
        finishLocation="{!URLFOR('/' + Account.ID)}">
    <apex:param name="vExistingAccount" value="{!Account.Id}"></apex:param>
        <apex:param name="New_SalesOrder_ID" 
            value="{!$CurrentPage.parameters.New_SalesOrder_ID}" />
    </flow:interview>

​</apex:page>
Which I believe to have turned out to be a disaster.
Then, after seeing your post, I tried this:
<apex:page controller="flowController">
<flow:interview name="New_Sales_Order_From_Account_Page" interview="{!flDemo}" finishLocation="{!prFinishLocation}" />

public class flowController{
public Flow.Interview.New_Sales_Order_From_Account_Page flDemo {get;set;}
public PageReference prFinishLocation {
 get {
PageReference prRef = new PageReference('/' + strOutputVariable); prRef.setRedirect(true);
 return prRef;
 }
 set { prFinishLocation = value; }
 }
public String strOutputVariable {
 get {
 String strTemp = '';
 if(flDemo != null) {
 strTemp = string.valueOf(flDemo.getVariableValue(New_SalesOrder_ID));
 }
 return strTemp;
 }
 set { strOutputVariable = value; }
 }
}
</apex:page>

Which failed so miserably, I couldn't even save it. (Pretty sure my first error was something along the lines of "controller="flowController" doesn't exist."
Is the controller and then this other set of code supposed to be two different pages? or one in the same?
I'd like to reiterate how new I am to all of this, but I'm trying to learn by working off of and disecting good examples like these!
Thanks so much for your help!
Hello,

I am trying to implement Processes and visual flows in my organisation but i need to have "does not contain" operator in the flows.
It is not shown in the list. That could be a big problem if i am not able to use it.
Any ideas somehow to replace it?

Regards,
Ivo