Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all 7589 articles
Browse latest View live

number field validation using calculated column

$
0
0

Hi all,

I have a text field named doctno with numbers.I want to validate the field first two characters is 20.I have used below calculated field and used below formula to validate it.

=IF(ISNUMBER(FIND("20",doctno)),"abc")

the formula is finding for entire field in the doctno,but i want to search only the item which starts with 20.Please help me in this.

Regards,

Praveen


Are these FabricUI components still supported and can i use them? The icons works randomly

$
0
0

I'm investing and trying out some of these components in my web part (classic page)

The Persona Card

https://developer.microsoft.com/en-us/fabric-js/components/persona/persona 

Ref below

https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/css/fabric.min.css

https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/css/fabric.components.min.css

https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/js/fabric.min.js

Any ideas why the icons works randomly. ..sometimes they appear sometimes it doesn't

 Some icons work some dont. For example <i class="ms-Icon ms-Icon--Vacation"></i> this doesn't work but this does <i class="ms-Icon ms-Icon--Phone"></i>

I'm getting the icons ref from here https://codepen.io/MistaTwist/pen/BoNLEG and what to know if my fabric UI js and css references are the correct ones

Thanks in advance

Linking spfx webparts together.

$
0
0

Hi,

I have a requirement to add two list webparts on an SP page. The end user will then be able to click on an item within one web part, which will then filter the other list. It will be modern experience and SP-Online ONLY.

I've discovered this: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/dynamic-data

which I'm willing to try but wonder if it's as simple as this (taken from the above document):

In its simplest form, the UI could be defined as follows:

ts
protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {return {
    pages: [
      {
        groups: [
          {
            groupFields: [
              PropertyPaneDynamicFieldSet({
                label: 'Select event source',
                fields: [
                  PropertyPaneDynamicField('event', {
                    label: 'Event source'
                  })
                ]
              })
            ]
          }
        ]
      }
    ]
  };
}

For each set of dynamic properties, add a new group using the PropertyPaneDynamicFieldSet method. For each dynamic web part property, add a PropertyPaneDynamicField, which will allow users to select from which property, the web part property specified in the PropertyPaneDynamicField should retrieve its data.

If your dynamic data field set consists of multiple dynamic properties, you can specify how the connection data is shared using the sharedConfiguration.depth property:

ts
groupFields: [
  PropertyPaneDynamicFieldSet({
    label: 'Address',
    fields: [
      PropertyPaneDynamicField('address', {
        label: strings.AddressFieldLabel
      }),
      PropertyPaneDynamicField('city', {
        label: strings.CityFieldLabel
      })
    ],
    sharedConfiguration: {
      depth: DynamicDataSharedDepth.Property
    }
  })
]

Can someone either link me a good tutorial or provide some sample code I can work off?

SP 2013 - Use JQuery to Hide the Display Form "Close" Button

$
0
0

Hello Community,

I am working with SharePoint 2013 and I am trying to hide the "Close" button on a list Display form.  I've added a CEWP to the DisplayFormNew.aspx file, and now I want to hide the Close button by adding JQuery to the CEWP.  Has anyone else done this? If so please provide code examples and guidance.

Thanks!

Tom Molskow


Tom Molskow - Senior SharePoint Architect - Microsoft Community Contributor 2011 and 2012 Award - Linked-In - SharePoint Gypsy

how to convert custom page to Home page in sharepoint

$
0
0

Hi,

I have designed page layout to apply to page

1) How can I apply page layout to wiki page or web part page in site pages ( unable to find page layout to be applied )


Requirements:

Need to apply page layout on wiki and web part page then convert into home page ( landing page)


Thanks


How do I create a link to a document in a document set in workflow

$
0
0

I have a workflow which can be manually started and sends an email with a link to the Edit form of a document, as follows:

[%Current Item:Encoded Absolute URL%]/../Forms/EditForm.aspx?ID=[Current Item:ID%]

However, I have since moved some documents into a Document Set within the library and the link no longer works.  How can I make this work please?

Thank you in advance.


J Sykes

Create Document sets in Bulk inside a document library

$
0
0

Hi All,

I want to create multiple items using power shell in one Document library. This document library has content type as 'document set' so every item created inside this library must be a Document set. Now question is how can I achieve this using sharepoint powershell.?

Pls help !! urgent

PS:I am working on O365 SharePoint online Site and using "SharePoint Online Management Shell"

Thanks in Advance

Jquery Datepicker excluding weekends

$
0
0

Hi Experts,

Currently I'm using Jquery DatePicker in SharePoint Page, I want to exclude weekends when selecting, is this possible?

Thanks for any help.


How to create jquery org chart using SharePoint List data

$
0
0

Hi ,

I am working on creating a org chart using jorgchartjs and sharepoint list . My list name is employee it has 3 columns.

1)Title

2)Manager (lookup)

3)Designation

I am able to get rest data using rest api , My question is how to form the json in below datasource format dynamically .

<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css'>
<link rel='stylesheet' href='https://rawgit.com/dabeng/OrgChart/master/demo/css/jquery.orgchart.css'> 
</head>
<body>
  <div id="chart-container"></div>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script>
<script src='https://rawgit.com/dabeng/OrgChart/master/demo/js/jquery.orgchart.js'></script>
    <script  src="js/index.js"></script>

(function($){

  $(function() {

    var datascource = {
      'name': 'Lao Lao',
      'title': 'general manager',
      'children': [
        { 'name': 'Bo Miao', 'title': 'department manager' },
        { 'name': 'Su Miao', 'title': 'department manager',
          'children': [
            { 'name': 'Tie Hua', 'title': 'senior engineer' },
            { 'name': 'Hei Hei', 'title': 'senior engineer',
              'children': [
                { 'name': 'Pang Pang', 'title': 'engineer' },
                { 'name': 'Xiang Xiang', 'title': 'UE engineer' }
              ]
            }
          ]
        },
        { 'name': 'Hong Miao', 'title': 'department manager' },
        { 'name': 'Chun Miao', 'title': 'department manager' }
      ]
    };

    $('#chart-container').orgchart({
      'data' : datascource,
      'nodeContent': 'title'
    });

  });

})(jQuery);

A particular script does not execute for a User with full control access to the SharePoint online site.

$
0
0

The code below only executes if the user is a member of site collection admin. How can I modify the code so that it runs for users with Full control as well as Read/Write please?          

var clientContext = SP.ClientContext.get_current();

// Fetch all groups because I can't just grab those for this subsite.
    this.collGroup = clientContext.get_web().get_siteGroups();
            clientContext.load(collGroup);
    clientContext.load(collGroup, 'Include(Users)');

    clientContext.executeQueryAsync(Function.createDelegate(this, function() { 

         var groupsInfo = '';  
            var groupsEnumerator = collGroup.getEnumerator(); while (groupsEnumerator.moveNext()) {  
             var oGroup = groupsEnumerator.get_current(); 
              //  alert(oGroup.get_title()); 

Also, The code will create the SharePoint group if it does not exists. 

How can I force these codes to run for users with Full and Edit rights?


faye fouladi


SharePoint Export a dynamic table built from a SharePoint list int Excel - getting an error

$
0
0

I have a requirement to build a report from a SharePoint list and display the list items in a dynamic table on a page and then have a button that would export the dynamic table into Excel. I am using the below function which works fine, however, I am getting the error :

Html to excel file generation gives error file format and extension don't match. How to correct

Although I am able to open the xls file, I would like to get rid of the error. Any idea?

This is the function I am using:

 $("#RptTable").table2excel({
  exclude: ".noExl",
  name: "Worksheet Name",
  filename: "StatusReport",
  fileext: ".xls",
  exclude_img: true,
  exclude_links: true,
  exclude_inputs: true
});
      

Thanks


faye fouladi

SharePoint online JavaScript problem finding a given SharePoint group

$
0
0

Below is my code:

var clientContext = SP.ClientContext.get_current();
// Fetch all groups because I can't just grab those for this subsite.
    this.collGroup = clientContext.get_web().get_siteGroups();
    var SvcUnit = 'AJM';
        
    clientContext.load(collGroup);
    clientContext.load(collGroup, 'Include(Users)');
    collGroup = clientContext.get_web().get_siteGroups();

    clientContext.load(collGroup);
    clientContext.load(collGroup, 'Include(Users)');
    clientContext.executeQueryAsync(Function.createDelegate(this, function() { 
         
         var groupsInfo = '';  
            var groupsEnumerator = collGroup.getEnumerator();          
           
             while (groupsEnumerator.moveNext()) {  
             var oGroup = groupsEnumerator.get_current(); 
               // alert(oGroup.get_title()); 
               if (oGroup.get_title().indexOf('Front Office') != -1) {
                    var mygrpsvcunit = (oGroup.get_title());
                 
                    if (oGroup.get_title().indexOf(SvcUnit) != -1) {
                        
                       // alert(oGroup.get_title());
                      
                      FrontOfficeGrpId = oGroup.get_id();
                       FrontOfficeGroupName = oGroup.get_title();
                      // alert(FrontOfficeGrpId);
                     //  alert(oGroup.get_title());
                    // alert('Front office group is: '); 
                  //  alert(FrontOfficeGroupName);
                     //  alert(FrontOfficeGrpId);
                     timeout(5000).then(function() {
                      retrieveAllUsersInFrontOffice(FrontOfficeGrpId);
                        });    
                 }

The problem is, in my SharePoint site I do have a permission group whose name consists of AJM and Front Office. However, I am not able to retrieve it vis indexOf. 

Any idea if I can use another method of finding it? I can find other groups using IndexOf method only not this one.

Thanks


faye fouladi

Caml Query filter lookup field which have same values

$
0
0

Hi Experts,

Currently, I have a case, in my list, I have a list which have a lookup field, this field is looking up to another specific field, The looked up field have some duplicated same values.

Now I want to filter the lookup field, how to get the specific one ?

For example, The lookup field have 2 "Test" Value, I want the second one, not the first.

SharePoint Detailed UserProfile property like Email Phone etc using Rest API

$
0
0

Hello Everyone,

I need to display a user's detailed UserProfile property like Email Phone etc using Rest API in my homepage for a contact purpose.

Can this be done with Rest in Client Side ?

Need a demo or some code here.

Thanks in advance.

Risk about upgrade SPFX Version

$
0
0

Currently we are building SPFX Web Part with 1.9.1, can we upgrade to latest 1.10 version ?

Is there any risk to upgrade and how to do it ?

Any suggestion is welcome.


Word template and "site content type" communication issue: Quickparts character limit prevent entering data in word document

$
0
0

Good morning,

I have a text field (site column) with “Multiple lines of text” as data type.

This site column is part of a content type. The content type in turn is connected to a Microsoft word document template. The site column I have mentioned above is linked to a “quick part” field.

Everything works. Two-way communcation between the word document and SharePoint is established and any change in one of them is automatically reflected to the other.

The only problem is the maximum character limit of the “quick part” in Microsoft word.

Apparently Microsoft word document property (metadata) fields can only accept up to 255 character. So regardless of melinking a “multiline” site column to this quick part, the “quick part” doesn’t allow me to store more than 255 characters. So it prevents me to enter more than 255 characters into fields.

Is there a way to fix this non-programmetically? I have limited development capability beyond front-end scripting using scripting web part. I have no access to backend,powershell, configurations etc. So I need a "high level" solution feasble by modifying my template and or changing my list/document library settings in sharepoint.

Many thanks,

K

How to loop in charts

$
0
0

Hi,

Requirement:How to  Bind Series Dynamically?

I am working with charts ,kindly let me knoe hot to loop in it to fill data acordingly

My code ( as below code is not working with loop , if I remove loop it works fine with static data)

 if (response.d.length > 0) {
           
            for (var count = 0; count < response.d.length; count++) {
                new Vue({
                    el: '#app',
                    components: {
                        apexchart: VueApexCharts,
                    },
                    data: {
                        series: [{
                            name: response.d[count].DepartName,
                            // data: [response.d[count].approveddocs, response.d[count].rejecteddocs, response.d[count].DepartName]
                            data: [42, 100]
                        }],
                        chartOptions: {
                            chart: {
                                type: 'bar',
                                height: 350,
                                stacked: true,
                                toolbar: {
                                    show: true
                                },
                                zoom: {
                                    enabled: true
                                }
                            },
                            responsive: [{
                                breakpoint: 480,
                                options: {
                                    legend: {
                                        nbsp;                                       offsetX: -10,
                                        offsetY: 0
                                    }
                                }
                            }],
                            plotOptions: {
                                bar: {
                                    horizontal: false,
                                },
                            },
                            xaxis: {
                                type: 'datetime',
                                categories: ['01/01/2011 GMT', '01/02/2011 GMT', '01/03/2011 GMT', '01/04/2011 GMT',
                                    '01/05/2011 GMT', '01/06/2011 GMT'
                                ],
                            },
                            legend: {
                                nbsp;                               offsetY: 40
                            },
                            fill: {
                                opacity: 1
                            }
                        },

                    },
                })

            }

Kindly guide me 

Thanks


Powershell script to disable SharePoint online library versioning: error

$
0
0

I am using a Powershell Script to disable versioning in a SharePoint document library. The basic script is shown below (although I modified it to my specific SharePoint URL and library name).  When I run the script, I get the following error:

Error: Exception calling "ExecuteQuery" with "0" argument(s): "For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method."

Any ideas or help would be appreciated.

#Load SharePoint CSOM Assemblies

Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"

Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

Function Disable-SPOVersioning()

{

    param

    (

        [Parameter(Mandatory=$true)] [string] $SiteURL,

        [Parameter(Mandatory=$true)] [string] $ListName

    )

    Try {

        #Get Credentials to connect

        $Cred= Get-Credential

          #Setup the context

        $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)

        $Ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password)

                   #Get the List

        $List = $Ctx.Web.Lists.GetByTitle($ListName)

                  #sharepoint online powershell disable versioning

        $List.EnableVersioning = $False

        $List.Update()

        $Ctx.ExecuteQuery()

        Write-host -f Green "Versioning has been turned OFF at $ListName"

    }

    Catch {

        write-host -f Red "Error:" $_.Exception.Message

    }

}

#Set Parameters

$SiteURL="https://acme365.sharepoint.com/sites/acmeSite/subsite"

$ListName="Test Library"

#Call the function

Disable-SPOVersioning -SiteURL $SiteURL -ListName $ListName

#Read more: https://www.sharepointdiary.com/2018/08/sharepoint-online-powershell-to-disable-versioning.html#ixzz6D6WEdcEc

how to get people/user column in sharepoint rest api call via designer workflow

$
0
0

how to get people/user column in sharepoint rest api call via designer workflow

I am getting blank when username exists in list item column.

http://<servername>/<siteurl>/_api/web/Lists/getbytitle(‘IT%20Help%20Desk%20Request’)/items

All other values I am able to get except people/Username column values to send email to.


MCTS Sharepoint 2010, MCAD dotnet, MCPDEA, SharePoint Lead

SharePoint CSOM

$
0
0

I am trying to run the below CSOM to retrieve events using this link: https://www.jonathanhuss.com/sharing-a-sharepoint-online-calendar-via-icalendar/. How can I run the below code?

Uri uri = new Uri(remoteCalendarAccess.SiteAddress);
string realm = TokenHelper.GetRealmFromTargetUrl(uri);
var token = TokenHelper.GetAppOnlyAccessToken("00000003-0000-0ff1-ce00-000000000000", uri.Authority, realm);
ClientContext clientContext = TokenHelper.GetClientContextWithAccessToken(uri.ToString(), token.AccessToken);
clientContext.Load(clientContext.Web.Lists);
clientContext.ExecuteQuery();
List list = clientContext.Web.Lists.Where(l => l.Id == remoteCalendarAccess.CalendarId).First();
ListItemCollection items = list.GetItems(CamlQuery.CreateAllItemsQuery());
clientContext.Load(items);
clientContext.ExecuteQuery();



Viewing all 7589 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>