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:
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
businessobject GenericMDR{
[Label("Type")]
element Type: GenericMDRTypeCode;
[Label("Operation")]
element Operation: GenericMDROperationCode;
action Execute;
}
...
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 { }
}
NodeID | Type | Operation |
---|---|---|
1 | TICKET | UPDATE_ALL |
2 | TICKET | UPDATE_TICKETS_BASED_ON_CUSTOM_LOGIC |
3 | ACCOUNT | CLEAN_ANY_FIELD |
4 | BOMB | ACTIVATE |
Best regards,
Alexandre Kaminagakura \o/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 | |
2 |