Wednesday, December 9, 2020

How do we give Full Trust in CAS policy?

 We have GAC manger small application available in github.

Download the application 

InfoPath cannot generate a form template for the SharePoint list - warning message received across the site

 Check your existing file Might be checked out the form some other name.

                    or


Export the .xsn file.


Open the SP designer

Then All the folder>open the list and Save the xsn in the forms folder

Retry the publish with that location

How to Set Specific Date and time in Field of SharePoint List?

We can add the content editor or script editor webpart 


d = $("#myDatepicker1").datepicker("getDate");

$("#myDatepicker2").datepicker("setDate", new Date(d.getFullYear()+1,d.getMonth(),d.getDate()));

jQuery working in IE, but not in Chrome/Edge

 Method 1:

$.getScript("js/jquery.min.js", function () {

});


Method 2:

$(document).ready(function(){

 

 $.getScript("largejs.js"); 

});

how-to-resolve-javascript-spclientpeoplepicker-is-not-defined-in-edge-works- in IE?

In this article , add the internal name 


function SetAndResolvePeoplePicker(fieldName, userAccountName) {

var controlName = fieldName;

var peoplePickerDiv = $("[id$='ClientPeoplePicker'][title='" + controlName + "']");

var peoplePickerEditor = peoplePickerDiv.find("[title='" + controlName + "']");

var spPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplePickerDiv[0].id];

peoplePickerEditor.val(userAccountName);

spPeoplePicker.AddUnresolvedUserFromEditor(true);

//disable the field

spPeoplePicker.SetEnabledState(false);

//hide the delete/remove use image from the people picker

$('.sp-peoplepicker-delImage').css('display','none');

}

Tuesday, December 8, 2020

SystemUpdate()?

Created by, Modified by, Created and Modified.

Display Name Vs Internal Name 


  • Created by    >  Author
  • Modified by  >  Editor

SharePointPnPPowerShellOnline\Set-PnPListItem -List "EMp" -Identity "5" -Values @{"Editor" ="raghu@peakinders.org"} 


SharePointPnPPowerShellOnline\Set-PnPListItem -List "EMp"  -Identity "5" -Values @{"Modified"=$olddate}-SystemUpdate

• Modified and Modified By fields changed 

• No new version (You can pass false to the method just to enable generating a new version)

SharePoint Online: How to take SharePoint Online Backup ?

 SharePoint Online: we have two types of the Service Scope.

  • Service Backup- all the content is backed up on a regular basis in the case there is corruption 
  • Deletion Backup- users will accidentally or purposely delete content. Its avaliable for 93 days only.


We can Requesting Backups from Microsoft raise the ticket.

  • backs up content every 12 hours, and take a few days to restore, so depending on the urgency for getting the data
SharePoint Online Backup


  1. we can syncing the data one drive to SharePoint or SharePoint to One drive  Bidirectional option.
  2. Timer Job to create the backup.
  3. PowerShell to copy all the data local drive

https://techcommunity.microsoft.com/t5/sharepoint/sharepoint-online-backup-strategies-for-a-cloudy-day/m-p/225418 


SharePoint Online:How to do Move Site and subsites into another site?

  •  http://yoursite/_layouts/sitemanager.aspx", 
  • Go to site manager option
  • Select the parent site of the subsite you want to move in the left navigation pane.
  • Check the box next to the subsite you want to move in the right pane.
  • Click Actions drop-down and click Move.
  • Select Destination of the subsite selected in the next dialog
Move Site and subsites into another site


Or 

We can use the Tool SharePoint Migration Tool, ShareGate or Content Matrix trail version

Saturday, December 5, 2020

Difference between the workflows and power Automate/Power Apps?


Difference between the workflows and power Automate/Power Apps


Workflow

  • SP 2010 workflows executed runtime
  • SP 2013 workflows runs workflow manger independently 
  • It runs endlessly
  • RestAPI calls are support
  • History maintains in workflow history list
  • impersonation step to act as a different user
  • Workflow types: List workflow, site workflow and reusable workflow

Power Automate:

  • It runs for 30 days only
  • “service account” user with a Power Automate license and run these flows with that user account
  • History maintains in power automate dashboard
  • impersonation step is not available
  • Types: Single approval , sequential approval and parallel approvals


Wednesday, December 2, 2020

Display SharePoint list items using rest api

 <div>

<input type="button" id="btnSubmit" value="Get List Details" />

</div>

<div id="divResults"></div>


<script>

$(function () {

$("#btnSubmit").on("click", function () {

getListData();

});

});


function getListData() {

var fullUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('Projection')/items";

$.ajax({

url: fullUrl,

type: "GET",

headers: {

"accept": "application/json;odata=verbose",

"content-type": "application/json;odata=verbose",

},

success: onQuerySucceeded,

error: onQueryFailed

});

}


function onQuerySucceeded(data) {

var listItemInfo = ";

$.each(data.d.results, function (key, value) {

listItemInfo += '<b>Title:</b> ' + value.Title + ' – <b>Billable hours:</b> ' + value.BillableDays + '<br />';

});

$("#divResults").html(listItemInfo);

}

function onQueryFailed() {

alert('Error!');

}

</script>