So recently on one of our internal discussion aliases, somebody asked about how to have a master case with a number of “sub-cases.” This is handy when you have a number of issues like a service outage or patch that doesn’t quite apply as desired. J
So in thinking about the problem, I cheated… In class 8525A, we have a tutorial that teaches you how to Clone a Contact. After thinking about it for a few minutes, what is really the business issue? So you want the ability to create a number of cases quickly and tie them all back to a master case.
So to meet this need, here where a few things I did to give you an idea how to do you could do this for a customer. Again, this is inspiration, not a step by step instruction manual. I would better term this as “Demo Ware.” Your actual mileage may vary. Code is available below in the attachments area. (Or clicking here.)
Picture of Master Case
Picture of Cloned Case
Now this should work out of the box. If you have additional fields and you want to modify this and you don’t want to read the comments, here is a line:
new_masterticketnumber.DataValue = oSource.ticketnumber.DataValue;
So in this case new_masterticketnumber is the field on the cloned case, where as oSource.ticketnumber.DataValue is the original case field. (So if you wanted the Title field to be copied, that line would look like:
title.DataValue = oSource.title.DataValue;
If you don’t a field mapped, simply comment that line out with “//” which will remove the field from the mappings.
This code will not work as is. You HAVE to create those two fields otherwise, you will get an error message.
This could also be handy in cloning quotes, opportunities, products and much more. What uses could you see for it?
Enjoy!
April 11th Update - Added Matt's Changes below