Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Get the reason for a rollback of an action to the caller

$
0
0

Hi,

This is the scenario in my codeactivity (all try/catch context handling omitted)

protected override void Execute(CodeActivityContext context)
        {
                     // This causes a rollback, the caller of the action does not know why since message is not passed to caller
                    throw new Exception("My Exception");
            }

What happens is, that if I call the action which holds this codeactivity from c# (service.Exectute(MyActionRequest)
 I will get an AggretateException with no inner content that refers to "My Exception" in any way (that I could find).

So the caller will not be able to respond to different Exceptions and provide an appropriate feedback/logging.

Has anyone found a way to achieve a Rollback AND inform the caller why it happened?

BR

Gerhard


Viewing all articles
Browse latest Browse all 46379

Trending Articles