• Adam Erskine
  • NEWBIE
  • 0 Points
  • Member since 2016
  • Salesforce Business Analyst
  • HealthSavings Administrators

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Hello all,

I have a Custom Metadata type that stores records that are equivalent to "Tasks" and contains a few fields that hold criteria text for when these tasks should be created. 

In my Flow, I have a Get request for all Metadata records that match the input criteria, and then I loop through those Metadata records and assign each to a Task sObject variable and add them to a collection of Tasks for insert.  I include the Metadata Id field on a task field when I insert them.  This all works well.

The issue happens when I try to remove duplicate values from the Metadata because the Tasks are ALREADY EXISTING...

Here is what I tried to do:
  1. Find all the existing Tasks on object
    1. Get all Tasks
    2. Add to sObject Record Collection Variable (ExistingTasks) and capture Task Field "Metadata_Id__c" which = the SF Id of the Metadata
  2. Loop through ExistingTasks to get collection
    1. Each record is called ThisExistingTask
    2. Assign ThisExistingTask.Metadata_Id__c to a sObject Record Variable called ThisMetadata
    3. Add ThisMetadata record to a sObject Metadata record collection variable called ExistingMetadata
  3. Use the input criteria to Get the new Metadata
    1. Get Metadata records that meet the input criteria
    2. Add these to a Collection callend NewMetadata
  4. Loop through ExistingMetadata collection to remove from NewMetadata
    1. For each record in ExistingMetadata collection called ThisExistingMetadata
    2. Use an Assignment node to "Remove All" ThisExistingMetadata from collection NewMetadata
  5. //do more stuff

However, the Remove All assignment node is not removing the sObjects from the NewMetadata collection as I would anticipate.  

Can anyone please help?

Thanks,
Adam


 
Hello all,

I have a Custom Metadata type that stores records that are equivalent to "Tasks" and contains a few fields that hold criteria text for when these tasks should be created. 

In my Flow, I have a Get request for all Metadata records that match the input criteria, and then I loop through those Metadata records and assign each to a Task sObject variable and add them to a collection of Tasks for insert.  I include the Metadata Id field on a task field when I insert them.  This all works well.

The issue happens when I try to remove duplicate values from the Metadata because the Tasks are ALREADY EXISTING...

Here is what I tried to do:
  1. Find all the existing Tasks on object
    1. Get all Tasks
    2. Add to sObject Record Collection Variable (ExistingTasks) and capture Task Field "Metadata_Id__c" which = the SF Id of the Metadata
  2. Loop through ExistingTasks to get collection
    1. Each record is called ThisExistingTask
    2. Assign ThisExistingTask.Metadata_Id__c to a sObject Record Variable called ThisMetadata
    3. Add ThisMetadata record to a sObject Metadata record collection variable called ExistingMetadata
  3. Use the input criteria to Get the new Metadata
    1. Get Metadata records that meet the input criteria
    2. Add these to a Collection callend NewMetadata
  4. Loop through ExistingMetadata collection to remove from NewMetadata
    1. For each record in ExistingMetadata collection called ThisExistingMetadata
    2. Use an Assignment node to "Remove All" ThisExistingMetadata from collection NewMetadata
  5. //do more stuff

However, the Remove All assignment node is not removing the sObjects from the NewMetadata collection as I would anticipate.  

Can anyone please help?

Thanks,
Adam


 
Hello
I am working on a flow and one of the things it needs to do is query PriceBookEntry. For some reason the fast lookup is not finding any records, but when I test the same query with soql executed on workbench the record is found. I'm a bit stumped on what to do next. So hopfully someone out there has some ideas. 

Here is excerpt from the debug email that shows what the fast lookup is doing:
FAST LOOKUP: Get_Standard_PBE_PP
Find all PricebookEntry records where:
Platform__c Equals {!Pureprofile} (Pureprofile)
Pricebook2Id Equals {!varQuote.Pricebook2Id} (01s90000004YFPxAAO)
CurrencyIsoCode Equals {!varQuote.CurrencyIsoCode} (AUD)
Incidence_Rate__c Equals {!formulaIncidenceRate} (10.00)
Length_of_Interview__c Equals {!Length_of_Interview2} (20)
Assign those records to {!sovPBEM}.
Save these field values in the variable: Id
Result
Failed to find records.

And here is the soql that actually finds the record
SELECT 
    Id, 
    name, 
    currencyisocode 
FROM PricebookEntry 
where 
    Length_of_Interview__c = 20 and 
    Incidence_Rate__c = 10.00 and 
    Platform__c = 'Pureprofile' and 
    Pricebook2id = '01s90000004YFPxAAO' and 
    CurrencyIsoCode = 'AUD'