SOLVED

How to render a link to the newform.aspx in SPFx?

Iron Contributor

Hi,

I have created a webpart that render the content of a list using the DetailList component.
Now I want to create a link to the NewForm.aspx so when a user click on it get sended to the new item form.

The link needs to be dynamic. The webpart can be used with diferent lists so I can´t hardcode the link.

How can I do it?

Best regards,
Americo

1 Reply
best response confirmed by Americo Perez (Iron Contributor)
Solution

@Americo Perez 

 

You can build the link like this:

https://<tenant>.sharepoint.com/sites/<site>/_layouts/15/listform.aspx?PageType=8&ListId=<listID>&RootFolder=/sites/<site>/<list name>&Source=<url to redirect after submit>

1 best response

Accepted Solutions
best response confirmed by Americo Perez (Iron Contributor)
Solution

@Americo Perez 

 

You can build the link like this:

https://<tenant>.sharepoint.com/sites/<site>/_layouts/15/listform.aspx?PageType=8&ListId=<listID>&RootFolder=/sites/<site>/<list name>&Source=<url to redirect after submit>

View solution in original post