Sharepoint retrieving data from WebPart containing custom fields - c#

I've got a site with WebPart containing custom fields.
http://wsscg.blob.core.windows.net/resources/forum/front/aa432.PNG .
My goal is following: I want to add a button below this form and after click, data from it goes to a custom list.
So far I've managed to add a button and a code inline with Sharepoint Designer. It adds some data (like 1,2,3,4,5) to the list that I want. But the problem (probably last) is how to retrieve data from the form.
I would highly appreciate any help.

I recommend you to search here: http://sharepointjavascript.wordpress.com/
I've found there many useful client-side gotchas.
Site seems down today, but take a look at cached version of dynamic js sp form:
http://webcache.googleusercontent.com/search?q=cache:j97GDCJkwsYJ:sharepointjavascript.wordpress.com/2012/01/19/dynamic-forms-for-sharepoint/+&cd=2&hl=en&ct=clnk&gl=en
where getFieldValue function used.
Hope that can help.

Related

Creating a custom pop up for Umbraco back office

[Final EDIT] Here is a link to the code I wrote in case it helps anyone.
I think I have a solution. Umbraco uses asp.net files for their popups
which is something I haven't used yet but I think I can get the hang
of it. I don't know how to access the aspx from within my class,
should I make a code behind partial class?
Thanks for any help.
I am developing a multi-lingual site, using Umbraco, where content nodes are automatically copied to each language as they are created. Is there any way to implement a custom popup to confirm that it should be copied to all instead?
This wouldn't actually be on the site, rather in the back office.
Or is it possible to open a browser popup with c# as all I really need is a bool value from a message box?
[EDIT: added possible solution]
I sorted this by adapting Umbraco's own create function. I made a new .aspx file and added the functionality that I needed to the code behind.
I was able to add a context menu item that allowed me to call my new page and from there called a method to duplicate the content.
From the method, I pass the new node and get the parent id. Then I compare all the node names for those that match and use the umbraco document.copy() method to recreate the content under each language at the correct position.
If I can make the code more generic then I will upload it as a package to Umbraco.

asp.net TextBox predictive text

I have a list of items which is a bit too large for a dropdownlist and I'd like to add a search textbox which based on the input will drop down a list of matching items.
So if you put in John the list below would display any items that start with John.
How to go about doing that?
The feature you are referring to is commonly labeled "AutoComplete".
If you are not at all familiar with how to do this, I would suggest following a tutorial or leveraging a pre-existing solution.
There is an example using the ASP.NET AJAX Control Toolkit available at:
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AutoComplete/AutoComplete.aspx
The basic idea is that when input is changed, JavaScript will send an asynchronous HTTP request to the server and find out what the auto-complete items should be, then it will fill the drop down options with the returned values.
Well what you want to look at is the autocomplete libraries that are available.
In your case, ASP.NET AJAX control toolkit has this functionality.
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AutoComplete/AutoComplete.aspx
There are other options such as :
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/autocompleteclientside/defaultcs.aspx. This is from telerik and not free though.
http://harvesthq.github.com/chosen/ - quite new and looks promising, but not ASP.NET specific.

Dynamics CRM 2011 - Custom form with duplicate checking

I need to create a custom opportunity form which will almost mirror the out of box one but would like to add a section for checking duplicate records.
The overall goal is that when the form is filled out that section should populate with possible duplicate records to merger with.
I know there is out of box duplicate checking but not sure if it can be implemented this way.
Thanks,
Jon
You should be able to build a Web Resource in an IFrame that uses javascript to call the RetrieveDuplicatesRequest message. Here's a link that should help:
http://crm-edinburgh.com/2011/08/crm-sdk-using-detect-duplicates-settings-in-code/
This assumes that you already have Duplicate Detection set up and running.

Preset html files built into program?

I'm trying to create a very basic web site creator in C#. I already created the templates but have no idea how to get them in the program so the user can pick one and customize it. Is there a certain library I should look into? I've bee told this can be easily created in php but I'd rather not go down that route.
If using .NET you can use WebControl controls to display a preview of your templates and make the user decide which one he wants.
Or a list of templates and single WebControl that parse and display the HTML of the current selected list item (template) and then make the user select.
To edit, just a bunch of controls (one for each template placeholder) that updates the view of the WebControl.
In the top link you found how to do it.
P.S. Templates can be stored on XML, Plain Text, DB or any other mean.
Either store the templates as files on the web-side and use them as templates, or store them in a DB. Unless your app is not web-based, in which case the same advice pretty much applies.

SharePoint most clicked links

I am trying to make a web part that will display what links got clicked/viewed the most across the whole site collection. These links come from a SharePoint list.
Is there a mechanism in the object model that can be used to accomplish this?
Any thought would be helpful.
If the links all go to SharePoint pages within your portal, then you might be able to gather the information in your Site Usage Report, then query that in a custom web part. If the links point to places outside your portal, I am not aware of any out-of-the-box record of which links are getting clicked on in a SharePoint list. You could possibly make some javascript to add special code to the list interface so that, whenever a link is clicked, it first records to a database, then takes the user to the destination.

Categories