function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RupBRupB 

Best Practices - Orders/Parts Deliveries attached to cases, for Customer Service

Hi,

We are Customer Service professionals, SF partners and developers. I would like your feedback about best practices around the following subject :

 

UseCase :

We have Cases, and Order Requests for spare parts to be sent to field technicians for maintenance.

Every evening, these Order Requestsare input manually into the ERP.

2-3 times per day, the ERP sends to Salesforce (we use Data Loader) the status of each Order and, when delivered, each Order Delivery (== Asset).

Orders have a master-detail relationship to order Lines, just like Opportunity and OpportunityLineItem. Orders are related to 1 and 1 only Case.

In the ERP, Orders are created for a given Case; CaseNumber is input in an attribute of the Order. The interface from ERP to Salesforce looks forthe CaseNumber as uniques external id to associate the Order to the right case. Sometimes, Case Numbers are badly input into the ERP, and the interface will not be able to find the right Case.

We also do roll-up of amounts ($) from OrderLine to Order, and from Order to Case.

 

Question :

In our implementation, we did not create a Master-Detail relation between Case and Order, so we cannot do roll-ups with the standard Salesforce mechanism. So we do that with triggers.

What are the pros and cons of having a Master-Detail Case-Order relationship vs. a normal relationship in our situation ?

Cons of our choice today : complex triggers, hitting Apex limits sometimes. Pros of the other choice : nice and easy-to-maintain roll-up fields.

Pros of our choice : can handle Orders not assigned to Cases. Would this still be the case in a Master-Detail relationship scenario ?  Could we not, in such a situation, just attach such Orders to a 'Unknown CaseNumber' Case ?  In the interface, could we create Orders before attaching them to Cases ?  What would the behaviour of the interface be, step by step ?

And the crunch : would it me complicated to migrate to the new design, if it is a better solution for us ?

 

Thanks for your advice,

Rup

shillyershillyer

 In response to your questions:

Question :

In our implementation, we did not create a Master-Detail relation between Case and Order, so we cannot do roll-ups with the standard Salesforce mechanism. So we do that with triggers.

What are the pros and cons of having a Master-Detail Case-Order relationship vs. a normal relationship in our situation ?

Cons of our choice today : complex triggers, hitting Apex limits sometimes. Pros of the other choice : nice and easy-to-maintain roll-up fields.

Pros of our choice : can handle Orders not assigned to Cases. Would this still be the case in a Master-Detail relationship scenario ?  Could we not, in such a situation, just attach such Orders to a 'Unknown CaseNumber' Case ?  In the interface, could we create Orders before attaching them to Cases ?  What would the behaviour of the interface be, step by step ?

And the crunch : would it me complicated to migrate to the new design, if it is a better solution for us ?

 

There's a great overview in help, but the main advantages of Master-detail relationship are simplicity in use, referential integrity (how data deletion is handled), data ownership and security. With that said, the user experience is very similar, but as you mentioned, the master is always required, so you will need to account for that.

 

In terms of migrating, there are some steps you need to follow to ensure success. These two help pages provide some good information when changing relationships.

 

Link 1

Link 2

 

Hope that helps,

Sati

 

 

 

 

Gregory BarrettaGregory Barretta
Out of curious, what made you create a custom object called "order request" vs using the native opporunity object. We have a similar use case.