1

I have uploaded the custom add new form into SharePoint list. and I have tried the below PowerShell script for set as default add new form .

$listname = "List1"
$web = Get-SPWeb http://SiteUrl
$list = $web.lists[$listname]
$list.DefaultNewFormUrl="SiteUrl/ListName/NewForm.aspx"

but I got error :- Exception setting "DefaultNewFormUrl": "Unable to find an SPForm matching URL"

1 Answer 1

2

Try this:

$listname = "List1"
$web = Get-SPWeb http://SiteUrl
$list = $web.lists[$listname]
$list.DefaultNewFormUrl = $list.RootFolder.ServerRelativeUrl + "/NewForm.aspx"
1
  • It's not working for me.it throws same error.but the list URL location is correct.suggest an another idea.
    – PGP
    Commented Jan 5, 2017 at 5:02

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.