New answers tagged

0

Try running npm i @microsoft/sp-webpart-workbench Reference:Link


0

Did you solve the problem after you changed your browser? This is probably related to Cross-Origin Resource Sharing. If you have Chrome you could try using Run in Windows with the command: chrome.exe --user-data-dir="C:/Chrome dev session" --disable-web-security More information: How to resolve “TypeError: NetworkError when attempting to fetch resource.”...


0

Multilingual Page Publishing can be found on the roadmap, scheduled for release in March. In various blogs and available sessions, like this one from Ignite, you can see how this will be implemented.


0

If your SharePoint farm is using integrated security with your local domain, there is no way to directly stop the user from being prompted for credentials when you try to access a resource they do not have access to. Instead, you would need to check that the user has access to the site first, and if not, then stop traversing up the hierarchy. Ideally, you ...


0

After some further research, it seems that my initial assumptions were wrong. Technically, Yeoman supports local installation of generators. In this Twitter thread Simon Boudrias, one of the team members for the Yeoman project says: We do (support local install), like any other tool you're using on npm. and Locally installed generators always take ...


0

The this reference inside the context of the event handler is not a reference to your react component. this in that context is usually the object that triggered the event, such as the clicked button. In JSX you can use binding to bind your event handler to the context of your component: You have to be careful about the meaning of this in JSX callbacks. ...


0

I believe Trevor Seward is correct about Sp2019 not supporting that deployment scenario. You will have to enable your Command Set / Application Extension on each site and sub-site initially, using PnP PowerShell (take a look at Install-PnpApp) Future updates to the Command Set should get applied automatically once you deploy the updated solution in the App ...


0

SharePoint Server 2019 does not support 'tenant-wide' deployments so you will need to install it per-site.


0

MultiScreenWebPart is your WebPart class which typically will render a single ReactJS component, but then that component can Render whatever you need. You currently have ReactGetItems as your primary component, and within that component class you are already rendering other React components such as Tabs, PeoplePicker and PrimaryButton. Inside that ...


0

I had the same error behavior by calling an api endpoint that responded with empty content, which is not valid json. In that case the response.status is 204 (No-Content) and the json parsing / resolving can be skipped. if (response.status === 204) { // resolve } else { return response.json(); }


1

Theoretically, you should be able to leverage the processQuery rest endpoint, and perform a query like the one below, in order to update a site custom property bag: import { SPHttpClient, SPHttpClientResponse, ISPHttpClientOptions } from '@microsoft/sp-http'; [...] let myPropertyBag ="customPropbag1" let myNewPropBagValue ="new value" ...


0

Yes this is missing from the modern experience, We have developed our own upload web part where we control the upload behavior which fields are required what type of files (.docx, .pdf) can be uploaded to library. What you could do alternatively you could create an Flow that would prompt user to enter the missing metadata.


0

If you are using React JS and getting the multi-line field text in HTML tags format then you can bind its value to div element as: <div dangerouslySetInnerHTML={{__html: this.state.multilineFieldVale}} />; Where this.state.multilineFieldVale stores the value of your multi-line field. documentation: React DOM Elements - dangerouslySetInnerHTML.


3

While willman's critique of your code is correct (I was going to add all that into my answer as well - you should definitely be saving that data in state, not a class property, and relying on the fact that when you call setState(), React will automatically re-render, without having to call forceUpdate()), I want to answer your real question: What will be ...


1

You should not be storing your results in a class variable and calling forceUpdate. Instead, you should store the results in state (see docs on state). React is purposefully built to run your render method whenever state changes. That way you don't have to blank anything out, when they click the button, the first 6 items stay there until your api call ...


1

According to SharePoint PnP Webcast – Including assets in SharePoint Framework solution packages, Starting from version 1.4 JavaScript assets and other static solution files are automatically included in the sppkg file, which is deployed to app catalog. These assets are automatically hosted from the app catalog URL address. If Office 365 Public CDN ...


0

This might be a better approach to add event listener in a single loop. private _renderListCustomer(items:ISPListCustomerItem[]):void{ let html:string=`<table width='100%' border=1 id="tblEmployees" class="table">`; html+=`<thead> <th scope="col">Customer Id</th> <th scope="col">Name</th> ...


2

Try following workarounds: Using window.open(): window.open(imageUrl, '_blank'); Using Anchor tag / hyperlink: Add your image somewhere in SharePoint library/picture gallery Add anchor tag (hyperlink) with target="_blank attribute and give image path in href attribute.


0

Try the code below: (Not a good practice to repeat loops but it was the only thing working for me) private _renderListCustomer(items:ISPListCustomerItem[]):void{ let html:string=`<table width='100%' border=1 id="tblEmployees" class="table">`; html+=`<thead> <th scope="col">Customer Id</th> <th scope="col"&...


2

Thriggle's answer is a pretty clever solution, so I upvoted it, but I had forgotten to come back and answer the question based on my own experiments. And the answer is: yes. I packaged up a web part with the CDN base path as the server relative URL /sites/apps/AppFiles/MyWebPartFolder and set up the App Catalog sites in Prod and Dev to be /sites/apps ...


2

Here's a possible solution: Use the library on the Prod app catalog for your cdnBasePath, but use subfolders in the library to distinguish between different versions of your web part. For example, https://prod-server/sites/apps/AppFiles/MyWebPartFolder/1 and https://prod-server/sites/apps/AppFiles/MyWebPartFolder/2 When you start developing a new version ...


0

If the attachment is not uploaded for the list item then AttachmentFiles[0] will be undefined. So you need to use it like below: this.data.push({ ID:<td>{json.value[i].ID}</td>, Title:<td><a href={url} target="_blank">{json.value[i].Title}</a></td>, Url:<td><...


0

Try below solutions: var items = response.value.map(obj => ({ key: obj.id })) OR var items = []; var len = response.value.length; for (var i = 0; i < len; i++) { items.push({ key: response.value[i].id, }); } Reference: How to create an array of object literals in a loop?.


0

Works fine when I debug in my local, you could try to debug your code.


0

Sample demo to send email. this.props.context the context is from webpart(.ts). const sendMail = { message: { subject: "Test", body: { contentType: "Text", content: "test email in SPFx call." }, toRecipients: [ { emailAddress: { address: "lee@xxx.onmicrosoft.com" ...


0

The code below will list all the members of a office 365 security group or any group. The Group ID ({dab8006b-95f1-4df2-8704-004667d4b491}) is found by going into Azure > Groups. Main component: this.props.context.msGraphClientFactory .getClient() .then((client: MSGraphClient) => { client.api('https://graph.microsoft.com/v1....


1

This doesn't answer all your question, but this is to the first error MSGraphClient.serviceKey, Since 1.6 the MSGraphClient and AadHttpClient classes no longer expose a serviceKey property which means that we cannot get hold of the default instances in custom services without passing in the entire web part context. We get this error: Property '...


0

SharePoint Framework is a client side solution and it always runs in the context of the current user. So, there is no OOTB way to use elevated permissions with SPFx. However, you can try some workarounds like Azure functions, Custom Web API, etc. as mentioned at: Options for elevating permissions in SharePoint Framework. Sample using Custom Web API: There ...


2

You can also use SharePoint Framework 1.7 with SharePoint 2019. Source: Release notes for SharePoint Framework 1.7. Tenant-wide deployment option was released in version 1.4. Source: Tenant-scoped solution deployment for SharePoint Framework solutions. So you can use SharePoint Framework 1.7+ and do the tenant scope solution deployment. I have tried it ...


0

I don't think 10.18 is supported - I'm using 10.16.3. I know the instructions say "LTS" - but that doesn't seem to be true at the moment, so the documentation probably needs updating. We'll probably have to wait for an update to SPFx to resolve this. Even then there is always the risk that Node bump their LTS again and something stops working.


0

Why not log the value directly? console.log(value,iar.item); Here is my debug screenshot which can be get from ItemAddResult


Top 50 recent answers are included