We’re at the beginning of our journey migrating to NAC. There are a couple sticking points. Including one that was made by a consultant years ago. While I’m a developer, I’m not a JavaScript guru. So I’m having trouble transposing things over and while I can handle small chunks, putting it all together in a secure, and functional manner is eluding me.
It also doesn’t help that now that we’ll be going outside SharePoint more, some of this seems like it’ll require more complexity. For example, authentication will require more than just referencing the logged in user.
To start, each classic form has approve/reject, JavaScript calling, buttons that only appear for the current approver. And a reference to the task list associated with the form/SP list.
Those open up a modal window that passes along approve or reject, along with any comments (comments I’m pretty sure won’t even be possible, but that’s a future problem). Where it’s passed to? A click function associated with the modal’s submit button and initialized on “document ready.”
That click grabs the current list ID and item ID from the URL (using another function for parsing). And then passes all 4 items into the main “updateTaskItem” method.
updateTaskItem first sets up a SP ClientContext. Then grabs the relevant task list, current user, etc. Then queries (executeQueryAsync) the task list (CAMLQuery) for anything matching the current user, “Not Started” status, etc. And finally executes another s...]queryAsync to update the task. And finally call one of two separate functions depending on whether is succeeded or failed.
I assume the old consultant who’s long gone didn’t make this up from out of nowhere. But I also haven’t seen anything like it in my searches. And now I have to convert it to work with NAC…
Any help, tutorials, libraries, guidance, etc. would be greatly appreciated.