Blog

CSOM ISSUE format-default

On 21/02/2019

format-default : The collection has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.

 
$col = $oWeb.AvailableFields | Where {$_.InternalName -eq "TestCategories"}
 
$context.Load($listDoc.Fields);
$context.Load($col);
$context.ExecuteQuery();
 
$null = $listDoc.Fields.Add($col);
 
if $col is null because the field "TestCategories" does not exist in $oWeb.AvailableFields you've got this message

Managed Navigation Issue

On 31/01/2019

 

Impossible de se connecter à la banque de termes sur la navigation par méta données gérées

Managednavissue

Désolé... Nous n'avons pas pu créer l'ensemble de termes : Aucune connexion au service de métadonnées gérées par défaut n'a été spécifiée.

Settermstoreproperties

 

 

Sharepoint 2016 Register Javascript In Hive

On 24/01/2019

To register javascript file in 16/layouts

 

you should write with 15, sharepoint will translate it in 16 : <script type="text/javascript" src="/_layouts/15/testFDI/jquery.min.js"></script>

PowerShell Csom load property Issue

On 18/01/2019

Using  Microsoft.SharePoint.Client.dll  you can have issue after object loading

$file = $oWeb.GetFileByUrl($fileUrl);

$context.Load($file);

$context.ExecuteQuery()

$context.Load($file.ListItemAllFields)

$context.ExecuteQuery()

$file.ListItemAllFields #accessing to this property will thow exception below

format-default : The collection has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.

 

so you have to store property in a variable like that

 

$ListItemAllFields = $file.ListItemAllFields

$context.Load($ListItemAllFields)

$context.ExecuteQuery()

 

 

 

Sharepoint Online Web Templates

On 11/01/2019

Name Title Category Compatiblity Level
STS#3 Site d’équipe Collaboration 15
STS#0 Site d’équipe (expérience classique) Collaboration 15
BLOG#0 Blog Collaboration 15
BDR#0 Centre de documents Entreprise 15
DEV#0 Site de développeur Collaboration 15
OFFILE#1 Centre des enregistrements Entreprise 15
EHS#1 Site d’équipe - Configuration SharePoint Online Entreprise 15
SRCHCEN#0 Centre de recherche d’entreprise Entreprise 15
BLANKINTERNETCONTAINER#0 Portail de publication Publication 15
ENTERWIKI#0 Wiki d’entreprise Publication 15
PROJECTSITE#0 Site de projet Collaboration 15
COMMUNITY#0 Site communautaire Collaboration 15
COMMUNITYPORTAL#0 Portail communautaire Entreprise 15
SITEPAGEPUBLISHING#0 Site de communication Publication 15
SRCHCENTERLITE#0 Centre de recherche de base Entreprise 15

List templates

ID Template Name Description SP2016 SP2013 SP2010 SP2007
-1 InvalidType Not used. Yes Yes Yes Yes
0 NoListTemplate unspecified list type. Yes Yes Yes No
100 GenericList Custom list. Yes Yes Yes Yes
101 DocumentLibrary Document library. Yes Yes Yes Yes
102 Survey Survey. Yes Yes Yes Yes
103 Links Links. Yes Yes Yes Yes
104 Announcements Announcements. Yes Yes Yes Yes
105 Contacts Contacts. Yes Yes Yes Yes
106 Events Calendar. Yes Yes Yes Yes
107 Tasks Tasks. Yes Yes Yes Yes
108 DiscussionBoard Discussion board. Yes Yes Yes Yes
109 PictureLibrary Picture library.  Yes Yes Yes Yes
110 DataSources Data sources for a site. Yes Yes Yes Yes
111 WebTemplateCatalog Site template gallery.  Yes Yes Yes Yes
112 UserInformation User Information. Yes Yes Yes Yes
113 WebPartCatalog Web Part gallery. Yes Yes Yes Yes
114 ListTemplateCatalog List Template gallery. Yes Yes Yes Yes
115 XMLForm XML Form library. Yes Yes Yes Yes
116 MasterPageCatalog Master Page gallery. Yes Yes Yes Yes
117 NoCodeWorkflows No Code Workflows. Yes Yes Yes Yes
118 WorkflowProcess Custom Workflow Process. Yes Yes Yes Yes
119 WebPageLibrary Wiki Page Library. Yes Yes Yes Yes
120 CustomGrid Custom grid for a list. Yes Yes Yes Yes
121 SolutionCatalog Solutions. Yes Yes Yes No
122 NoCodePublic No Code Public Workflow. Yes Yes Yes No
123 ThemeCatalog Themes. Yes Yes Yes No
124 DesignCatalog DesignCatalog. Yes Yes No No
125 AppDataCatalog AppDataCatalog. Yes Yes No No
130 DataConnection
Library
Data connection library for sharing information about external data connections. Yes Yes Yes Yes
140 WorkflowHistory Workflow History. Yes Yes Yes Yes
150 GanttTasks Project Tasks. Yes Yes Yes Yes
151 HelpLibrary Help Library. Yes Yes No No
160 AccessRequest Access Request List. Yes Yes No No
171 TasksWithTimeline
AndHierarchy
Tasks with Timeline and Hierarchy. Yes Yes No No
175 MaintenanceLogs Maintenance Logs Library. Yes Yes No No
200 Meetings Meeting Series (Meeting). Yes Yes Yes Yes
201 Agenda Agenda (Meeting). Yes Yes Yes Yes
202 MeetingUser Attendees (Meeting). Yes Yes Yes Yes
204 Decision Decisions (Meeting). Yes Yes Yes Yes
207 MeetingObjective Objectives (Meeting). Yes Yes Yes Yes
210 TextBox Text Box (Meeting). Yes Yes Yes Yes
211 ThingsToBring Things To Bring (Meeting). Yes Yes Yes Yes
212 HomePageLibrary Workspace Pages (Meeting). Yes Yes Yes Yes
301 Posts Posts (Blog). Yes Yes Yes Yes
302 Comments Comments (Blog). Yes Yes Yes Yes
303 Categories Categories (Blog). Yes Yes Yes Yes
402 Facility Facility. Yes Yes Yes No
403 Whereabouts Whereabouts. Yes Yes Yes No
404 CallTrack Call Track. Yes Yes Yes No
405 Circulation Circulation. Yes Yes Yes No
420 Timecard Timecard. Yes Yes Yes No
421 Holidays Holidays. Yes Yes Yes No
499 IMEDic IME (Input Method Editor) Dictionary. Yes Yes Yes No
600 ExternalList External. Yes Yes Yes No
700 MySiteDocument
Library
MySiteDocumentLibrary. Yes Yes No No
1100 IssueTracking Issue tracking. Yes Yes Yes Yes
1200 AdminTasks Administrator Tasks. Yes Yes Yes Yes
1220 HealthRules Health Rules. Yes Yes Yes No
1221 HealthReports Health Reports.  Yes Yes Yes No
1230 DeveloperSiteDraft
Apps
Draft Apps library in Developer Site. Yes Yes No No
3100 AccessApp   Yes No No No
3101 AlchemyMobileForm   Yes No No No
3102 AlchemyApproval
Workflow
  Yes No No No
3300 SharingLinks   Yes No No No
    Total 64 60 52 38
In HTML

Css Add a Line Above

On 05/12/2018

Add a line with css above an html element

 

salut Fred

html
 
 
css
 

When the text is too long and goes outside the div or span, add this : white-space: normal;

 

ul li in line



<ul style="display:inline; list-style: none;">
          <li  style="display:inline;"><div style="background-color: #FF0000;width: 8px;height: 8px;">&nbsp;</div></li>
          <li style="display:inline;">plop</li>
          <li style="display:inline;">plop</li>
          <li style="display:inline;">plop</li>
        </ul>
 display: inline; list-style: none;

SPField Set ShowInDisplayForm With Rest

On 23/11/2018

function UpdateList(){
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/getbytitle('Pages')/Fields(guid'f941f8cf-65d5-4cdb-bc6b-6fab7ea92bc3')/setshowindisplayform(false)",
type: "POST",
contentType: "application/json;odata=verbose",
headers: {
"Accept": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"X-HTTP-Method": "MERGE",
"If-Match": "*"
},
success: function (data) {
alert('Success');
window.location.href=window.location.href;
},
error: function (data) {
console.dir(data);
}
});
}
UpdateList();

Change Files Extentsions

On 23/11/2018

#Retourne le chemin
function Get-ScriptDirectory
{
$Invocation = (Get-Variable MyInvocation -Scope 1).Value
Split-Path $Invocation.MyCommand.Path
}
$ScriptDirectory = Get-ScriptDirectory
"$($ScriptDirectory)\Powershell" | Push-Location
 
 
Dir *.ps1 | rename-item -newname { [io.path]::ChangeExtension($_.name, ".txt") }