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

List ItemUpdating - AfterProperties allways empty

$
0
0

Hi,

I'm traying to validate a listItem update on a receiver ItemUpdating event.

I'm trying to validade de new value watching for properties.AfterProperties["column"], but it is allways null.

I can´t use properties.ListItem["column"] because it has the "old" value, not the new one.

How can I do it?

Many Thanks,

DD


Not able to access list from SharePoint online site using lists.asmx web service

$
0
0

Hi,

I have to access a SharePoint online list using lists.asmx web service. Refer below code:

QaTest.Lists List = new QaTest.Lists();
            System.Net.NetworkCredential Credentilas = new System.Net.NetworkCredential("SPOLoginName", "SPOPassword");
            List.Url = "https://Test947.sharepoint.com/sites/at/_vti_bin/lists.asmx";
            List.Credentials = Credentilas;
            XmlNode ListItems1 = List.GetList("{CC16E6EE-0686-4115-A786-A37F7622A94B}");

Getting access denied error while accessing it. But, same code is working fine for on premises environment.

So, is there any way to access SharePoint online list using web service??

Thanks,

Custom Choice Field SharePoint BCS

$
0
0

Scenario: It's always represented out of the box with BCS. I would like to do is to customize the New and EditForms to allow aDropDown in one of my fields.

I've tried: Creating a custom field based on SPFieldChoide(tested in a custom list and it works just fine) and through the BCS config XML file (.bdcm)  added the propertySPCustomFieldType to the field I want to get customized.

Error: I can open ReadItem/NewForm/EditForm pages and custom field renders just fine yet it throws an error while opening the ReadList page

Error while executing web part: System.NotSupportedException: Method 'GetFieldAttributeValue' is not supported on BiConvenioGrupoChoiceField for external lists.

at Microsoft.SharePoint.SPExternalList.ThrowNotSupportedExceptionForMethod(String sMethodName, Type typeThrowing)

at Microsoft.SharePoint.SPFieldChoice.get_Sortable()

at Microsoft.SharePoint.SPField.AnnotateField(XmlNode fieldRefNode)

at Microsoft.SharePoint.WebPartPages.XsltListViewWebPart.AddInFieldSchema(XmlNodeList fieldRefNodes, SPList list)

at Microsoft.SharePoint.WebPartPages.XsltListViewWebPart.AddInTypeInfoIntoViewXml(XmlNode viewXml)

at Microsoft.SharePoint.WebPartPages.XsltListViewWebPart.ModifyXsltArgumentList(ArgumentClassWrapper argList)

at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform)

PS: Everything was and has to be done programmatically i.e. through VisualStudio so in the end I'll have a .wsp that I can deploy and install it all.

applying subquery in CAML

$
0
0

hi,

 I want to use sub query in CAML, is this possible. I want to use CAML  query in such a way that, i wanna  retrieve the  latest  item in my list.

There is a  column called Revision . which is a date column. so I want to retrieve those items from listitemcollection where

a  record with revision column value  is latest.

SPD 2013 Workflow - Create list item with people picker in other site collection

$
0
0

Hi all,

I read a lot of blogs and forum posts the last couple of days, but I seem to be stuck as to why my workflow is not working as expected - thus, I thought I would ask the experts :-)

Setup:

I try to create a SPD 2013 workflow that creates a new item in list "requests" once a certain trigger is set in list "tickets". One of the fields I need to copy is the requestor = People picker field.

I did a web service call with a REST call to create a list item. All works well as long as I just stick to Title and other text fields, but filling in the "Requestor" fails with "Bad request".

I learned I need to use the "RequestorID" field and in a blog I read I need to put in the user id as Int32. So I set the parameters in the dictionary to integer. Still I get "bad request".

Another issue: as I have lists from 2 site collections, the user id differs for the same user.

  • /servicedesk: ID = 9
  • /projects: ID = 22

Additionally, the possibility exists that the user I try to set is not already existent in the /projects user information list.
How can I deal with that?

Auto deployment of master page

$
0
0

Hi,

We purchased a design package with all the resources from an external branding source to apply a custom master page and theme. However, this is forcing me to add the design package on every site collection that I create to apply the theme.

Is there any way through feature stapling that I can associate the design package or the custom master page when site collection is created? in essence, any subsite that is created under the site collection should automatically inherit the master page.

Thanks,

css file written over top navigation

$
0
0

So... this is new.

I have a stylesheet in the HIVE 15 that is directly being written to the top navigation of my teamsite for a specific template.  The style is still being applied to the site and I can find where the file is referenced on the master page.  But I can't identify why this is happening. 

Is there any explanation why my CSS in the alternatecssurl of my masterpage is literally being written over the breadcrumb navigation?

SPQuery always returns the same item

$
0
0

I have the following code. The strKey is changed for each run, but the spquery returns the same SharePoint item to me although already set the query and item collection to null for each run. I think it may due to some kind cache. I am wonder if anyone has a solution for this issue. Thanks in advance.

while (oPt1.Read() && n < 10)

               {

                   if (string.IsNullOrEmpty(oPt1["TelcoID"].ToString()))

                   {

                       oQuery = null;

                       collListItems = null;

                       strDiff = "";                        

                       strKey = fillZero(oPt1["InvCode"].ToString());

                       textBox1.Text = strKey;

                       textBox1.Refresh();

                       //search sharepoint item by InvCode

                       oQuery = new SPQuery();

                       oQuery.Query = "<Query><Where><Eq><FieldRef Name='InvCode' />"+

                       "<Value Type='Text'>"+strKey+"</Value></Eq></Where></Query>";

                       collListItems = list.GetItems(oQuery);

                       if (collListItems.Count > 0)

                       {

                           cItem = collListItems[0];

                           //compare each field


Farm scoped feature

$
0
0

Hi,

I would like to create a farm scoped feature that will basically creates a feature at the Top level site and by default is activated. the feature should associate the same master page / theme  as the parent site for every subsite that is created.

How can I achieve this?

Working example of WCF Data Services inside Layouts or ISAPI

$
0
0

I have been struggling for hours getting WCF data services to work inside SP2013 Layouts or _VTI_BIN. I create a hello world WCF service like so...

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public sealed class SampleService : ISampleService
    {
        public string SampleServiceCall(string SampleValue) { return "Success"; }
    }

and create a .svc file like so

<%@ServiceHost   language= "C#"   Factory= "Microsoft.SharePoint.Client.Services.MultipleBaseAddressDataServiceHostFactory, Microsoft.SharePoint.Client.ServerRuntime, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"   Service= "SharePoint.WCFService.Sample.Code.SampleService" %>

and everything works great inside Layouts and _VTI_BIN. I change the SampleService to this...

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public sealed class SampleService : DataService<WSS_ContentEntities>
    {
        public string SampleServiceCall(string SampleValue) { return "Success"; }

        // This method is called only once to initialize service-wide policies.
        public static void InitializeService(DataServiceConfiguration config)
        {
            // TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.
            // Examples:
            // config.SetEntitySetAccessRule("MyEntityset", EntitySetRights.AllRead);
            // config.SetServiceOperationAccessRule("MyServiceOperation", ServiceOperationRights.All);
            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
        }
    }

and I get the error 

The type 'SharePoint.WCFService.Sample.Code.SampleService', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.

Its like inheriting from DataService causes a .net dll loading problem, it cant seem to find my dll anymore...

Creater a list of list with number of item in those lists in a column

$
0
0

Hello, I would like to create a kind of pre-defined favorites pages for some users to give them a quick acces to the list they use all the time.

I want to have on this page a friendly display name as a link to the list and a colum with the number of item in those lists so that the user know when there is something interesting new.

Is that a build in and easy way to do that ?

For performance purpose I could do a job populating the total number of items 2 or 3 times a day for all lists? in a list of lists and create my favorite page from that list of lists using a filter webpart and a list view ?

I would prefer find a programming less solution -)

Most of lists are external  lists

Sample:

List name               Item number

List1[link]XXX

List2[link]XXX

..

..


Thank you for your help

All the best



Sharepoint 2013 List (Parent - Child) using CSOM - Need ECB menu in Parent Tasks

$
0
0

I'm trying to build a feature in SharePoint 2013.

Scenario -- I have 2 lists..

List one -> Contain all projects
List two -> contain project related tasks.

I'm binding custom image on Project list 'title' column and when clicking that image a custom table of all the project related tasks show up...I'm doing using CSOM and rendering with custom JS link..

I have a requirement to include ECB menu for each item related task item in my custom table, as I'm building custom ECB actions for each task ? Can you please help on How to call ECB menu for each related tasks?  (Or) is there an alternative way of rendering tasks as a list..


change display style for link column type in content query webpart

$
0
0

Hello, I have some questions about content query web part with sharepoint 2013

I use the content query to filter a list.

This list has a column type link with some http links.

when I display it with the content query I got something like http://XXXX, friendly name.

I would like to change that to friendly name only  with href to the http column value as a the link.

How can I achive that?


I already had a look into itemstyle template but not easy to deal with, just be able to find the bullet template i'm using but not able to change anything -(


any help could be usefull.



Many thank you!




Need to stop ECB menu from being obscured when web part height specified

$
0
0

On SharePoint 2013, I have a XSLT web part that uses the ECB menu on items displayed.  However, I can also reproduce this on a OOTB document library web part, when the view is set to "Newsletter, no lines", which causes it to use the "classic" drop down ECB menu.

If the web part has a specific hight specified (say 300 pixels), when the ECB menu is displayed, it is displayed inside the scrolling area of the web part, and part of the ECB menu can be obscured if you open it on an item at the bottom of the scroll area.

In previous versions of SharePoint (i.e. 2007), the ECB menu was always visible, even if the web part had a height specified.

I believe the basic reason is that the 2013 ECB div has "overflow: auto" specified as an inline CSS style, and it needs "overflow: visible".

I need a way (perhaps through jquery?) to modify the ECB div - is there a hook or method to know when the ECB menu has been rendered? It seems to by dynamically created, so the div cannot be accessed until after it is created.  Or is there another idea about how to get this attribute set?

BTW, to reproduce this, find a doc lib that has several docs in it. Create a view with the style "Newsletter, no lines". Drop that doc lib web part on a page and use that view. Also specify a height for the web part of something like 300 pixels. Then hover of a doc near the bottom of the web part and drop down the ECB menu - you will need to scroll the web part to see all the ECB menu options. In previous versions, this displayed the ECB menu overlapping other content on the page so it was always visible.

Timer Job

$
0
0

Hi,

I want to run a custom SharePoint Job manually. Whenevert I wanna try to call RunNow() method it's showing access denied.

var traceJob = (from SPJobDefinition job in MainWebApp.JobDefinitions
                                              where job.DisplayName.ToLower().Replace(" ", "").Equals(jobDisplayName)
                                              select job).SingleOrDefault();
                              if (traceJob != null)
                              {
                                 traceJob.RunNow();
                              }


Shubho


Lookup Columns in subsites

$
0
0

Hey,

do you have a soloution for the following Problem:

We have a sitecollection (root) with a two lists and Sub sites which look exactly like sitecollection.

The subsites should import the data in the lists to the sitecollection by a timerjob where it gets monitored. But each subsites have ist own permissions! So noone can write to the sitecollection. Easy to solve... normally... 

We have contenttypes on the sitecollection created. then we have several subsites in the sitecollection which inherits the contenttypes. With a web-Feature i add two lookup coloumns to the contenttype and all subsites inherits the lookup columns.

The Problem here is, that all of These subsites refer to the sitecollection lists...

Programmaticially i can not Change the lookup columns on each subsite to their lists in their subsite.

How can i solve that Problem?



WSP Package and Solution Explanation

$
0
0

Hello,

I am a bit confused with terms package, solution, solution package. Could you please give me an example for that?

My idea is solution = solution package which puts together items from a package???

However what is the reason for creating multiple packages?

Thanks a lot,

Radek

Get ALL subsites (nth level deep) inside of site collection using CSOM(Javascript) in single async call

$
0
0
I guess the Title is self-explanatory.

SharePoint 2013 Excel Services query custom lists

$
0
0

Hi,

Using Excel service in Sharepoint 2013 is it possible to query sharepoint custom lists?

http://technet.microsoft.com/en-us/library/gg576960.aspx

As per this article in Sharepoint 2010 its not possible without using powerpivot addin.
If powerpivot addin is required then does it mean each end user of the site should have this addin installed in the client machine?

access denied when upgrade SharePoint app in on premise deployment while it succeeds in fresh deployment

$
0
0

We deployed a SharePoint hosted app then used it for a while then we needed to upgrade it to be provider hosted app.

we used the same AppID and name with the new package then uploaded the package to the app catalog.

the old app in the site contents now has a note that there is a newer version and prompts to upgrade.

the upgrade fails with access denied even for site collection administrator.

is there really some permission issue or the upgrade can't be done?


We are volunteers, if the reply help you mark it as your answer. thanks!!

Viewing all 25064 articles
Browse latest View live


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