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

Javascript issues in chrome/ firefox

$
0
0

Hey guys,

So here's the issue, I put some javascript on a new item form page to add links to new items. It works in internet explorer, but not in chrome or firefox. I looked through a bunch of posts that were saying to add code to the master page and such for chrome issues... but nothing I have tried as solved the issue. I did notice that the id column in chrome and firefox end with "lookup" instead of "ctl01"... but even changing it to lookup doesnt make it work in chrome or firefox.

This is the error I'm getting: ":/_layouts/sp.ui.rte.js?rev=BLlQeFB9Ir0NFBHuN%2BTQwg%3D%3D:2 Uncaught TypeError: Cannot read property 'parentElement' of null

Here is the javascript:

<script language="javascript" src="http://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>

<script language="javascript" type="text/javascript">


jQuery(document).ready(function($) {
   $(document.getElementById("ctl00_m_g_99723090_4d65_4080_a237_4cbb0a4af9a6_ctl00_ctl05_ctl00_ctl00_ctl00_ctl04_ctl00_ctl01")).closest("td").append('<br><a href="javascript:var options=SP.UI.$create_DialogOptions();options.url=\'http://urlofpage\';options.height = 700;options.dialogReturnValueCallback = RefreshOnDialogClose;void(SP.UI.ModalDialog.showModalDialog(options))">Add New Customer</a>');
});

jQuery(document).ready(function($) {
   $(document.getElementById("ctl00_m_g_99723090_4d65_4080_a237_4cbb0a4af9a6_ctl00_ctl05_ctl01_ctl00_ctl00_ctl04_ctl00_ctl01")).closest("td").append('<a href="javascript:var options=SP.UI.$create_DialogOptions();options.url=\'http://urlofpage\';options.height = 700;options.dialogReturnValueCallback = RefreshOnDialogClose;void(SP.UI.ModalDialog.showModalDialog(options))">Add New Contact</a>');
});</script>




A hyperlink for "Upload Documents in SharePoint Library"

$
0
0

I am trying to create a hyperlink in my SharePoint Site home page which will help the user to browse the documents and upload it into a particular SharePoint Library. 

Any suggestions will be highly appreciated.

Thanks

How To Save form Details into Document Library

$
0
0

Hi All,

I have created form as a visual webpart in SharePoint site, this list having details of the document library details, like name of the doc, location, Employee and uploaded document.

Now i want to save this details into custom document library, for this i have used the same way a list item updated.

but, i got the below error

" To add an item to a document library use SPFileCollection.Add()"

Any Help, How to do the same?

Thanks in Advance!

Dropdown selected index change was not working on sharepoint2010 layout pages

$
0
0

Hello All,

I have created drop down control in share point 2010 custom master pages. In Site/Site collection when page load is happening, dropdown is getting filled with SharePoint list data and working as expected. However when i go to _layout pages (for e.g. _layouts/viewlsts.aspx) and then click on dropdown control all the dropdown value disappears. Could anybody please guide me through this issue and any idea what causing this problem?

Thanks for your prompt response on this.


Regards Anil.R

sharepoint 2010 - DVWP vs. SPServices vs. JSOM vs. ListData.svc vs. owssvr.dll

$
0
0
So I do not know the official/technical names for all the different options but I'm wondering which way people use and why? I'm having a hard time picking which option to use for my purposes and was hoping to hear other people's thoughts.

Event Receiver - Can I use Sleep in C# code to wait for several days or months? Any issues with this?

$
0
0

Hi there,

Sorry - I canNOT use Workflows! This has to be an event receiver.

In my C# Event Receiver - I have to take an action after a particular date is reached (which can be several days/months).

Is it okay for me to use Sleep(3 months) in code? Any issues this can cause?

Thanks so much.


rename title column and delete a column into view custom list

$
0
0
Hi;

I try to create a new custom list with only 2 column DEC et DSCC and I would like to rename or change the title column (Titre in french) with the name "DEC" and next hide or delete into the view "All elements" the column attached file ("Pièces jointes" in french).

My code is :

function CreateCustomList
{
  param(
  [string]$web
  )

$spWeb = Get-SPWeb -Identity $web
$list=$spWeb.Lists.TryGetList($listeEspaceRTO)
if($list -eq $null)
{
 $spTemplate = $spWeb.ListTemplates["Liste personnalisée"]
 $spListCollection=$spWeb.Lists
 $spListCollection.Add($listeEspaceRTO,"Liste espace RTO",$spTemplate)
 $path = $spWeb.url.trim()
 $spList = $spWeb.GetList("$path/Lists/$listeEspaceRTO")
 
 $spList.Fields.Add("DSCC","URL",$false)

 $Views = $spList.Views["Tous les éléments"]
 //$Views.ViewFields.delete("Pièces jointes")
 //$Views.ViewFields.Add("DEC")
 $Views.ViewFields.Add("DSCC")
 $Views.Update()
}
else
{
  write-host -f yellow "la doc lib" $listeEspaceRTO "exits"
}
$spWeb.dispose()
}


The custom list is correctly created but with Title and the column "Pièces jointes" into the view.

Regards

Content Query Web Part Customization

$
0
0
In one of our organization's Intranet portal there are several Content Query Web Parts that has customized UI example a rotating banner, Latest News & Updates, etc.

I am really confused how the CQWP UI has been customized because I have never customize it so far. I checked settings but no reference of any XSL file but still all CQWP has sophisticated customized UI.

Any idea how these customization would have been done?

SharePoint 2010 chart web parts how to take filtered counts?

$
0
0

Hi

I have custom list with following structure:

Project Name |Status|Project Manager|...

I want to create stacked chart in which X axis will represent Project Manager. And Y axis will represent count of items grouped by status. Example image is given below:

green - completed

yellow - in progress

red - cancelled

I have created another list which will store data like:

Manager | status| Count

MR.ABCcancelled  1

PQIn progress  5

....

This list is used to create stacked chart.

How can I keep this list synchronized with the actual list? Is there any way other than writing event receivers in Visual Studio? 

SharePoint DataView Webpart

$
0
0

Hello Techies,

I have  a list which has one column as Status(Dropdown-Choice) with following options: Assigned, Rejected,Answered.

I need to get the count of all item based of Status-options.

for eg Count of all Assigned Items, Rejected Items and Answered Items

I have tried with dataview webpart through SPD but facing few issues .Any help will be appreciated.

Create List Item using SharePoint 2010 Workflow

$
0
0

Hello everyone.

I found in youtube video using SP Employee Onboarding Web Part, idea is quite simple and powerful. But this web part available only in SP 2013, and I use 2010. So I wanted to develop my own version.

Questions is:

I have 2 lists Employee OnBoards (list contains data about new employee) and Employee OnBoards Tasks (list contains approval task). Where field Employee Name from Employee OnBoards list is lookup field in Employee OnBoards Tasks list.

I need emplement next:

When new Item created in Employee OnBoards list, it should copy Employee Name value to the Name field of the Employee OnBoards Tasks list.

I hope I explained understandable.

Thanks.

Linking Event List to Master Calendar Month/Year

$
0
0
I have two web parts: Master Calendar and below it Event List. Master Calendar contains Events for this month. However Event List contains all events from current and previous years. But I need it to show only events for this month (e.g. January 2015). I can manually enter filter using Start and End Time columns but the whole point of the exercise to refresh Event List when user will go to previous or following month so Event Lists should show events for December 2014 or February 2015. I would appreciate your help.

Query a Sharepoint 2010 List for an Item

$
0
0

I realize that this seems like a simple request however, please allow me to explain further. I have our server that hosts sharepoint able to server up php pages(as I am uncomfortable with .NET). I figured this would open up a whole new world in the way of being able to program up simple apps that I could then interact with data stored in Sharepoint. What I am trying to do right now is just my own form of autocomplete.

On my PHP form I have a place for a number. I would like to be able to query a list in Sharepoint for that number and loads its corresponding description into a field near where the user enters the number. I have some novice-intermediate experience at this point successfully manipulating forms in sharepoint and using jQuery that I am now trying to break out to my own PHP applications/forms. However it seems no matter how I try to query Sharepoint I get an error or my java script fails.

I believe what I am looking for is a way to query a sharepoint list on sp.domain1.com from a php page hosted on myPC.domain1.com. Both the SP server and my pc are on same domain same subnet.

Thank you in advance for all the help!

<html><script src="http://sharepoint.domain1.com/jQuery/jquery-1.7.2.min.js" type="text/javascript"></script><script src="http://sharepoint.domain1.com/jQuery/jquery.SPServices-2014.02.min.js" type="text/javascript"></script><script type="text/javascript">
//**********This code returned an error in Status*********
	$(document).ready(function() {
		alert("Form Loaded");
		var mySPurl = "http://sharepoint.domain1.com:80/";
		var tmp = "100000218";
		$.support.cors = true;
		$().SPServices({
			operation: "GetListItems",
			crossDomain: true,
			async: false,
			listName: "Materials",
			webURL: mySPurl,
			CAMLViewFields:"<ViewFields><FieldRef Name='Title' /></ViewFields>",
			completefunc: function(xData, Status){
				alert(Status);
			}
		});
	});</script><body><ul id="tasksUL"/><?php
	echo 'Hello World!'
?></body></html>


//************This code wont make it past <SP.ClientContext.get_current();>
function getSAPInfo(MatNumField) {
		alert('Getting SAP Info...');
		var clientContext = new SP.ClientContext.get_current();
		alert("Context Retrieved.");
		var oList = clientContext.get_web().get_lists().getByTitle('Materials');
		var tmp = getField('input', Num).value;
		//var camlQuery = new SP.CamlQuery.createAllItemsQuery();
		var camlQuery = new SP.CamlQuery();
		camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Title" /><Value Type="Text">'+tmp+'</Value></Eq></Where></Query></View>');
		this.collListItem = oList.getItems(camlQuery);
		clientContext.load(collListItem);
		clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
	}

	function onQuerySucceeded(sender, args) {
			var index = 0;
			var listItemEnumerator = collListItem.getEnumerator();
			var MatDescr;
			alert("Query Succeeded!");
			listItemEnumerator.moveNext();
			oListItem = listItemEnumerator.get_current();
			MatDescr = oListItem.get_item('Description');


			getField('input', 'Descr').value = MatDescr;
		}

		function onQueryFailed(sender, args) {
			alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
		}	

Again any assistance is most appreciated I have been trying to get this seemingly "simple" functinality working for 4 days straight now. {frustrated}

Thanks Guru's!

 

Importing data from an excel spreadsheet into a list

$
0
0

I have a custom list that I have created in visual studio that is based off an existing excel spreadsheet.  Now that I have the list created I want to add data to my dev environment so I can have something to test against (FYI, I'm building a donations request log that will track the requests along with how much was requested vs. how much as actually donated during the fiscal year).

How would one go about doing this?

HttpSessionState usage in Sharepoint 2010

$
0
0

Hi all,

I am new to sharepoint. I am developing a webpart that will be deployed in a sharepoint farm on a web application.

I am required to use HttpSessionState object for persisting some information.

Is it safe to use HttpSessionState in a farm as I have seen many posts saying it is not safe to use HttpSessionState objects in farm environment.

Thanks in advance.


srnitk


Redirecting one web application to another web application without Credentials prompt in Sharepoint 2010

$
0
0

Hi

 I need to redirect the one web page to another web page(aspx) in Sharepoint 2010 running under same IIS. While redirecting it should not ask the credentials prompt as it is authenticated(windows) initally hit the URL.

Authentication mode : Windows only

How to achieve this ?

Regards,

Siva


Huge List Problem

$
0
0
I have a list with 28,000 items. I want to delete everything except the latest months worth of data. This will be basically deleting 27,000 items. I cannot view this list in data view as the view exceeds the base 5000 items. How can I delete these items? After it is done I will set up a retention policy.

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

Getting exception when trying to debug TimerJob

$
0
0

After attaching TimerJob with OWSTIMER.exe to debug when I clicked Run Now for my timerjob from job defination page then below exception occured -

System.ServiceModel.EndpointNotFoundException was unhandled
  Message=Could not connect to http://localhost:5725/ResourceManagementService/MEX. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:5725. 
  Source=mscorlib
  StackTrace:
    Server stack trace: 
       at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
       at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at System.ServiceModel.Description.IMetadataExchange.Get(Message request)
       at Microsoft.ResourceManagement.WebServices.MetadataClient.Get(Message request)
       at Microsoft.ResourceManagement.WebServices.MetadataClient.Get(String dialect, String identifier)
       at Microsoft.ResourceManagement.WebServices.Client.ResourceManagementClient.GetSchema()
       at Microsoft.ResourceManagement.WebServices.Client.ResourceManagementClient.SchemaManagerImplementation.RefreshSchema()
       at Microsoft.ResourceManagement.WebServices.Client.ResourceManagementClient.SchemaManagerImplementation.get_Instance()
       at Microsoft.ResourceManagement.WebServices.Client.ResourceManagementClient.SchemaManagerImplementation.Initialize(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)
  InnerException: System.Net.WebException
       Message=Unable to connect to the remote server
       Source=System
       StackTrace:
            at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
            at System.Net.HttpWebRequest.GetRequestStream()
            at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
       InnerException: System.Net.Sockets.SocketException
            Message=No connection could be made because the target machine actively refused it 127.0.0.1:5725
            Source=System
            ErrorCode=10061
            NativeErrorCode=10061
            StackTrace:
                 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
                 at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
            InnerException: 

How to avoid this and what is going wrong.. Please help..


Rushikesh_Khadtare

InfoPath forms deployment issue

$
0
0

Hi,

We are working on SP Designer 2010 workflows and InfoPath 2010.

Can you please let us know a way to deploy InfoPath forms associated with the workflows from one environment to another?

Thanks,

Anuja

Viewing all 11571 articles
Browse latest View live


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