You need to sign in to do that
Don't have an account?
Not able to call flow From Apex code, Trying from Anonymous Block
Map<String, Object> myMap = new Map<String, Object>();
myMap.put('removedPartId ', 'a0L1500000Mjavp');
Flow.Interview.FindPRC findPrcFlow= new Flow.Interview.FindPRC(myMap);
findPrcFlow.start();
myMap.put('removedPartId ', 'a0L1500000Mjavp');
Flow.Interview.FindPRC findPrcFlow= new Flow.Interview.FindPRC(myMap);
findPrcFlow.start();
Do you get any error? I tried something by my side and made it work.
This is my code:
My advices:
1. Be sure that your variable removedPartId is the one you have in your flow, and it is well written. In my case, I also check the opportunityId value at the end to be sure it is well retrieved in the flow.
2. Double check the id. Does it exist?
3. Be sure your flow name is ok. FindPRC should be the UniqueName field
If your code is fine, let's check the Flow
1. Be sure your flow type is Autolaunched Flow otherwise you cannot call it directly from code.
2. Be sure that your removedPartId variable type is Text (for Ids) and also type is Input / output
Does it work?
All Answers
Do you get any error? I tried something by my side and made it work.
This is my code:
My advices:
1. Be sure that your variable removedPartId is the one you have in your flow, and it is well written. In my case, I also check the opportunityId value at the end to be sure it is well retrieved in the flow.
2. Double check the id. Does it exist?
3. Be sure your flow name is ok. FindPRC should be the UniqueName field
If your code is fine, let's check the Flow
1. Be sure your flow type is Autolaunched Flow otherwise you cannot call it directly from code.
2. Be sure that your removedPartId variable type is Text (for Ids) and also type is Input / output
Does it work?
Error is showing whille executing code from asychrous block :(
"System.FlowException: An unhandled fault has occurred in this flow An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information."
Also double check that your flow works if you click on Run button from the designer. Maybe there is something wrong in the flow itself.
Agustina