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

AssetPortalBrowser - user cannot add image

$
0
0

I have one SP list containing few text fields and one "publishing image" field. When user tries to add new item and tries to add new image (click on link "Click here to insert a picture from SharePoint"), new dialog opens (Edit Image Properties). User then clicks on "Browse" button  (new dialog opens: "Select an Asset") and selects image from PublishingImgage library. Clicks OK button ("Select an Asset" closes), but no image url is copied to the "Edit Image Properties" dialog so it is not possible to add an image.

User is in the site collection owner group and has "full control" permissions. Everything worked fine until few days ago and we can't figure out what happened or changed since then. This problem ocurres in both test and production environment.

I have found this error in logs: "AssetPickerDialog.LinksMenu_GoTo - Url to go to '/Site assets/myimage.jpg' is invalid: Invalid URI: The format of the URI could not be determined"

I am administrator on this site and I am not experiencing this kind of problems with my account.




Get user profile properties by its Full Name

$
0
0
i created a dummy user so it's account name is contoso\dummy and it's name in user profiles is appearing as dummy user(combination of first name and last name)
what i want is to get user profile properties of the user using c# by it's name like by dummy user

so tried below code 


String siteURL = SPContext.Current.Site.Url;
            SPServiceContext serviceContext = SPServiceContext.Current;

            using (SPSite siteCollection = new SPSite(siteURL))
            {
                using (SPWeb site = siteCollection.RootWeb)
                {
                    UserProfileManager upm = new UserProfileManager(serviceContext);
                    UserProfile user = upm.GetUserProfile("dummy user");

                  string   returnFirstName = user[PropertyConstants.FirstName].ToString();
                  string    returnImagePath = user[PropertyConstants.PictureUrl].ToString();
                }
            }


            


but when execute above code i get this error

An error was encountered while retrieving the user profile



so when i try to get user profile properties by it's account name by changing in above code with this line 
UserProfile user = upm.GetUserProfile("contoso\\dummy");

the code runs successfully


please suggest how can i get user profile profile properties by it's name as it's in user profile not it's account name.


SQL connection to Sharepoint List

$
0
0

I am trying to access the data contained in a SharePoint List, from an SQL Server which is on the same domain as my Sharepoint SQL server.

As a workaround, I managed to link to the List via MS Access (using the Sharepoint built-in functionality). However, this does not provide a real-time view of the data (you need to Refresh in order for the Linked Tables to be updated).

Ideally I would like to create an SQL View that will provide real-time access to the data contained in the List. Are there any guidelines for achieving this?

Hide a field inherited by the content type in a custom list definition

$
0
0

The requirement is to create new content type that inherits from a Parent content type. I also created custom document library definition that uses the newly created content type.

There are some fields that are inherited from the parent type that I would like "NOT TO" show in the edit/display form in the libraries created based on the new list definition.

How can I achieve this? In the list definition, I added ShowInEditForm="FALSE" and ShowInDisplayForm="FALSE" ShowInViewForm="FALSE".

But these fields won't hide and it still shows up when a new document is uploaded. Any help would be appreciated.

Thanks!

how can I get an item and it's attachments from the current list using SP's JavaScript Client Object Model on newform.aspx?

$
0
0
I only recently learned/read about SharePoint's JavaScript Client Object Model. I'm reading online trying to figure this out but not having much luck.

On newform.aspx (and dispform.aspx) I want to get thecurrent list, the last item created, and it's attachments. I now the CAML query I need to get the last item created, but first I have to get the current list and I am not sure how to do that.

I tried this but it returns null:
SP.ListOperation.Selection.getSelectedList()

OOTB Soap Service Exception,

$
0
0

Hi,

We are getting below mentioned error while trying to make a call using lists.asmx service. Can some one please help me in resolving the issue?

 at System.Net.UnsafeNclNativeMethods.OSSOCK.recv(IntPtr socketHandle, Byte* pinnedBuffer, Int32 len, SocketFlags socketFlags)
 at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, SocketError& errorCode)
 at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
 at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
 at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
 at System.Net.ConnectStream.ProcessWriteCallDone(ConnectionReturnResult returnResult)
 at System.Net.ConnectStream.CallDone(ConnectionReturnResult returnResult)
 at System.Net.ConnectStream.ResubmitWrite(ConnectStream oldStream, Boolean suppressWrite)
 at System.Net.HttpWebRequest.EndWriteHeaders_Part2()
 at System.Net.HttpWebRequest.SetRequestContinue(CoreResponseData continueResponse)
 at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
 at System.Net.HttpWebRequest.EndWriteHeaders(Boolean async)
 at System.Net.HttpWebRequest.WriteHeadersCallback(WebExceptionStatus errorStatus, ConnectStream stream, Boolean async)
 at System.Net.ConnectStream.WriteHeaders(Boolean async)
 at System.Net.HttpWebRequest.EndSubmitRequest()
 at System.Net.HttpWebRequest.GetResponse()
 at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
 at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
 at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
 at TMT.VMT.Business.VMTList.Lists.GetListItems(String listName, String viewName, XmlNode query, XmlNode viewFields, String rowLimit, XmlNode queryOptions, String webID)

Thanks,

Venugopal

I have retrieve a value from SharePoint list item

$
0
0

Hi All,

I have retrieve a value from SharePoint list item, i got this value: "2;#2"

now i want 2 from that list item.

how can i retrieve that value from list item.

Thanks in advance!

Calendar events not visible to anonymous users

$
0
0

Hi fellow SharePointers,

I got a sitecollection with anonymous access and want's to expose a calendar to the anonymous users. The calendar webpart is shown but none of the events is visible, only to authenticated users.

I have already granted anonymous access to the webapplication and sitecollection and calender list.

Furthermore I've tried to disable the ViewFormPagesLockDown feature, but without any luck.

If, however I switc the calendar webpart to eventview the events are shown to the anonymous users as well?!?!

What to do??


Javascript Client : Modal Dialog Callback value undefined.

$
0
0

Hi,

I'm writing in Javascript via a  Content Editor Webpart. 
The applicaiton flow here is :

  • Programatically create a new list item
  • Open the Edit dialog for the user to enter details
  • On Dialog close, perform further action on the new item

The first 2, I have sorted.
However, I am struggling to get hold of the lsit item after the dialog closes.

The code for opening the dialog, and handling the callback is below.
Closeecallback accepts 2 arguments; and 'value' is coming back undefined.

I have also tried a few other variations of declaring the options/ dialogReturnValueCallback, but all give me either null or undefined for argument 'value' when the callback occurs.

Hope somemone can shed somem light on what's going on / what I'm doing wrong !??

Many Thanks

 function new_item_succeeded() {  
SP.UI.ModalDialog.showModalDialog(
{              
url: 'http://<removed>/Tasks_Test/EditForm.aspx?ID=' + oListItem.get_id(),
             width: 1000,
               height: 500,
title: "New Item",
dialogReturnValueCallback:CloseCallback         
}    
);  


function CloseCallback(result, value) {
if (result === SP.UI.DialogResult.OK) {   
// do stuff  
}  
if (result === SP.UI.DialogResult.cancel) {
// do stuff  

}


as adding web part on event receiver when a site was provisioned in SharePoint 2010?

$
0
0
as adding web part on event receiver when a site was provisioned in SharePoint 2010?

Publishing Infopath form on SharePoint site

$
0
0

Hi,

 

We are working on some assignment for customer,

 

We have created a Excel with External Data source (SQL database) to pull data into worksheet. We have used option ‘Refresh data when opening the file’. We are using that data to create Power view reports in excel. This excel is to be published on share point online site. We uploaded this excel on share point site. But When it is opened in Online Excel it shows warning as 'Be careful.This workbook contains one or more queries that might be unsafe.Do you want to enable these queries?.'

If click yes it shows error 'External Data Refresh Failed:We are unable to refresh one or more data connections in this workbook.The following connections failed to refresh:'.

Please note that we don’t have central administration rights over share point online site so we can’t do settings for the same there.

Regards,

Sudheer

Please Note that we don’t have central administration rights over share point online site so we can’t do settings for the same there.

 

Can we do this data refresh whenever file opens (without central admin rights)?

Please Note that we don’t have central administration rights over share point online site so we can’t do settings for the same there.

 

Can we do this data refresh whenever file opens (without central admin rights)?


Thanks & Regards, Sudheer

Workflow waiting for field change

$
0
0

If I create a workflow that waits for a field change in a list item, but the field never changes, will the workflow wait forever or will it eventually cancel?

Thanks


J Sykes

Error because of override of owshiddenversion data

$
0
0
Hello all,

I am getting following error in ULS log while updating a PropertyBag value of a listitem in document library. It is being thrown from source -  sharepoint foundation. I am using SharePoint 2010.

Did any one here have experienced this error and know reasons for it?
Can this error fail the saving of property bag value for a list item?

Error
12/02/2014 12:38:08.50CustomProcess.exe (0x21B4)0x183CSharePoint FoundationGeneral8e2mHighError because of override of owshiddenversion data: list name = TestDocLib, item id = 2867

Please note, versioning is not enabled on document library.

Regards,
Indra

Thanking You,

SPLongoperation alternative

$
0
0

Hi All,

I am using a very time taking operation which returns around 2 to 3 lakh records. For this I was using SPLongOperation but it requires us to redirect somewhere when operation is completed

But as results need to be shown on same page this was failing. So I used session variable approach and saved these records in session variable and when user is redirected to same page i showed records from this variable.

But this approach also failed as sticky session is not maintained in environment and load balancer routes request to any WFE so sometimes this session variable is not found.

Is there any alternative for SPLongOperation or can I use something with Iframe or something to overcome this issue. I wont be able to change setting of load balancer for maintaining load sticky session.

Please help!!

Update a SharePoint list with a list on another SharePoint Site.

$
0
0

I am using SharePoint 2010

A SharePoint list that needs to get updated (records added) from another SharePoint List. The trouble is that they are on two different SharePoint sites. I have done so much research to figure this out, but nothing has worked. Am I missing something? I am not a true programmer, but can usually alter basic scripts for my own use.

Any and all suggestions are greatly appreciated

  • An SSIS package using WCF Services (formally ADO.net)
  • SSIS package and SharePoint WebServices
  • Perhaps even a SSIS package to pull the data to SQL Server via a Service Reference and then append to the second SharePoint list
  • MS ACCESS linked table.
  • PowerShell
  • SharePoint List Adaptor via CodePlex


Update an existing document in a Document Library

$
0
0

I have an application page that allows users to view a list of documents that are tied to a vendor (W9s, proof of insurance, etc.).  Users will need to be able to update the documents through this page when the need arises.  In my process I am getting the file name of the file that is currently in the library since I am creating a custom file name for each file, and then using that as the filename for the new file.  I'm having a problem using this line of code to update the file in the library:

 theDoc = vendorDocuments.RootFolder.Files.Add(originalFileName, fileBytes);

I'm being told that the current file exists, which I know it should.  How should I go about updating a file in a doc library?

How to include JavaScript in a list instance's form in Visual Studio

$
0
0
So I know you can use JSLink to include JavaScript files in list definitions in Schema.<g class="gr_ gr_8 gr-alert gr_spell ContextualSpelling ins-del multiReplace" data-gr-id="8" id="8">xml</g> like so:

<Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" JSLink="~site/SiteAssets/Scripts/jquery-1.11.1.min.js" />
But how can I do this with a list instance that I'm provisioning that's based on the tasks list definition? Is there somewhere I can include JSLink in the instance's Elements.xml?

csom javascript get Document Libraries with particular Content Type

$
0
0
I need to filter result to particular content types fo document library. I cannot seem to retrieve the content type of library. How is this <g class="gr_ gr_29 gr-alert gr_gramm Punctuation multiReplace" data-gr-id="29" id="29">possible.</g> When I try with  oList.get_contentTypes() <g class="gr_ gr_28 gr-alert gr_spell ContextualSpelling only-del replaceWithoutSep" data-gr-id="28" id="28">object object</g> is being returned.

function retrieveAllListProperties() {


    var clientContext = new SP.ClientContext();
    var oWebsite = clientContext.get_web();
    this.collList = oWebsite.get_lists();
    clientContext.load(collList);

    clientContext.executeQueryAsync(
        Function.createDelegate(this, this.onQuerySucceeded), 
        Function.createDelegate(this, this.onQueryFailed)
    );
}

function onQuerySucceeded() {
    var listInfo = '';
    var listEnumerator = collList.getEnumerator();

    while (listEnumerator.moveNext()) {
        var oList = listEnumerator.get_current();
        listInfo += 'Title: ' + oList.get_title()  + oList.get_contentTypes() + '\n';
    }
    alert(listInfo);
}

Unable to Run the Power shell script getting Cannot index into a null array.

$
0
0

Hi i am new to powershell script

below i have written code :

 if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) {
     Add-PSSnapin Microsoft.SharePoint.PowerShell;
 }
 
 $WebURL="http://sharepoint/ops/cts"
 
 #Get the "Case Library" List
 $List=$WebURL.Lists["Case Library_Test"]
 $ListItem=$Lists.Items
 
 #Get the "Task List"
 $Source_List=$WebURL.Lists["Task_Test"]
 
   foreach($item in $ListItem)
   {
      $Processing_Status= $item["Processing Status"]
       
      $Case_CompletedDate= $item["Case Completed Date"]
     
      if($Processing_Status -eq "6 - Closed - Approved" -and (!$Case_CompletedDate))
     
      {
       
         $Case_ID=$item["ID"]
        
         $Source_Listitem=$Source_List.Items | where {$_['Case Lookup'] -eq "Case_ID" }
        
         $item["Case Completed Date"]=$Source_Listitem["Due Date"]
        
         $item.Update()
        
         $List.Update()
     
      } #End Task List Loop
     
   } #End Case Library List Loop

i have written power shell script , while i am running it throws below error

Cannot index into a null array.

At C:\PowerShell\UCD.PS1:9 char:22

+  $List=$WebURL.Lists[ <<<< "Case Library_Test"]

    + CategoryInfo          : InvalidOperation: (Case Library_Test:String) [], RuntimeException

    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.

At C:\PowerShell\UCD.PS1:13 char:29

+  $Source_List=$WebURL.Lists[ <<<< "Task_Test"]

    + CategoryInfo          : InvalidOperation: (Task_Test:String) [], RuntimeException

    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.

At C:\PowerShell\UCD.PS1:17 char:33

+       $Processing_Status= $item[ <<<< "Processing Status"]

    + CategoryInfo          : InvalidOperation: (Processing Status:String) [], RuntimeException

    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.

At C:\PowerShell\UCD.PS1:19 char:34

+       $Case_CompletedDate= $item[ <<<< "Case Completed Date"]

    + CategoryInfo          : InvalidOperation: (Case Completed Date:String) [], RuntimeException

    + FullyQualifiedErrorId : NullArray

Please help me

How migrate list data from one web application to another web application?

$
0
0

Am having a list with bulk data.  I want to move the data to one list to another list in diff web application.

Any suggestions would be appriciated.

Viewing all 11571 articles
Browse latest View live


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