Custom object not bringing associated records with it when assigned to a new record

  • 1
  • Question
  • Updated 5 years ago
Archived and Closed

This conversation is no longer open for comments or replies and is no longer visible to community members. The community moderator provided the following reason for archiving: Fixed Bugs, Redundant Posts

We have a custom object called Processes we assign Products to these processes. When they get assigned to a process SF creates an instance of these products and they become Process Products. I have created a Skuid page to better display locations with the processes but when I add processes from our Process Library it does not bring the associated Process Products with it. 

Below I am showing screen shots of how I add the Processes to a location. I think I am missing something that connects the products as well. 

Photo of Megan Vaughan

Megan Vaughan

  • 872 Points 500 badge 2x thumb
  • frustrated

Posted 5 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,678 Points 20k badge 2x thumb
The act of creating a new process instance record for a particular location will not automatically  bring all the related products that are identified as children of the process.   This additional step is probably going to require more than can be done with the Action Framework.  I think some additional code will be needed. 

There are some extra stesp that need to happen when you are Adding a process to a location. 
1. You need to query the products associated with the process in context.   This can be done using the action framework. 
- Create a Product model with a condition on process that is filterable / default off.  
- Then using the action framework Activate a condition and set its value with the particular process.  
- Finally Requery the model)

2. You need to create a new record for each of the products that were returned in step 1.  These need to be placed in a junction object between the Process Instance and Product objects.   This is the custom code.   You will be replicating some of what is done in this tutorial on mass creating records:

There may be some additional wrinkles in your data model that don't dawn on me right now.  But that's the sketch. 

This conversation is no longer open for comments or replies.