# How to lunch a stored procedure if a condition is met

**URL:** <https://forum.radzen.com/t/how-to-lunch-a-stored-procedure-if-a-condition-is-met/4626>\
**Category:** Blazor Server\
**Created:** [August 13, 2020, 9:51pm UTC](https://forum.radzen.com/t/how-to-lunch-a-stored-procedure-if-a-condition-is-met/4626 "2020-08-13T21:51:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ricardo\_Wallace](https://forum.radzen.com/user_avatar/forum.radzen.com/ricardo_wallace/32/4099_2.png) [@Ricardo\_Wallace](https://forum.radzen.com/u/Ricardo_Wallace)\
**Post date:** [August 13, 2020, 9:51pm UTC](https://forum.radzen.com/t/how-to-lunch-a-stored-procedure-if-a-condition-is-met/4626/1 "2020-08-13T21:51:08Z")

</div>

Hello,  
So I just need to be able to check if the created user has a certain role, if it does then it should just lunch the stored procedure when the user is saved, is there any way to make this?

 ![image](https://forum.radzen.com/uploads/default/original/2X/3/3a9965226e43176f76c436e8447cb15d54ebe424.png)

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [August 14, 2020, 4:21am UTC](https://forum.radzen.com/t/how-to-lunch-a-stored-procedure-if-a-condition-is-met/4626/2 "2020-08-14T04:21:00Z")

</div>

More info can be found in this articles:

> **[Event handling](https://www.radzen.com/documentation/blazor/event-handling/#conditions)**
>
> Handle page and component events in Radzen Blazor applications.

  

> **[Security API | Blazor](https://www.radzen.com/documentation/blazor/security-api/#isinrole)**
>
> Radzen security API in Blazor Applications

---

<div class="post-metadata">

**Author:** ![Ricardo\_Wallace](https://forum.radzen.com/user_avatar/forum.radzen.com/ricardo_wallace/32/4099_2.png) [@Ricardo\_Wallace](https://forum.radzen.com/u/Ricardo_Wallace)\
**Post date:** [August 14, 2020, 2:30pm UTC](https://forum.radzen.com/t/how-to-lunch-a-stored-procedure-if-a-condition-is-met/4626/3 "2020-08-14T14:30:54Z")

</div>

Thank you for your response very helpful articles, can you tell me if can lunch a stored procedure with the execute c# option or is it only with the invoke data source method? I don't need to get the stored procedure info back to the app I just need it to execute.

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [August 14, 2020, 2:51pm UTC](https://forum.radzen.com/t/how-to-lunch-a-stored-procedure-if-a-condition-is-met/4626/4 "2020-08-14T14:51:42Z")

</div>

Yes, you can do that.

> [@Ricardo\_Wallace](#):
>
> lunch a stored procedure with the execute c# option

To know more about the code of such custom method, check the code generated by Radzen for procedures without collections as return value.

---

<div class="post-metadata">

**Author:** ![Ricardo\_Wallace](https://forum.radzen.com/user_avatar/forum.radzen.com/ricardo_wallace/32/4099_2.png) [@Ricardo\_Wallace](https://forum.radzen.com/u/Ricardo_Wallace)\
**Post date:** [August 14, 2020, 5:00pm UTC](https://forum.radzen.com/t/how-to-lunch-a-stored-procedure-if-a-condition-is-met/4626/5 "2020-08-14T17:00:49Z")

</div>

I'm having trouble finding the code you mentioned, would you be so kind in to show me where they are?
