0

I have created Angular-6 Form & deployed to the SharePoint 2013 page (CustomForm.aspx). Provided navigation to the new page. Once form is filled & submit button is clicked, an item is created in the list. Till here I'm successful

Now, while editing the item in the list , I need to navigate to the CustomForm.aspx & populate all the details of that item in the form.

Basically, I need to use Custom Form for all the New,Dis,Edit items. How can this be achieved ?

Very Beginner in SharePoint & trying to explore the custom development

1 Answer 1

0

This is a very type of question. I will give you the basic idea to achieve this type of requirement. Follow below steps:

  1. While opening Display/Edit form, you can pass the item ID as a query string parameter with the SharePoint page URL.
  2. You can read this query string parameter in your Controller and fetch the SharePoint list item using REST API.
  3. Then you can bind the data on your view using Angular directives(which you must be knowing already).
  4. Similarly you can also send the form mode either New, Display or Edit as query string parameter with URL.
  5. Based on form mode you can render your angular form.
  6. If form mode is New, Then set blank values to your scope variables and show the normal blank form.
  7. If form mode is Display, then fetch the data using item ID, bind to form. And you can disable the fields using ng-disabled.
  8. If form mode is Edit, then fetch the data, bind to form fields.
  9. While submitting your data, you can call Add Item or Update Item functions based on your form mode.
6
  • Many Thanks ! What are all the concepts required for the point 1 & 2 ? Also , I tried changing the EditForm.aspx in SharePoint Designer but failed to link to the CustomPage.aspx.
    – Shivaay
    Commented Jul 11, 2019 at 15:41
  • Or you can just edit the EditForm.aspx page and Hide the existing web part on page and add your angular form in Content Editor web part. Commented Jul 11, 2019 at 16:22
  • In that case,how can I pass my query parameter to edit form ?
    – Shivaay
    Commented Jul 11, 2019 at 17:25
  • In that case you will get the item id as a query string parameter in EditForm.aspx?ID=itemID. Commented Jul 11, 2019 at 17:28
  • Apologies Ganesh ! Didn't get you. So, Basically I have one new form as of now. I need to create one more form for Edit & Display right ? Also, passing the item id to the form & how can I receive that ID in the form & make http request to fill all the item fields ?
    – Shivaay
    Commented Jul 11, 2019 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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