Sharepoint online: problem with updating the moderation status from the rest API

I am trying to update the moderation status of a sharepoint file through the rest API. The rest of the API will be called from the Java code. I am trying to update it using an http patch request for the graphical API. I am using the following API

https://graph.microsoft.com/v1.0/sites/{site}/drives/{driveId}/items/{itenId}/listitem

and my payload is
{
"_ModerationStatus": 0
}
The status is updated but is pending again as a new version is created. I have version control enabled in my document library. Is there a way to update the moderation status without being aware again?
** Note: ** I need versions in my library. Therefore, version settings cannot be disabled.

SharePoint update from 2010 to 2013 – The organization / organization chart browser is missing

I updated SharePoint 2010 to 2013 and the organization chart / organization browser no longer appears on MySite. Or when you click on a user (the people search web part successfully implemented) you are forwarded to the SharePoint 2010 environment. How would you implement the Organization Browser? Would it appear on users' MySites and send it to the SharePoint 2013 environment?

sharepoint online – Getting "Access denied" in "Invoke-PnpQuery"

I am trying to move a site in SharePoint Online but an error appears when doing so. Code:

$ SiteURL = "https://domain.sharepoint.com/sites/Helix/HelixSite/TobeArchived"

$ NewSiteURL = "/ sites / Helix / HelixArchive / TobeArchived"

Connect-PnPOnline -Url $ SiteURL -Credentials $ usercredential

$ Web = Get-PnPWeb

$ Web.ServerRelativeUrl = $ NewSiteURL

$ Web.Update ()

Invoke-PnPQuery

Error:

Invoke-PnPQuery: access denied.
In C: Users 91987 Documents Untitled6.ps1: 15 char: 1
+ Invoke-PnPQuery
+ ~~~~~~~~~~~~~~~
+ CategoryInfo: NotSpecified: (:) (Invoke-PnPQuery), ServerException
+ FullyQualifiedErrorId: Microsoft.SharePoint.Client.ServerException, SharePointPnP.
PowerShell.Commands.Base.InvokeQuery

I am a global administrator and have full control over the sites in question.
What I found is that I don't receive any errors when the URL is like "https://domain.sharepoint.com/development/ cloudsite / helix "{Any string instead of sites}, Then I can move the site successfully.

Any help you can provide would be greatly appreciated.

Connecting web elements through Javascript in SharePoint 2013

I am working on SharePoint 2013 and I have two OOTB web elements (list view and URL filter) that I want to connect programmatically. I also want it to be a client-side solution with JavaScript, using the JavaScript API or the REST API.

When looking at this forum post or this blog post, it seems that it is definitely possible to connect two web elements using the SharePoint client object model. But when I look at the LimitedWebPartManager API documentation, both the .NET documentation and the JavaScript API documentation do not refer to the key functions used to actually connect the web elements:

// mgr = LimitedWebPartManager object
ConsumerConnectionPointCollection ccc = mgr.GetConsumerConnectionPoints(listViewWebPart);
ProviderConnectionPointCollection ppp = mgr.GetProviderConnectionPoints(filterwebpart);

TransformableFilterValuesToParametersTransformer filterToParameterTransformer = new TransformableFilterValuesToParametersTransformer();

SPWebPartConnection conn = mgr.SPConnectWebParts(filterwebpart, ppp("ITransformableFilterValues"), listViewWebPart, ccc("ListViewFilterConsumer_WPQ_"), filterToParameterTransformer);

The documentation has no references to a GetConsumerConnectionPoints, GetProviderConnectionPointsor a SPConnectWebParts run on the LimitedWebPartManager object.

So my question is, Is there a JavaScript API equivalent to these functions?

If not, how could two web elements be connected to the JavaScript API?

Allow editing only certain fields in the SharePoint list

No, SharePoint does not provide column-level security. But it is still possible to achieve your goal with a little creativity.

You did not specify which version of SharePoint you are using, so I will give you a recommendation assuming SharePoint Online. If you post that you are using something different, I will adjust it accordingly.

You can block the list so that none of the administrators have editing rights on your list.
Then create a dedicated dedicated user account for this purpose that make have edit access to the list.
Then, create a PowerApp or use the new Flow user interface to show them the fields of the item for approval, and place editable fields on the form only for the values ​​you want them to send. Create a custom connection for your Power App or Flow that you log in with the dedicated user account you created earlier. This application can save the values ​​entered by the administrator.

Another possible solution is to have two separate lists, one that is a "master" list with all fields. The second list has a unique search column for the first and a copy of the two fields you want to edit.
A flow configured for the "master" list guarantees the creation of an element in the second list with the search column pointing to the element that activated the flow, and potentially notifies administrators.
Administrators can edit the fields in the second list, but they have no contribution rights to the "master list". Then, a Flow configured in the second list copies the values ​​of those fields to the master list each time a change is made.

online sharepoint: the click of the SPFx JQuery dialog button does not find a public function

I am new to the development of TypeScript and SPFx.

I have a jquery UI dialog box and a public function in the same class that makes some MSGRAPH calls after clicking the button.

The button click returns with error:

this.addAlert is not a function

I think the problem is that the dialogue code is executed outside the context of the web part and therefore does not know the function available in the context of the web part.

How can I use the click of the button to execute within the context of the web part?

Here is the dialogue code.

    public render(): void {

    this.domElement.innerHTML = AlertTemplate.templateHtml;
    const dialogOptions: JQueryUI.DialogOptions = {
      width: "50%",
      height: "auto",
      buttons: {
        "Subscribe": function (e) {
          this.addAlert("Yes");
          jQuery(this).dialog("close");
        },
        "No Thanks": function (e) {
          console.log("moo");
          this.addAlert("No");
          jQuery(this).dialog("close");
        },
        "Ask me later": function (e) {
          this.addAlert("Ask Me Later");
          jQuery(this).dialog("close");
        }
      }
    };

    jQuery('.dialog', this.domElement).dialog(dialogOptions);
    jQuery(".ui-dialog-titlebar").hide();
  }

addAlert function

public addAlert(status: string): void {
var url = "/sites/" + this.context.pageContext.site.id + "/lists";
var listId = "";
var email = this.getCurrentUserEmail();
var recordExists = false;
let item: SubscriptionListItem;
this.context.msGraphClientFactory
  .getClient()
  .then((client: MSGraphClient): void => {
    client
      .api(url)
      .top(1)
      .filter("equals=(displayName, 'Subscriptions'")
      .version("v1.0")
      .get((err, res) => {
        if (err) {
          console.error(err);
          return;
        }
        console.log(res);
        listId = res.id;
      });
  });

SharePoint 2019 is very slow after migrating from SharePoint 2016

Dividing secondary sites into sites will not cause slowness … the reason could be something else. I think this could be the problem with the database and network connectivity, verify the connectivity of your network between the SharePoint WFE server and the database server.

I'm not sure how your database is structured … as a best practice we should have AG (availability group) set up in the database along with at least two listeners (cluster).

So, to deal with this type of situation, we must verify the following:

  • Check the records of ULS, there we could see exactly what is wrong.

  • Make sure that the four content databases or the database that is
    connected to the previous sites join listner 1 db in the AG
    group configuration (on db server)

  • If you have used a single content database for all sites, try to have a one-to-one content database for each site.

SharePoint online retention tags – Exchange Stack Exchange

Battery exchange network

The Stack Exchange network consists of 175 question and answer communities, including Stack Overflow, the largest and most reliable online community for developers to learn, share their knowledge and develop their careers.

Visit Stack Exchange

Why doesn't my linked Sharepoint List in MS Access show everything?

When I link to a Sharepoint list in MS Access, it doesn't show me everything in the list. However, when I import the same list, it shows me everything. When importing a list, there is an option to select "Items to import" and I have it set to "All documents". I guess this is the problem, but this option does not appear when linking the list. If this is the problem, how do I change it?

javascript – Navigation with megamenu in SharePoint 2016

Platform: SharePoint 2016

I successfully created a simulated navigation menu with a mega menu item (Address) in codepen, but it doesn't work as I expect.

When I try to implement it on my SharePoint site, this is what I get (screenshot attached):
enter the description of the image here

Any idea why?

Here is the code:

var cacheNavData = ();
var cacheSubNavData = ();
var cacheMegaMenuData = ();
var cacheCategoryMenuData = ();

$(document).ready(function(){
 getData("Training Navigation").done(function(data1){
    cacheNavData = data1.d.results;
    getData("Sub Navigation").done(function(data2){
        cacheSubNavData = data2.d.results;
        getData("Mega Menu Category").done(function(data3){
            cacheMegaMenuData = data3.d.results;
            getData("category menu").done(function(data4){
                cacheCategoryMenuData = data4.d.results;
                megaMenu();
                createNavigation(cacheNavData);

                });
            });
        });
    });
})

function getData(lName){    

        if (lName != "Sub Navigation") {    
            var endPointUrl = "/otg/_api/web/lists/getbyTitle('" + lName + "')/items";
        }else {
            var endPointUrl ="/otg/_api/web/lists/getbyTitle('" + lName + "')/items?$select=parentNav/URL, parentNav/URLNAME,subLink&$expand=parentNav";
        }

        return $.ajax({
            url: endPointUrl,
            type: "GET",
            headers: {
                        "accept":"application/json;odata=verbose"
            }
        }); 
}


    function myFunction() {
        var x = document.getElementById("myTopnav");
        if (x.className === "topnav") {
            x.className += " responsive";
        } else {
            x.className = "topnav";
        }
    }

    function createNavigation(navData) {
        var topNav = document.getElementById("myTopnav");
        for (var x = 0; x < navData.length; x++) {

            if (navData(x).dropDown === "no") {
                var aLink = _createEl("a");
                var aTextNode = document.createTextNode(navData(x).URLNAME);
                aLink.href = navData(x).URL;
                aLink.appendChild(aTextNode);
                topNav.appendChild(aLink);
            } else if (navData(x).dropDown === "yes") {                 
                buildSubNavigation = buildSubNavBar(navData(x).URLNAME);
                topNav.appendChild(buildSubNavigation);
            } 
        }
    }

    function buildSubNavBar(subNavID, isDirectorate) {
        //create div and add dropdown class
        var ddDiv = _createEl("div");
            ddDiv.classList.add("dropdown");

        //create button and add text
        var btn = _createEl("button");
            btn.classList.add("dropbtn");

       // var btnText = document.createTextNode(subNavID);
        var btnText = document.createTextNode(subNavID);
        //append the text to the button
        btn.appendChild(btnText);

        //create i tag and add "fa fa-caret-down" classes
        var itag = _createEl("i");
        itag.classList.add("fa");
        itag.classList.add("fa-caret-down");
        btn.appendChild(itag);
        ddDiv.appendChild(btn);

        var ddContent = _createEl("div");
        ddContent.classList.add("dropdown-content");
        for (var i = 0; i < cacheSubNavData.length; i++) {  
            if (cacheSubNavData(i).parentNav.URLNAME === subNavID  && cacheSubNavData(i).parentNav.id !== "Directorate") {
                var li = _createEl("li");
                var a = _createEl("a");
                var aTextNode = document.createTextNode(cacheSubNavData(i).subLink.Description);

               // a.href = cacheSubNavData(i).subURL;
                a.href = cacheSubNavData(i).subLink.Url;
                a.appendChild(aTextNode);
                ddContent.appendChild(a);  
            }
        }
        ddDiv.appendChild(ddContent);
        return ddDiv;
    }

    function _createEl(el) {
        return document.createElement(el);
    }


    function megaMenu(){
            var topNav = document.getElementById("myTopnav");
            var ddDiv = _createEl("div");
            ddDiv.classList.add("Mdropdown");

                    //create button and add text
             var btn = _createEl("button");
            btn.classList.add("Mdropbtn");

            //create div and add dropdown class
            var megaDivDropDown = _createEl("div");
            megaDivDropDown.classList.add("Mdropdown");

            var megaBtn = _createEl("button");
            megaBtn.classList.add("Mdropbtn");

            megaDivDropDown.appendChild(megaBtn)
            var megaI = _createEl("i");
            megaI.classList.add("fa");
            megaI.classList.add("fa-caret-down");

            megaBtn.appendChild(megaI);

            var megaDDivContent = _createEl("div");
            megaDDivContent.classList.add("Mdropdown-content");

            var headerDiv = _createEl("div");
            headerDiv.classList.add("Mheader");

            var megaH2 = _createEl("h2");
            var h2Text = document.createTextNode("Team Sites");

            megaH2.appendChild(h2Text);
            headerDiv.appendChild(megaH2);
            megaDDivContent.appendChild(headerDiv);

            var megaDDivRow = _createEl("div");
            megaDDivRow.classList.add("Mrow");
            for (var i = 0; i < cacheMegaMenuData.length; i++) {
            console.log("-->"+cacheMegaMenuData(i).Title);

                var megaDivCol = _createEl("div");
                megaDivCol.classList.add("Mcolumn");
                var colHr = _createEl("h3");
                var colHrText = document.createTextNode(cacheMegaMenuData(i).Title);
                colHr.appendChild(colHrText);
                megaDivCol.appendChild(colHr);
                for (var x = 0; x < cacheCategoryMenuData.length; x++) {
                console.log(cacheMegaMenuData(i).category)
                console.log(cacheCategoryMenuData(x).Title);
                    if (cacheMegaMenuData(i).Title === cacheCategoryMenuData(x).Title) {
                        var colAnchor = _createEl("a");
                        colAnchor.href = cacheCategoryMenuData(x).menuUrl;
                        var menuColText = document.createTextNode(cacheCategoryMenuData(x).menuItem);
                        colAnchor.appendChild(menuColText);     
                        megaDivCol.appendChild(colAnchor);
                        megaDDivRow.appendChild(megaDivCol);
                        megaDDivContent.appendChild(megaDDivRow);
                        ddDiv.appendChild(megaDDivContent);
                        console.log(ddDiv);
                    }
                }
            }
        topNav.appendChild(ddDiv);
        console.log(topNav)
    }

CSS code

    .topnav {
      overflow: hidden;
      background-color: #333  !important;
    }

    .topnav a {
      float: left;
      display: block;
      color: #f2f2f2  !important;
      text-align: center;
      padding: 14px 16px;
      text-decoration: none;
      font-size: 12px;
    }

    .active {
      background-color: #4CAF50;
      color: white  !important;
    }

    .topnav .icon {
      display: none;
    }

    .dropdown {
      float: left;
      overflow: hidden;
    }

    .dropdown .dropbtn {
      font-size: 12px;    
      border: none;
      outline: none;
      color: white  !important;
      padding: 14px 16px;
      background-color: #333    !important;
      font-family: inherit;
      margin: 0;
    }

    .dropdown-content {
      display: none;
      position: fixed !important;
      background-color: #f9f9f9  !important;
      min-width: 160px;
      box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2)v;
      z-index: 300 !important;
      color:black;
    }

    .dropdown-content a {
      float: none !important;
      color: black !important;
      padding: 12px 16px;
      text-decoration: none;
      display: block;
      text-align: left;
    }

    .topnav a:hover, .dropdown:hover .dropbtn {
      background-color: #555  !important;
      color: white  !important;;
    }

    .dropdown-content a:hover {
      background-color: #ddd  !important;
      color: black  !important;
    }

    .dropdown:hover .dropdown-content {
      display: block;
      color:black !important;
    }

    @media screen and (max-width: 600px) {
      .topnav a:not(:first-child), .dropdown .dropbtn {
        display: none;
      }
      .topnav a.icon {
        float: right;
        display: block;
      }
    }

    @media screen and (max-width: 600px) {
      .topnav.responsive {position: relative;}
      .topnav.responsive .icon {
        position: absolute;
        right: 0;
        top: 0;
      }
      .topnav.responsive a {
        float: none;
        display: block;
        text-align: left;
      }
      .topnav.responsive .dropdown {float: none;}
      .topnav.responsive .dropdown-content {position: relative;}
      .topnav.responsive .dropdown .dropbtn {
        display: block;
        width: 100%;
        text-align: left;
      }
    }