0

I am currently using SharePoint to set up a vacation request system. I have created the following lists

Vacation Request

Vacation Request Dates

Vacation Request history

On the NewForm for Vacation request, I have created a button that pop's up the NewForm for Vacation Request Dates to be able to add dates. I am trying to figure out once the user hits save to show those dates on the NewForm for Vacation Request the user is currently filling out.

What would be the best approach to solve this problem? Also, how would I tie those dates to that record? My thought for setting up a Dates list was so they could choose a different category for separate days in the request.

Thanks

0

I'd consider creating simple UI that pops up from the "Vacation Request" form, and that popup contains custom CSOM code that adds item to Dates list.

After that you don't even need to query Dates list for the latest item as you should already know what dates the user defined, and can show those on the NewForm of "Vacation Requests".

Or if you want to use OOB NewForm of the Dates list, you could query for the latest item created by current user after popup closes via REST call to URL such as

_api/web/Lists/GetByTitle('LIST_TITLE')/items?$top=1&$select=VacationStartDate,VacationEndDate&$orderby=Created%20desc&$expand=Author&$filter=Author/ID eq USERID

USERID for current user is quickest to get from _spPageContextInfo.userId already available on page.

0

In Vacation Request list, we can create two date columns("Vacation Date From", "Vacation Date To"), and using those two columns to store the vacation date.

If you want to split the Vacation Request Dates in a list, we can create a lookup column(allow multiple) in the Vacation Request list.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.