Forms designer forms provision

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

10 Nov 2017

Hello, Dikesh!
Not sure what the problem with 4th parameter is - you are talking about FormType right?
When you run this command, you get enumerator which has these parameters:

Code: Select all

$srv = New-WebServiceProxy -Uri $serviceUrl -UseDefaultCredential -Namespace "myTest" -Class "FormsDesigner"
It's stored in here:

Code: Select all

$namespace = $srv.getType().namespace;
Cheers

Dikesh310
Posts: 6
Joined: Wed Nov 08, 2017

13 Nov 2017

Hi Nikita,

Yes. I am talking about form type i.e.: 4th parameter. In C#, I can able to access form type using namespace. But in PowerShell it's not working. I am trying to access form type using below code:

Code: Select all

$srv = New-WebServiceProxy -Uri $serviceUrl -UseDefaultCredential -Namespace "myTest" -Class "FormsDesigner"
$namespace = $srv.getType().namespace;
$formType = New-Object ($namespace + ".Forms.New");
It gives below error:
Cannot find type [myTest.Forms.New]: verify that the assembly containing this type is loaded.

Dikesh310
Posts: 6
Joined: Wed Nov 08, 2017

14 Nov 2017

Hi everybody,

Finally I found solution to publish forms using PowerShell. :D

Please see my code as below:

Code: Select all

$srv = New-WebServiceProxy -Uri $serviceUrl -UseDefaultCredential -Namespace "FormsDesigner.Data"

$result = "false"
$resultSp = "false" 

$namespace = $srv.getType().namespace;
$formType = New-Object ($namespace + ".Forms");

$srv.PublishForms($listID, $contentID, $groupID, ($formType.GetType()::New), $true, $formValue); #Change Form type(New, Edit, Display)
$srv.Dispose();
Thank you.

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

14 Nov 2017

Great to hear it! Thank you for the code, will be very useful as an example in the future. :)
Cheers

Dikesh310
Posts: 6
Joined: Wed Nov 08, 2017

17 Nov 2017

Hi Everybody,

I can able to publish forms in site using web service and PowerShell. But if I am trying to publish in sub site, it will not published.

For example, my site url is http://spfoundation:1111/abc/ and I am going to publish forms in list on site ABC then it will not be published.
It always gives "List does not exist" error.
Any help would be appreciated!

Thanks.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests