0

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"

2

Try this:

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

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.