1

When a record is deleted while offline, how can I filter it out of subsequent Get Record flow elements? Our most common use case for deleting records is removing Product Consumed records via the Products tab interface on Work Orders. If we run a flow that queries for Product Consumed records, the removed lines are returned as well.

We have a flow called from a Field Service Mobile App Extension scoped to the WorkOrder object. In this flow, there is a Get Records element querying ProductsConsumed where WorkOrderId==WorkOrder.Id. Primarily, we'll be removing ProductsConsumed records offline that were also added offline, all via the Products tab in the Field Service Mobile app's WorkOrder screen.

How do we prevent this?

  • Welcome to SF.SE. Would you clarify your question please? You mention a record being deleted off-line but don't tell us if it was created off-line, on-line or synced with the server after deletion off-line. You mention a flow. Does the run client side only from a component? How is the record deleted and the server updated? Those kinds of details are needed to answer your question. – crmprogdev Sep 14 '19 at 13:18
  • Thanks! And apologies for the vague question. We have a flow called from a Field Service Mobile App Extension scoped to the WorkOrder object. In this flow, there is a Get Records element querying ProductsConsumed where WorkOrderId==WorkOrder.Id. Primarily, we'll be removing ProductsConsumed records offline that were also added offline, all via the Products tab in the Field Service Mobile app's WorkOrder screen. – K. Langston Sep 16 '19 at 15:43
1

I'd recommend you add a custom field to ProductConsumed called IsDeleted__c that's a boolean checkbox and create an action or component that executes offline which causes IsDeleted__c to be set to true whenever the ProductConsumed is deleted from the Work Order (whether it be from the WorkOrderLineItem or elsewhere).

Then, alter the query in your Get Records element to only include ProductConsumed where IsDeleted__c == false (alternatively IsDeleted__c != true) in what's returned.

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.