Skip to main content
Ashley Gray Mueller 님이 #Data Management에 질문했습니다
Hello,

 

I'm new to flows and my most recent one isn't consistently working right.

 

The flow generates 3 different types of warranty records (custom object) if a corresponding checkbox on the order is checked. The flow does correctly generate the 3 warranties but not always.

 

The 3 types of warranties are:

 

manufacture

 

software

 

extended

 

If there are 3 software warranties on the order it is supposed to generate one 3 year warranty. It is based on this formula in the flow:

 

{!GetOrder.Shipped_date__c} + 90 + if ( OR( ispickval({!Get_Order_Products.Product2.Family}, 'Software 1 annual maintenance'), ispickval({!Get_Order_Products.Product2.Family}, 'Software 2 annual maintenance'), ispickval({!Get_Order_Products.Product2.Family}, 'Software 3 annual maintenance')), {!Get_Order_Products.Quantity} * 365, 365)

 

 

 

'Family' is a custom picklist on the order object.

 

For example, if the order contains Software 1 annual maintenance product, quantity 3, it will generate one 3 year warrant based on the above formula. However, it only works if the order contains 2 or less products. If there are more than 2, it does create a software warranty but the formula uses the product quantity from a completely different product.

 

I discovered that in my Get Records of Order Product I had selected to store only the 1st record. I changed it then to store all the records automatically. But now I receive the following error:

 

"Error element null (null).

 

class java.util.ArrayList cannot be cast to class common.apex.runtime.SObjectRow (java.util.ArrayList is in module java.base of loader 'bootstrap'; common.apex.runtime.SObjectRow is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @56bca85b)"

 

I do not have a loop in my flow. Do I need to loop through every product? 
답변 6개
  1. 2020년 5월 20일 오후 5:44
    So the loop comes before first decision. Coonect your last element back to the loop so that it acts on each products one by one.

     

    So the loop comes before first decision. Coonect your last element back to the loop so that it acts on each products one by one.
0/9000