Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

INTRODUCTION

Hello there!

In this document I'll try to explain a way to create mass updates taking advantage of the MDR structure. Only one "reusable" MDR is needed. I created this approach because:

  • At a certain point, you always have to update a lot of things that you can't do using the available tools.
  • Workflows cannot be scheduled to run every day, every week etc.
  • I don't want to create one MDR for any operation I want to perform.
  • All the logic is in the code, so you can do a lot of things.

My intension here is not explain how to create a MDR. There are many posts and documents explaining it. I'm focused in a different way of using it.

This "trick" helped me many times to update values and perform complex tasks in C4C and, eventually, no deploy is needed.

I'm still learning C4C development and I'm sorry if I wrote something wrong and for my english grammar mistakes. I hope you like it and, if necessary, please leave a post to correct me.

CREATING THE MDR

  • Create a BO named GenericMDR.bo.
  • Create the elements Type and Operation.

    • Both elements should be codelists.
    • Type represents any entity you want (ex.: TICKET, ACCOUNT, OPPORTUNITY etc).
    • Operation represents any operation you want to be applyed over the entities (UPDATE_ALL, UPDATE_TICKETS_BASED_ON_CUSTOM_LOGIC etc).

businessobject GenericMDR{

[Label("Type")]

element Type: GenericMDRTypeCode;

[Label("Operation")]

element Operation: GenericMDROperationCode;

action Execute;

}

  • Create an action named Execute.
  • In Execute action, add code for each combination of Type x Operation.

...

switch (this.Type)

{

case "TICKET"

{

switch (this.Operation)

{

case "UPDATE_ALL"

{

/* Add code to update all tickets, for example. */

}

case "UPDATE_TICKETS_BASED_ON_CUSTOM_LOGIC"

{

/* Add code to update tickets based on any logic, for example; */

}

...

default { }

}

}

case "ACCOUNT"

{

switch (this.Operation)

{

case "UPDATE_ALL"

{

/* Add code to update all accounts, for example. */

}

case "CLEAN_ANY_FIELD"

{

/* Add code to clean some specific field, for example. */

}

...

default { }

}

}

case "BOMB"

{

switch (this.Operation)

{

case "ACTIVATE"

{

/* Add code to update any object or perform any task. It can be edited directly in PRD using correction for emergencial updates (Be careful, with great power comes great responsibilities. Test a lot before running in production =P ) */

}

default { }

}

}

...

default { }

}

  • In GenericMDR.bo, create a query named QueryByTypeAndOperation for the MDR (Type and operation must be used as selection parameters and result).
  • Create the MDR for GenericMDR.bo.
  • Create the MDR screens.
  • Add values to GenericMDR.bo with the combinations you want, using webservices, fileinput or any other method you prefer. For example:

NodeIDTypeOperation
1TICKETUPDATE_ALL
2TICKETUPDATE_TICKETS_BASED_ON_CUSTOM_LOGIC
3ACCOUNTCLEAN_ANY_FIELD
4BOMBACTIVATE

  • Add permission to access the MDR workcenter.
  • Access the MDR workcenter and create one instance for any combination of Type x Operation.
  • Schedule all the instances. For example:
    • TICKET with UPDATE_ALL will run every day at 3 am.
    • ACCOUNT with CLEAN_ANY_FIELD will run every mouth.
    • BOMB with ACTIVATE will run immediately.

Best regards,

Alexandre Kaminagakura \o/

5 Comments
Labels in this area