• David Poynter
  • NEWBIE
  • 15 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 18
    Replies

I probably should have asked this question long ago instead of spending a couple hours futzing around.

I am a newbie to Apex, however I do have some experience in Java.

The Use-Case: I would like to create a customized flow that is launched via a button to allow for editing a field and approving an outstanding approval process at the same time. (e.g. There are different approval types in our industry, and instead of just approving, we are trying to be able to have a flow to select the type of approval and approve it in the same action)

I have tried creating invocable methods with invocable variables (so that the visual flow can call on it and pass an Id to it), but the whole limitation of only sending lists of objects in an InvocableMethod is really throwing a wrench in the system. I just want to pass a single Id that the ProcessInstance.TargetObjectId is equal to to approve.

These are the resources I have been using so far:
https://www.xgeek.net/salesforce/approval-processing-with-apex-in-salesforce/
https://salesforce.stackexchange.com/questions/107345/how-invocable-method-and-bulk-behavior-in-process-builder-work
And of course the Invocable Variable/Method anotation content from salesforce.

Please please help. I would love for this to be the first success story of apex in our Org.

Here's the simple:
Since you cannot create a lookup field to a meeting, I created a workaround flow that links the meeting itself up with a Meeting Note, and then on the meeting note there is a url field that is a direct url to the meeting.
So when the flow is run from a custom button on the meeting, it creates the note, makes the link, and updates the meeting as being done. The issue I am running into is the permission error that happens when the flow is run from the non-parent meeting.

What I really don't understand is that in the flow I have a catch that checks for if the meeting is a child event, and if it is, it searches (using date, subject, type, and sub-type) for the parent meeting, and then attempts to update that one instead.

When debugging I can confirm it is finding the correct Parent Meeting/ID, yet it still throws this error:

"Error Occurred: The flow tried to update these records: null. This error occurred: INSUFFICIENT_ACCESS_OR_READONLY: Only meeting organizers can update this field.. You can look up ExceptionCode values in the SOAP API Developer Guide."

Any Ideas? Thanks!

I am attempting to create a quick action from an Opportunity to create a new CSOT object. This works currently in classic via a URL hack, however when creating a quick action, I am trying to prefil a CSOT field with a formula field on the opportunity, I receive the error in the screenshot.

User-added image

Yet Reco_d_Portfolio__c IS used in other predefined field values in quick actions.
Hello All, I am recieving a perplexing error. 

I created a Visualforce page with the following code:

<apex:page standardController="Event">
    <flow:interview name="Create_Meeting_Note"  finishLocation="{!URLFOR('/')}">
        <apex:param name="MeetingID" value="{!ID}" />
    </flow:interview>
</apex:page>

But when a reference it via a custom button, I get the "URL No Longer Exists" error. Any ideas as to why this would be? I have had other visual force pages and custom buttons work just fine recently, and cannot for the life of me figure out why this dirt simple one isn't!
So I am having a really hard time with this error. 

Right now in process builder I have a formula assigning a picklist value on the Account. The formula used in process builder evaluates a formula field on the Account level as well. When triggered on the Account page everything works just fine with no errors. However, when something changes on the related contact (account owner), the formula needs to evaluate and update the picklist as well. So I adjusted the process builder formula to lookup the formula on the account level, and left everything else identically the same, but now when the change is made on the conatct it errors out saying the formula field on the account is null/hasn't been set or assigned! This doesn't make any sense, because clearly it has been assigned (its a formula field that is returning a value, and it works just fine on the Account level), but for all intents and purposes, the field is seen as null in the contact triggered process builder!

Note: I do have a criteria check to make sure the account lookup field has been assigned on the contact, so the lookup field has been assigned and working properly.

Any and all help would be appreciated!

Thanks!
So this issue has been plagging us for a while. Our simple use case is to automatically reassing tasks that are assigned to users who are currently out of office. We have three fields on the user level: 
Out of Office replacement user
Out of office start date
Out of office end date

The process builder simply determines if the "Due Date Only" field (API - ActivityDate) is in between the start and end date of the assigned to user, and if it is, runs a flow to reassign it!

The issue is that for some unknown reason we continue to be plagged by errors like "moduleapi.interaction.DateTime cannot be cast to moduleapi.interaction.DateOnly" that revolve around DateTime and Date conversions and formulas, even though supposedly all fields are just simply date fields.

I was reading somewhere however that the ActivityDate field on the task can sometimes have time included somehow? Is this true?

How can I make a process builder that regardless of technically if it is a DateTime or just a Date, it converts it to just a date, and runs the process accordingly. I can't for the life of me figure out some way to sort of do a "Try/Catch" scenario, where it tries casting a DateTime to a date, and then if it fails it assumes it is just a Date to begin with. Or something along those lines.

This issue has been increadibly agrivating and annoying so any help would be greatly appreciated. here is the full error:

Error element myDecision (FlowDecision).
moduleapi.interaction.DateTime cannot be cast to moduleapi.interaction.DateOnly


Flow Details
Flow Name: Out_of_Office_Automatic_Reassignment
Type: Record Change Process
Version: 15
Status: Active
Org: Bernicke Wealth Management, Ltd. (00DF00000006JX5)
Flow Interview Details
Interview Label: Out_of_Office_Automatic_Reassignment-15_InterviewLabel
Current User: Lindsey Hendrickson (0050G000008KmVU)
Start time: 12/20/2018 12:12 PM
Duration: 0 seconds
How the Interview Started
Lindsey Hendrickson (0050G000008KmVU) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = null
myVariable_current = Task (00T2I0000567t2JUAQ)
ASSIGNMENT: myVariable_waitStartTimeAssignment
{!myVariable_waitStartTimeVariable} Equals {!$Flow.CurrentDateTime}
Result
{!myVariable_waitStartTimeVariable} = "12/20/2018 12:12 PM"


To me with error makes absolutley no sense, especially since the only fields we are dealing with are Date fields! (supposedly)
I work for a wealth management firm, and we use many URL hacks for starting new records with near 50 fields (trade order instructions, opportunities to new accounts, etc). Is there any other way than using a quick action to make it lighting ready? It's absolutely tedious to have to add all those fields into an action, not to mention the layout is then completely different than the record type/layout of the applicable object. I noticed that when attempting to use a preexisting URL hack in lighting, it does still pull up a window for creating the correct object, with all the fields and the correct layout, just nothing populating. Is there anything that combines these two functions that is lighting ready? This seems like such an obvious issue.
Like what if we just want our users to be able to access the calendar from the salesforce app. When they are in using their computer we want them to have full acess, but then when they are out and about with their phones, can we limit them to only viewing their clendar or certain records/objects.

Thank you!
The question basically sums it up. I am working on a new integration. The simplest way to set up the integration is to use an email trigger... however these emails being sent will need to include client's names and addresses! Are these emails secure enough to do so while fulfilling compliance protocole? If not by defualt, are there settings I can change that will make them secure enough? Are there other options to making SURE we could send secure emails with client information.

Thank you! Any and all ideas welcome!

- David
I have created a visual flow that collects all contacts that meet certain requirements, stores them in a sObject collection, preforms functions on the data in zip codes fields to shorten them to the first five digits, saves them in a new sObject collection, and then updates them all at once. 
This works perfectly if I preform the first lookup with either the specific contact ID, or using "Starts with" and then the correct first 5 digits of their zip code. 
HOWEVER, this flow is only useful if it works by automatically recording ALL contacts that have a zip code longer than 5 digits and then preforming the tasks just on those contacts. 

HOW can I do this? I can use 
-Equals
-Does not equal
-contains
-starts with
-ends with
-is null

PLEASE ADVISE 

So I have finally found the event creation object, and all the fields I need to fill in. These would include a start and end "Date/Time" field! First, this had me quite stumped because it would be way to easy if there was a "Date/Time" field within flow designer, but I finally figured out a formula to add a date field, along with a seperate string/time field. The problem is of course, the fact that the input isn't translated to GMT before being entered, so as soon as I enter the data, and then create the event, the times are COMPLETELY off of when they were scheduled! HOW do you simply create a start and stop time for an event/meeting using flows? 

 

PLEASE help! Thank you!

{!Last_Name}", "{!Nickname} IF({!Secondary_Nickname}="null", " " , " & " {!Secondary_Nickname} IF({!Last_Name}={!Secondary_Last_Name}, " " , {!Secondary_Last_Name}))


Basically I want Lastname, Nickname, and if there is a secondary nickname, add lastname nickname, unless they both have the same lastname, in which case exlude the second lastname. Does this make sense?

Hello Apex Developers!

I am a new employee at a wealth management first. Due to the type of industry wealth management is, fields ar changing and being updated quite often (lets say as an example, tax brackets in a drop down list). I have been blazing my way through TrialHead, and have REALLY been enjoying what I have found, and my mind is loving all the opportunites I now have to create solutions for the firm, especially in regards to work flows and APEX. Anyways, back to it...

So lets say tax brackets change, or a field is replaced with another. The firm in history has created a new field, run reports, and used data loader to update fields. However none of them ever new anything about Apex, and after going through trailhead, I can't help but see the simplicity and power of it. I am familiar with coding laguages, and know there must be a simple way to iterate through all accounts or contacts looking for a certain field and entry, and updating it and assinging it to the new updated field options. Yet is seems like this actually may not be that simple using apex. Am I supposed to use a batch function, or is there a way I can run loops?

I don't need the code handed to me on a platter, but I would really appreciate a solution framework as to how I could use apex to update these fields relatively easily. If "I" could find a solution as to how I could do this, it would be implemented a couple times a week, and save countless hours of hassle and frustration.

Thank you so much guys, let me know what you think!

- David

I probably should have asked this question long ago instead of spending a couple hours futzing around.

I am a newbie to Apex, however I do have some experience in Java.

The Use-Case: I would like to create a customized flow that is launched via a button to allow for editing a field and approving an outstanding approval process at the same time. (e.g. There are different approval types in our industry, and instead of just approving, we are trying to be able to have a flow to select the type of approval and approve it in the same action)

I have tried creating invocable methods with invocable variables (so that the visual flow can call on it and pass an Id to it), but the whole limitation of only sending lists of objects in an InvocableMethod is really throwing a wrench in the system. I just want to pass a single Id that the ProcessInstance.TargetObjectId is equal to to approve.

These are the resources I have been using so far:
https://www.xgeek.net/salesforce/approval-processing-with-apex-in-salesforce/
https://salesforce.stackexchange.com/questions/107345/how-invocable-method-and-bulk-behavior-in-process-builder-work
And of course the Invocable Variable/Method anotation content from salesforce.

Please please help. I would love for this to be the first success story of apex in our Org.

Here's the simple:
Since you cannot create a lookup field to a meeting, I created a workaround flow that links the meeting itself up with a Meeting Note, and then on the meeting note there is a url field that is a direct url to the meeting.
So when the flow is run from a custom button on the meeting, it creates the note, makes the link, and updates the meeting as being done. The issue I am running into is the permission error that happens when the flow is run from the non-parent meeting.

What I really don't understand is that in the flow I have a catch that checks for if the meeting is a child event, and if it is, it searches (using date, subject, type, and sub-type) for the parent meeting, and then attempts to update that one instead.

When debugging I can confirm it is finding the correct Parent Meeting/ID, yet it still throws this error:

"Error Occurred: The flow tried to update these records: null. This error occurred: INSUFFICIENT_ACCESS_OR_READONLY: Only meeting organizers can update this field.. You can look up ExceptionCode values in the SOAP API Developer Guide."

Any Ideas? Thanks!

I am attempting to create a quick action from an Opportunity to create a new CSOT object. This works currently in classic via a URL hack, however when creating a quick action, I am trying to prefil a CSOT field with a formula field on the opportunity, I receive the error in the screenshot.

User-added image

Yet Reco_d_Portfolio__c IS used in other predefined field values in quick actions.
Hello All, I am recieving a perplexing error. 

I created a Visualforce page with the following code:

<apex:page standardController="Event">
    <flow:interview name="Create_Meeting_Note"  finishLocation="{!URLFOR('/')}">
        <apex:param name="MeetingID" value="{!ID}" />
    </flow:interview>
</apex:page>

But when a reference it via a custom button, I get the "URL No Longer Exists" error. Any ideas as to why this would be? I have had other visual force pages and custom buttons work just fine recently, and cannot for the life of me figure out why this dirt simple one isn't!
So I am having a really hard time with this error. 

Right now in process builder I have a formula assigning a picklist value on the Account. The formula used in process builder evaluates a formula field on the Account level as well. When triggered on the Account page everything works just fine with no errors. However, when something changes on the related contact (account owner), the formula needs to evaluate and update the picklist as well. So I adjusted the process builder formula to lookup the formula on the account level, and left everything else identically the same, but now when the change is made on the conatct it errors out saying the formula field on the account is null/hasn't been set or assigned! This doesn't make any sense, because clearly it has been assigned (its a formula field that is returning a value, and it works just fine on the Account level), but for all intents and purposes, the field is seen as null in the contact triggered process builder!

Note: I do have a criteria check to make sure the account lookup field has been assigned on the contact, so the lookup field has been assigned and working properly.

Any and all help would be appreciated!

Thanks!
I have an issue where my loop isnt populating the sobject from the sobject_collection on the Flow Builder (none Java version)

I have tried to prove the issue by using an Assignment 

User-added image

The Loop:
User-added image

then trying to pass this Loop object along:
User-added image

I get an email with all the correct info in the sobject_collection etc just this error on assignment:


 

Error element Populate_Line_Items (FlowAssignment).
The flow failed to access the value for VarOppo_Line_Item_Loop.acu_prid_id__c because it hasn't been set or assigned.

An ideas?

So this issue has been plagging us for a while. Our simple use case is to automatically reassing tasks that are assigned to users who are currently out of office. We have three fields on the user level: 
Out of Office replacement user
Out of office start date
Out of office end date

The process builder simply determines if the "Due Date Only" field (API - ActivityDate) is in between the start and end date of the assigned to user, and if it is, runs a flow to reassign it!

The issue is that for some unknown reason we continue to be plagged by errors like "moduleapi.interaction.DateTime cannot be cast to moduleapi.interaction.DateOnly" that revolve around DateTime and Date conversions and formulas, even though supposedly all fields are just simply date fields.

I was reading somewhere however that the ActivityDate field on the task can sometimes have time included somehow? Is this true?

How can I make a process builder that regardless of technically if it is a DateTime or just a Date, it converts it to just a date, and runs the process accordingly. I can't for the life of me figure out some way to sort of do a "Try/Catch" scenario, where it tries casting a DateTime to a date, and then if it fails it assumes it is just a Date to begin with. Or something along those lines.

This issue has been increadibly agrivating and annoying so any help would be greatly appreciated. here is the full error:

Error element myDecision (FlowDecision).
moduleapi.interaction.DateTime cannot be cast to moduleapi.interaction.DateOnly


Flow Details
Flow Name: Out_of_Office_Automatic_Reassignment
Type: Record Change Process
Version: 15
Status: Active
Org: Bernicke Wealth Management, Ltd. (00DF00000006JX5)
Flow Interview Details
Interview Label: Out_of_Office_Automatic_Reassignment-15_InterviewLabel
Current User: Lindsey Hendrickson (0050G000008KmVU)
Start time: 12/20/2018 12:12 PM
Duration: 0 seconds
How the Interview Started
Lindsey Hendrickson (0050G000008KmVU) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = null
myVariable_current = Task (00T2I0000567t2JUAQ)
ASSIGNMENT: myVariable_waitStartTimeAssignment
{!myVariable_waitStartTimeVariable} Equals {!$Flow.CurrentDateTime}
Result
{!myVariable_waitStartTimeVariable} = "12/20/2018 12:12 PM"


To me with error makes absolutley no sense, especially since the only fields we are dealing with are Date fields! (supposedly)
I work for a wealth management firm, and we use many URL hacks for starting new records with near 50 fields (trade order instructions, opportunities to new accounts, etc). Is there any other way than using a quick action to make it lighting ready? It's absolutely tedious to have to add all those fields into an action, not to mention the layout is then completely different than the record type/layout of the applicable object. I noticed that when attempting to use a preexisting URL hack in lighting, it does still pull up a window for creating the correct object, with all the fields and the correct layout, just nothing populating. Is there anything that combines these two functions that is lighting ready? This seems like such an obvious issue.
I have created a visual flow that collects all contacts that meet certain requirements, stores them in a sObject collection, preforms functions on the data in zip codes fields to shorten them to the first five digits, saves them in a new sObject collection, and then updates them all at once. 
This works perfectly if I preform the first lookup with either the specific contact ID, or using "Starts with" and then the correct first 5 digits of their zip code. 
HOWEVER, this flow is only useful if it works by automatically recording ALL contacts that have a zip code longer than 5 digits and then preforming the tasks just on those contacts. 

HOW can I do this? I can use 
-Equals
-Does not equal
-contains
-starts with
-ends with
-is null

PLEASE ADVISE 

So I have finally found the event creation object, and all the fields I need to fill in. These would include a start and end "Date/Time" field! First, this had me quite stumped because it would be way to easy if there was a "Date/Time" field within flow designer, but I finally figured out a formula to add a date field, along with a seperate string/time field. The problem is of course, the fact that the input isn't translated to GMT before being entered, so as soon as I enter the data, and then create the event, the times are COMPLETELY off of when they were scheduled! HOW do you simply create a start and stop time for an event/meeting using flows? 

 

PLEASE help! Thank you!

{!Last_Name}", "{!Nickname} IF({!Secondary_Nickname}="null", " " , " & " {!Secondary_Nickname} IF({!Last_Name}={!Secondary_Last_Name}, " " , {!Secondary_Last_Name}))


Basically I want Lastname, Nickname, and if there is a secondary nickname, add lastname nickname, unless they both have the same lastname, in which case exlude the second lastname. Does this make sense?

Hello Apex Developers!

I am a new employee at a wealth management first. Due to the type of industry wealth management is, fields ar changing and being updated quite often (lets say as an example, tax brackets in a drop down list). I have been blazing my way through TrialHead, and have REALLY been enjoying what I have found, and my mind is loving all the opportunites I now have to create solutions for the firm, especially in regards to work flows and APEX. Anyways, back to it...

So lets say tax brackets change, or a field is replaced with another. The firm in history has created a new field, run reports, and used data loader to update fields. However none of them ever new anything about Apex, and after going through trailhead, I can't help but see the simplicity and power of it. I am familiar with coding laguages, and know there must be a simple way to iterate through all accounts or contacts looking for a certain field and entry, and updating it and assinging it to the new updated field options. Yet is seems like this actually may not be that simple using apex. Am I supposed to use a batch function, or is there a way I can run loops?

I don't need the code handed to me on a platter, but I would really appreciate a solution framework as to how I could use apex to update these fields relatively easily. If "I" could find a solution as to how I could do this, it would be implemented a couple times a week, and save countless hours of hassle and frustration.

Thank you so much guys, let me know what you think!

- David

Hi,

 

i need to create a formula field to disply case age in HH:MM from Case created date.

 

Thanks in Advance

  • September 13, 2013
  • Like
  • 0