Showing posts with label SharePoint. Show all posts
Showing posts with label SharePoint. Show all posts

Wednesday, 23 July 2014

Link multiple EditForms or DisplayForms to a sharepoint list

My listitems are opened via an infopath form. Client wants a second aspx form to open the listitems.
(the infopath form only shows a subset of the fields but the aspx form shows all fields).

When opening the aspx form, sharepoint redirects me to the infopath form. Somewhere, a redirect was taking place.
After a lot experimenting, I found that not only do you need hide the original List Form Web Part but you also need to set the ControlMode to Display. Here are the 2 lines of code that need to be modified in the original List Form Web Part:
Change:
<ControlMode xmlns=”http://schemas.microsoft.com/WebPart/v2/ListForm”&gt;Edit</ControlMode>
To:
<ControlMode xmlns=”http://schemas.microsoft.com/WebPart/v2/ListForm”&gt;Display</ControlMode>
Change:
<IsVisible>true</IsVisible>
To:
<IsVisible>false</IsVisible>

Thursday, 1 May 2014

SharePoint Designer Cache Locations

  • %APPDATA%\Microsoft\Web Server Extensions\Cache
  • %USERPROFILE%\AppData\Local\Microsoft\WebsiteCache

Wednesday, 11 December 2013

SharePoint: Assign Values to the Taxonomy Field

  TaxonomyFieldValue TenderNO = item["Tender No"] as TaxonomyFieldValue;
   TaxonomyField taxonomyField = newWeb.Lists[i].Fields["Tender No"] as TaxonomyField;
                               

                                    try
                                    {                                      
                                        taxonomyField.DefaultValue = TenderNO.ValidatedString;
                                    }
                                    catch
                                    {
                                     
                                        taxonomyField.DefaultValue = String.Empty;
                                    }
                                    taxonomyField.UserCreated = false;
                                    taxonomyField.Update(true);







Monday, 9 December 2013

Changing CPUExecutionTime is having no effect

I see someone is having this problem, because they miss this statement

$uc.ResourceMeasures.Update()



==================================================
# Give our sandboxed solution more resources.
# Worker Process Timeout
$wpe = "900"
# CPU Timeout
$cpu = "900"
# Grab the User Code Service
$uc=[Microsoft.SharePoint.Administration.SPUserCodeService]::Local
# Output current values
Write-Host ""
Write-Host "Current worker process execution timeout is:" $uc.WorkerProcessExecutionTimeout "seconds" -foreground cyan
Write-Host "Current CPU execution timeout is:" $uc.ResourceMeasures["CPUExecutionTime"].AbsoluteLimit "seconds" -foreground cyan
Write-Host ""
Write-Host " ***UPDATING***"
Write-Host ""
# Update worker process execution timeout
$uc.WorkerProcessExecutionTimeout = $wpe
# Update CPU execution time
$uc.ResourceMeasures["CPUExecutionTime"].AbsoluteLimit = $cpu
$uc.ResourceMeasures.Update()
# Update User Code Service
$uc.Update()
# Output new values
Write-Host "New worker process execution timeout is:" $uc.WorkerProcessExecutionTimeout "seconds" -foreground green
Write-Host "New CPU execution timeout is:" $uc.ResourceMeasures["CPUExecutionTime"].AbsoluteLimit "seconds" -foreground green
Write-Host ""
Write-Host "Now go and restart the sandboxed code service on all servers!!!"
Stop-Service SPUserCodeV4
Start-Service SPUserCodeV4