1

Folks,

I have wrestled around this one for about one week.

I have a custom Parent Object where as soon as a button press happens, Status field on this custom object CH(C header) changes to processed. I want my rule(PB/Flow etc.)to fire when the CH.status==Processed, go to CL(C lines, basically similar to Opportunity Product lines), and check if any one of them have CL.Product2.Picklist ='picklist value'.... if yes, then go back to the CH(header)... and update the CH.IntegrationStatus='Ready'.

Is it achievable in a single PB, if yes how?

A. If I start from CH(modified or created)... I cannot choose any CL fields to check for the additional criteria... only CH fields are available as a criterion and CL are available for actions.

B. If I start from CL(modified or created)... it is not correct since CEL is never actually modified but CH is. Hence this logic itself is flawed to begin with.

C. I created a custom field at CL called CH's status ... created a PB to populate CL's status field every-time the CH status is changed to processed.. marking CL's record as modified and then using Step B. to check for CL.Product2.Picklist ='picklist value' {my criteria at CL) and then updating CH : CH.IntegrationStatus='Ready'.

So basically using 2 PBs, one to fire off a false 'modification' at line level when the status changes at header and other to check line level records and then update the CH.IntegrationStatus to ready.

This should have logically worked in theory but both of these PB ended up interfering with each other and now I am loss to understand how to even approach this problem.

1

I'm not 100% on this, but it sounds like you need a Rollup Summary Field. However, this has a minor twist because you also need to pull the product2 data down to the CL in order for the Rollup Summary Field to work. So...

Part 1

In your CL object, create a Process to copy the Product2.Picklist value to a text field on your CL object, on insert/update.

Part 2

In your CH object, create a Rollup Summary Field with a conditional count where CL.CopiedProduct2Value is whatever value you desire.

Part 3

In your CH object, create a Process that checks the Rollup Summary Field for a count greater than 0, and the Status is Processed, and then assign the value of Ready to the CH.


Realistically, I'd probably be tempted to accomplish this in code, because that's more moving parts than I'd want to use to use for something like this, but it's certainly doable. You just need two Processes, a custom text field, and one Rollup Summary Field, which isn't too bad. Note that you may also need to handle the situation where the Product2 value changes, if that affects the related CL items, but that's a story for another day...

  • thanks for this, make sense. For Part1, can I do a basic formula field to reside on the CL and get the Product2.Picklist value to a text field on your CL object? – Steve Mar 18 '18 at 20:38
  • @steve Rollup Summary Fields have limitations on what they can filter on. Last I checked, they couldn't filter on cross-object formula fields, hence the requirement to copy the value to the record's text field. – sfdcfox Mar 18 '18 at 20:40
  • Understood - makes sense. I will create PB on CL to fire off on insert/update and proceed with 2&3. Will get back to you on how it went. – Steve Mar 18 '18 at 20:43
  • I would prefer triggers, It gives more granular control. – Pranay Jaiswal Mar 18 '18 at 22:56
  • @PranayJaiswal: Do you have a sample code that I can start from? – Steve Mar 19 '18 at 2:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.