Best practice for long operations in webpart

What is best practice to implement a long running operation in a web part.

From what I have read so far it is recommended to use PageAsyncTask or a timer which ticks once to initiate data loading.

Now I have tested PageAsyncTask and the timeout is reached after ~7 seconds in my dev environment which is not enough time for my operation. The timer way causes another problem because it fires a postback which causes an issue in combination with the project summary web part. You you can find the problem description here: New SP Timeline web part not ajax friendly!

I need to make some calls in code behind so the only way around this I can think of at the moment would be to create a web service which is then called by JS inside the web part.

SP 2013 document library custom view webpart

We have a requirement to display most recent uploaded file in a document repository in a separate view on the home page.

For example we have Document_Library_1 with files file_new, file_old1, file_old2… we need to have a custom custom view or dashboard on homepage, where the user can access the most recent reports.

enter image description here

Could someone please point me in the right direction on how to achieve this, is custom webpart a solution or the standard view could be customized?

Change document open link on Webpart (Highlighted Content / Document Library)

I have a list of documents where I want to change their default open URL.

For example, you enter the ‘Policy Directory’ page which displays the Document Library web part. Clicking on these policies should take you to a link with the appended PolicyID (i.e. site.com/Policy_Summary.aspx?PolicyID=2)

I was hoping to do this by editing the web part as I can not find a working SPFX Document Library web part open source. This is outdated and will not do gulp serve https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/react-documents-detailslist

Change document open link on Webpart (Highlighted Content / Document Library)

I have a list of documents where I want to change their default open URL.

For example, you enter the ‘Policy Directory’ page which displays the Document Library web part. Clicking on these policies should take you to a link with the appended PolicyID (i.e. site.com/Policy_Summary.aspx?PolicyID=2)

I was hoping to do this by editing the web part as I can not find a working SPFX Document Library web part open source. This is outdated and will not do gulp serve https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/react-documents-detailslist

News not appearing in News-Webpart and Sites not appearing in Activity Webpart

Basically what the title says. I can add a news site in my SharePoint 2019 Server, but it will not appear in any of the webparts. It is shared as a news article, it is also readable by all users.

I already tried starting manual re-indexing. I also tried giving the users all kinds of additional permissions, but so far nothing worked.

I also noticed that I can not see the webpart options such as “news sources” for the news-webpart, that I have seen on various tutorials.

I can also not choose any lists from the list-webpart, but I am not sure if this is the same issue.

SSOM – How to set a custom property value when add webpart programmatically

I want to set a custom property value when add web part programmatically.

Who is the property of System.Web.UI.WebControls.WebParts.WebPart object ?

This is my code for add web part in page:

            using (SPLimitedWebPartManager manager = oWeb.GetLimitedWebPartManager(newPage.Url, PersonalizationScope.Shared))             {                 try                 {                     string wPartURL = oWeb.Site.Url + "/_catalogs/wp/ClientViewProjects.webpart";                     XmlTextReader reader = new XmlTextReader(new StringReader(oWeb.GetFileAsString(wPartURL)));                      string err = null;                     System.Web.UI.WebControls.WebParts.WebPart wp = (System.Web.UI.WebControls.WebParts.WebPart)manager.ImportWebPart(reader, out err);                     wp.ChromeType = PartChromeType.None;                     manager.AddWebPart(wp, "Header", 0); //See the description below for how to determine Zone                     manager.SaveChanges(wp);                 }                 catch (Exception ex)                 {                     LOG_STRING += string.Format("В сайт с URL:{0}{1} {2}", oWeb.ServerRelativeUrl, ex.ToString(), Environment.NewLine);                 }                 finally                 {                     manager.Web.Dispose();                 }                  newPage.CheckIn("Checked in by Code");                 newPage.ListItem.File.Publish("Publishing major version");             } 

Content Search WebPart: query Date and Time field

I have calendar list, Now trying to query items which is greater than Today.

so first I have created new managed property with name EventDate and mapped the crewel property ows_EventDate with type Date and Time enter image description herewhen I am used that property in content Search web part query text, it shows error : “We didn’t understand your search terms. Make sure you’re using the proper

enter image description here

Hover panel in content search webpart

enter image description hereI have designed a six lines showing content search webpart. However I am not been able to get the hover panel. I have used to following code for hover

var id = ctx.ClientControl.get_nextUniqueId(); var itemId = id + Srch.U.Ids.item; var hoverId = id + Srch.U.Ids.hover; var hoverUrl = “~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_Site_HoverPanel.js”; $ setResultItem(itemId, ctx.CurrentItem); ctx.currentItem_ShowHoverPanelCallback = Srch.U.getShowHoverPanelCallback(itemId, hoverId, hoverUrl); ctx.currentItem_HideHoverPanelCallback = Srch.U.getHideHoverPanelCallback();

But i am getting error ” We didn’t find any more information about this result”

Thanks