Site Templates

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Office365Guy
Posts: 21
Joined: Sun Feb 24, 2019

18 Oct 2019

We are using powershell scripts to correct CSL's post template deployment, working like a charm. We were wondering if we could also correct the Related Items Controls in the same fashion. This is for CSL's and RIC's connected to lists in the same site. The controls function fine if they connect to lists on others sites.

Thanks again!!!

Office365Guy
Posts: 21
Joined: Sun Feb 24, 2019

18 Oct 2019

maybe something like this, we could find each list, loop files with the correct names and update each? I have used this is the past for HTML files in the site and the forms are text files like HTML.

Start-SPAssignment -Global
$web = Get-SPWeb "http://sharepointdev:90"
$list = $web.Lists.TryGetList("Site Pages")
foreach ($file in $list.RootFolder.Files)
{
if ($list.ForceCheckout) { $file.CheckOut() }
$html = [System.Text.Encoding]::ASCII.GetString($file.OpenBinary())
$html = $html.Replace("p", "P")
$file.SaveBinary([System.Text.Encoding]::ASCII.GetBytes($html))
if ($list.ForceCheckout) { $file.CheckIn() }
}
Stop-SPAssignment -Global

User avatar
mnikitina
Posts: 264
Joined: Wed Jun 05, 2019

21 Oct 2019

Office365Guy,

There are no special services to work with Related Items specifically, but you should be able to work with children items/documents with regular Powershell commands.

If you need something specific, could you please provide more details.

Office365Guy
Posts: 21
Joined: Sun Feb 24, 2019

21 Oct 2019

This is in reference to creating a site template and repairing the related items that connect to the same site. I found if I open the forms exported .xfds file in Notepad and replaced the few references to the site, like the "SiteRelativeUrl=", then import and save the form the Related items work within the new site. We would like to edit these files live on the SharePoint site instead of exporting, editing, importing and saving to cut time in the process. This idea came from the powershell script that is used to fix the same issue with the Cross Site Lookups.

User avatar
mnikitina
Posts: 264
Joined: Wed Jun 05, 2019

22 Oct 2019

Office365Guy,

To change the file you need to export it first. So you need to export .xfds file, change the required fields and import file back. And this can be done with Powershell.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests