Developer forum

Forum » Feature requests » User Save notifications with context

User Save notifications with context

Nuno Aguiar
Reply

Hi,

 

It would be great if in the API we could determine the context on which the user is being saved:

 - Frontend vs Backend

 - User Management ; Intranet Extranet ; Newsletter v3

 - Custom development / Undetermined?

 

This would help us control the workflow and/or set more accurate alerts without the use of custom flags everywhere.

 

Nuno


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Nuno

 

Frontend vs. backend you can determine with Dynamicweb.ExecutingContext.IsFrontEnd

 

The others I do not quite understand?

 

BR Nicolai

 
Nuno Aguiar
Reply

Hi Nicolai,

 

Great about the frontend/backend context. I did not know that, sorry :(

 

As for the others, it was just a matter of understanding which module has triggered the Save. We have some situations where we would need to control differently if it was the Newsletter subscription or the Extranet module.

 

In backend, you can edit a subscriber in the Newsletter v3 module, and a user in the user Management. Being the same record/user, how can we tell which module performed the update?

 

Nuno

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

The easiest way would be to check if HttpContext.Current.Request.Url.PathAndQuery contains the string "Newsletterv3", ugly but it Works.

 

BR Nicolai

Votes for this answer: 1
 
Nuno Aguiar
Reply

Hi Nicolai,

 

Thinking outside the box (API)... nice :P

 

It works as of now, so that's perfect.

 

Thanks