Reputation: 21
I am using visual studio 2019, to create a SharePoint add-in running on the server.
I am working on a simple form. When the status field is set to reject the workflow should send an email to the creator informing them so they can make the required changes for approval. In the workflow I use GetDFynamicProperties to get the "Created by" field. This should return an int32 that can later be used by LookupSPUser to get the user's email. Unfortunately, "Created by" is returning a 0 which causes LookupSPUser to fail and the workflow to exit/crash.
Above you see the user lookup I am using. "TQM Service Request" is the name of the list that contains all the fields for the form. All 3 "Assign To" fields are int32. The step below sends an email with the 3, for debugging, so I know all 3 end with a value of 0. Any thoughts on why "Created by" returns 0?
Upvotes: 0
Views: 39
Reputation: 21
I have an answer that no one will like. I suspect the SharePoint team changed something because I changed nothing and suddenly the code started working as designed. Now when the status is set to rejected the userID variable is populate with an int32 value and that value is used by LookupSPUser to get the email of the person who completed the form and that person receives an email notification stating they need to update the form. If I ever find out what the sharePoint team changed, I will post it here. The SharePoint team told me I should start over using SharePoint designer.
Upvotes: 0