2

I am trying to explore this feature.I am doing a simple step : which check if object A is created or edited, it should insert reecords of change into Object B.

But i keep getting the below error: Problem is fields used is of same data type as Object A..and if not then thats a Text field to insert on. What would be your advice on this issue?

System.DmlException: Insert failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, The record couldn’t be saved because it failed to trigger a flow.
java.lang.IllegalArgumentException: unable to find field dataType for complex reference
unable to find field dataType for complex reference
Contact your administrator for help.: [] 13:00:50.653 (7653018638)|METHOD_EXIT|

1
  • 1
    Answered by OP but never marked as answered
    – Eric
    Dec 6, 2015 at 23:38

3 Answers 3

1

Here the issue was when you map the look up fields which were coming through quite an indirect relation-the process builder kept failing to map even if the datatype matched. Had to sort this by using a formula field-that holds the value from that relation. Then use this formula field in the mapping as an alternative.

4
  • Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question.
    – crmprogdev
    Jan 27, 2015 at 17:28
  • crmprogdev: i have added the answer only :) so that anyone trying the same can do a workaround that I applied in this case...
    – user10727
    Jan 28, 2015 at 14:48
  • Your post was flagged by the system as a "low quality post" because your answer is rather sparse. Perhaps you could elaborate with more detail on your solution for the benefit of others? More detailed answers are always very helpful when others are searching for solutions to their problems. Thank you.
    – crmprogdev
    Jan 28, 2015 at 15:03
  • @user10727- What about fields which are actually reference fields e.g Account lookup field ? Sep 27, 2016 at 12:44
1

Thanks to @user10727. I just thought I'd clarify or at least post my scenario. I was trying to access a field on product via opportunitylineitem:

opportunitylineitem.product2.my_field__c

I was able to get this to work by going through the pricebookentry

opportunitylineitem.pricebookentry2.product2
0

Create a field in the object getting the value of

test.isRunningTest()

's value to that field using "trigger.insert".

use that field value in your process builder criteria to trigger only if record is not created in test class.

We can call it 'process builder switch framework'😉😎

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .