Sharepoint ItemAdding & ItemAdded issue - events

I need to retrieve an Infopath File, which is displayed and filled in on a sharepoint webpage, and save it's data to a seperate DB. There are 2 events that fire once the form is submitted. ItemAdding and ItemAdded.
I know that I can not retrieve the file from the ItemAdding Event because it only gets saved after the ItemAdding Event.
But I want to redirect users to a different website once I have stored my values to the database, but I find no way to do this. I guess, the problem is that the ItemAdded event occurs, after/or at the same time as the user gets redirected to the webpage showing "The form has been closed".
How can I retrieve the values and redirect the user? Also, I am not allowed to attach code to the infopath form itself. This needs to be handled from Sharepoint.
Thank you

If you are redirecting within the SharePoint site you can include "source" as a query string parameter.
You also try a response.redirect in the OnClose event of the infopath form.

Related

Slack API: Is there a way to determine which user clicked on a button in an interactive message?

I am new to Slack's API, so bear with me. I have a slack button that contains a simple webhook link which, when clicked, updates a record somewhere on my site. However, I need to determine which user clicked the button and send this info back to my site in order to fill out an updated_by field with the user's name. The only way I see to do this is to somehow update the post request body with a variable containing the user's name?
You need to handle interaction with the buttton.
https://api.slack.com/reference/interaction-payloads/block-actions
The payload received contains the SlackId of the user who clicked the button.

Passing description from browser in elsa

In document workflow, after I reject/approve the document in the mail, I want it to take to the browser where I can add a comment in the comment box and then pass that comment back to the employee through email. How can it be done?
I have tried adding comments in console and pass it through mail.How can it be done in UI designer?
#vahidnaderi is spot-on:
In the workflow from where you send the email containing the approve/reject link(s), have these links point to a custom webpage you create.
This webpage contains 3 fields and a submit button:
A radiolist with an "approve" and "reject" radiobuttons
A "comments" textarea.
A "workflowinstanceid" hidden field that stores the workflow instance ID.
When the form is submitted to your backend application, you trigger a signal ("approve" or "reject") for the appropriate workflow instance ID and provide the comment as input.
Your workflow will resume and the received comment will be available as input to the first activity that comes after the "signal received" activity.
That activity should either be the "send email" activity or a "set variable" activity in case you want access to the received comment later in the workflow.
From the "send email" activity, you can now access the comment you wish to include with the email.
Obviously, you're completely free to do things differently. For example, perhaps you want a separate page for "approve" and another page for "reject".
The key takeaway here is that you provide your own web UI. This web UI then interacts with your application backend (i.e. by submitting a form to a controller), which then interacts with Elsa services to e.g. trigger workflows.

MVC4 Remote Validation clashes with submit button

I have a remote validator setup on my text box which primarily checks if the data that the user enters is unique. I do understand this works on mouse out of the original control and does an AJAX call for the same.
My problem is that while this works fine while am tabbing between controls on my form containing like 6 other controls, if I am directly clicking on the submit button on my form, the request does not go across since the AJAX call for the remote validation is in progress, and the user would in this scenario have to click on the submit button twice to actually save the form.
Anyone come across this scenario?
I would suggest, leave your button disabled; and only enable if all of your validations have been passed. This way, your button will only be enabled once you have got the response back from the remote validation.

Kendo Upload Control: Save upload response within Control

I am new to Kendo UI Controls, and i have a question.
Currently I am using the upload control within a form to upload files to a API Service. This service returns an ID of the sent file, which must be sent at the moment of saving the whole form.
Is it possible to save the returned ID within the Upload Control and access that information at the moment of posting the form, or does that information has to be stored in a different field, at the success event handler?
Thanks in advance

Ajax & ASP Classic Notification Display

I'm doing some updates for an intranet i created few years ago using ASP Classic. What i've been ask to do is to ALERT all users when news on intranet is added. Basically i need to check on database when news is added and than trigger an action to all intranet users saying you have New Message
I'have done a lot of research on this and i could't really find a good example for it.
Your help will be much appreciated.
Cheers
Vullnet
Basically to need to poll the server using AJAX and check for new messages.
I suppose you have a messages table with and ID that counts up. You need to track each user's last message pointer, and send this as part of your AJAX request ad a parameter. If the server's ID is higher thsn the user's then they have a new message.
Based on the AJAX response you then alert the user.
You need to make an ASP that responds to your AJAX call, Pass it a number and it responds with "OK" (not new) or "NEW".
IT works the same way, regardless of the server-side language. Use jQuery to perform your AJAX calls.

Resources