Webpart button that assigns user to list item
I need a button event that when clicked assigns the user to the list item that is selected from a checkbox. All from a webpart. Unfortunately for me corporate will not let us use Visual Studio (security access to critical info and what not).
I have access to InfoPath and SharePoint designer content editor and such. I tried circumventing it all together and built a button in the form that only shows when in edit mode from the webpart. The button simply assigns user to the people picker, which shows
in InfoPath preview. But when I try to do the same in the live edit able list item the people picker just blinks and nothing fills the text field. I even tried using a simple text box which worked but only for userid() not display name. Anybody know
why people picker field appears blank in the live version? Or can someone point me to where I can build an outright webpart button that fills my assignto field? I don't quite understand how to do it. What I have seen has been done with visual studio. Any help
would be great.
Hi Jack,
First of all, you can not create a coded web part using SPD.
What you can do is create custom page (aspx) and do inline coading. (http://social.technet.microsoft.com/Forums/sharepoint/en-US/211d3c10-ab83-473f-95b4-83b0174f9dd7/how-to-add-custom-web-part-to-sharepoint-page-by-using-sharepoint-designer?forum=sharepointgeneralprevious)
Custom page allows you to add c# code with enable page compiling with
<PageParserPaths>
<PageParserPath VirtualPath="/PageLibrary/MyCustomPage.aspx" CompilationMode="Always" AllowServerSideScript="true" />
</PageParserPaths>
OR
Write all into Content editor web part on that page.(http://social.technet.microsoft.com/Forums/sharepoint/en-US/f6d8c243-71af-4a98-bdb6-750d4dd9dc27/check-box-and-button-in-content-editor-web-part?forum=sharepointgeneralprevious)
Here you can use Javascript only and not "c#" due to security issue.(http://social.msdn.microsoft.com/Forums/sharepoint/en-US/74b676f0-3509-4b11-8725-b9f2626371e9/content-editor-web-part-and-c?forum=sharepointdevelopmentlegacy)
Similar Messages
-
Can you create a button that allows users to save content?
I am trying to come up with a way that allows a user to save their certificate (created using the widget in Captivate 4) if they don't immediately have access to a printer. Is there some code I could attach to a button?
What about printing to a pdf-document? There are a lot of free PDF-writers around.
Lilybiri -
I have now got version 4.0.1 and am running on Vista.
You can get the drop down list by either right-clicking on the back/forward buttons, or holding down the left button until the list appears.
If you want the drop-down arrow you can add it with the Back/forward dropmarker add-on - https://addons.mozilla.org/firefox/addon/backforward-dropmarker -
I upgraded to firefox 4 but I can't see the Firefox Button that contains all the menu items.
I see the old style with the following options:
File Edit View [etc..]Go to the View > Toolbars menu item, then click the checked item for Menu Bar. That should turn off the classic display and instead display the single Firefox item.
-
Can i create a button that allows users to insert a line into a table if neede more space
if so how in step by step please and thank you
Hi,
In Acrobat Form, you create a hidden Text Field which will only get visible on a Button click for inserting additional text.
Regards,
Anoop -
Allow user to select each item in list item only once.
Hi,
What is the best way to go to stop the user selecting the same item in a list item more than one.
I have a multi record block, the user can select values 1-10 for each record, but they should not be allowed to select duplicates.
Thanks for any help!Hi,
Suppose you have 4 list items A,B,C,D in block "test" and same 4 values in each list item. Now you want that, no two values selected by user in list item should be same.
On when-validate-item of list item B write code like :
If :test.A is null then
Message('First A must be enter");
Raise form_trigger_failure;
end if;
If :test.B = :test.A then
Message('value already in list item A');
Raise form_trigger_failure;
end if;
Now, for C same code with a addition of condition for B with OR operator like:
If :test.C = :test.A or then :test.C = :test.B
Like that.... you can achive your functionality.
But one restriction is that user has to enter values in list item in a pre-defined order only....
Hope that it would work for you..... -
Get top 3 User with most List Items
Hi all,
I have 3 lists and I want to display in a WepPart the top 3 User with most created Items.
Say we have U1, U2 and U2 -user that have created some list items in List A. User U1 has the most list items, so it will appear at first position,... and so on, ok?
Top 3 User for List A
U1
U2
U3
Does someone have done this task alredy?
thanks for any suggestions
Regards,
MartinYou should be able to use a Content Search Web Part to build a query scoped to those lists to provide this information. Here is one article I quickly found showing it and many others out there that should help you get on your way.
http://www.sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?ID=185 -
hi ,
i have items in the form , the user need to visible this item with him self , so i make all the items visible = no
and make list item and but all the items in list value
when list item chanched and the user select any item the item will visible = yes
the form like that
list item named = bank
value in the list ( bank_name= 1
bank_address = 2)
and i have 2 items in the form
bank_name
bank_address
both of them visible = no
and i make trigger ( WHEN-LIST-CHANGED )
if :bank =1 then
SET_ITEM_PROPERTY('bank_name', VISIBLE , PROPERTY_TRUE);
elsif :bank=2 then
SET_ITEM_PROPERTY('bank_ADDRESS', VISIBLE , PROPERTY_TRUE);
end if ;
the qustion is
when the item visible = yes after the user selected it from the list
how can make this itme visible = no
when the user selected the same item ?
thank youHello,
One idea is to make that conrtol using one list item. Suppose you have two item names in the list then create two parameters/global variables in the form and use them like this...
Trigger = WHEN-NEW-FORM-INSTANCE
:PARAMETER.NAME_FIELD:='N';
:PARAMETER.ID_FIELD:='N';Now in the WHEN-LIST-CHANGED trigger use the code as below...
IF :list_name='NAME_FIELD' THEN
IF :PARAMETER.NAME_FIELD='N' THEN
SET_ITEM_PROPERTY('NAME_FIELD',VISIBLE,PROPERTY_TRUE);
:PARAMETER.NAME_FIELD:='Y';
ELSE
SET_ITEM_PROPERTY('NAME_FIELD',VISIBLE,PROPERTY_FALSE);
:PARAMETER.ID_FIELD:='N';
END IF;
ELSIF :list_name='ID_FIELD' THEN
IF :PARAMETER.NAME_FIELD='N' THEN
SET_ITEM_PROPERTY('ID_FIELD',VISIBLE,PROPERTY_TRUE);
:PARAMETER.ID_FIELD:='Y';
ELSE
SET_ITEM_PROPERTY('ID_FIELD',VISIBLE,PROPERTY_FALSE);
:PARAMETER.ID_FIELD:='N';
END IF;
END IF;HTH.
-Ammad -
Preventing user from selecting item in JTree
Does anyone know how to prevent the user from being able to change the cell in the tree that is currently selected?
I have a JTree that the user can select items from but I want them to be able to click on a button and no longer be able to select an item in the tree until another button is pressed.
Any ideas?hi
i hope the code below helps ur purpose
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.tree.*;
public class Frame1 extends JFrame {
JPanel contentPane;
BorderLayout borderLayout1 = new BorderLayout();
JPanel jPanel1 = new JPanel();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
MyTree jTree1 = new MyTree();
boolean blnSelection = true;
/**Construct the frame*/
public Frame1() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
catch(Exception e) {
e.printStackTrace();
/**Component initialization*/
private void jbInit() throws Exception {
//setIconImage(Toolkit.getDefaultToolkit().createImage(Frame1.class.getResource("[Your Icon]")));
contentPane = (JPanel) this.getContentPane();
contentPane.setLayout(borderLayout1);
this.setSize(new Dimension(466, 319));
this.setTitle("Frame Title");
jButton1.setText("jButton1");
jButton1.setBounds(new Rectangle(83, 254, 79, 27));
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton1_actionPerformed(e);
jPanel1.setLayout(null);
jButton2.setText("jButton2");
jButton2.setBounds(new Rectangle(177, 256, 89, 23));
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jButton2_actionPerformed(e);
jTree1.setBounds(new Rectangle(93, 30, 252, 195));
contentPane.add(jPanel1, BorderLayout.CENTER);
jPanel1.add(jButton1, null);
jPanel1.add(jButton2, null);
jPanel1.add(jTree1, null);
/**Overridden so we can exit when window is closed*/
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
System.exit(0);
void jButton1_actionPerformed(ActionEvent e) {
blnSelection = false;
jTree1.setSelectionPath(null);
void jButton2_actionPerformed(ActionEvent e) {
blnSelection = true;
class MyTree extends JTree implements TreeSelectionListener
public MyTree()
super();
init();
private void init()
this.getSelectionModel().setSelectionModeTreeSelectionModel.SINGLE_TREE_SELECTION);
this.addTreeSelectionListener(this);
this.setEditable(false);
DefaultMutableTreeNode selectedNode = null;
public void valueChanged(TreeSelectionEvent evt)
if(!blnSelection)
this.setSelectionPath(null);
else
TreePath tpSelectedTreePath = evt.getNewLeadSelectionPath();
this.setSelectionPath(tpSelectedTreePath);
cheers -
Need to do conditional processing based on just-selected list item
hi -- I have a vertical, unordered list. Each list item branches to a different page when selected.
When the list item is selected, and before the branch happens, I need to do some conditional processing
that depends on which list item was just selected.
How can I get information about which list item was just selected?
Thanks,
CarolCarol - List items get rendered as links on the page so as soon as you click the link the browser goes there. You can't normally run a process on the current page by clicking that link. I suppose you could build each list item target (defined in the list item definition) to use javascript that submits the page, perhaps passing the item name as the "request" value. Then when the page is submitted, an after-submit process could do whatever you need it to and similarly a branch could be defined for each list item that would take the user to the intended page.
Scott -
How to check whether a list item is highlighted or not
I have delete button.Have to alert the user if user does not select any itemin list
Below is the code I have written in When Button Pressed Trigger:
Begin
v_currValue := NULL;
v_currValue := Name_In('CONTROL.ENTITY_LIST');
If (v_currValue is null) then
v_alert_button := MSGBOX ('Select the entity type to be deleted.', 'STOP', 'Delete');
if v_alert_button = alert_button1 then
raise v_exception ;
go_item('CONTROL.ENTITY_TYPE');
end if;
End if;
v_curlist_index := Get_List_Index ('CONTROL.ENTITY_LIST');
Delete_List_Element('CONTROL.ENTITY_LIST',v_curlist_index);
End
Above code works fine means alerts the user when there are no elements in the list.
And if there are 4 elemnts
emp
dept
sal
loc
when clicks delete button it alerts the user to select the item
now v_currvalue = emp;
after deleting list contains 3 values
but v_currvalue still remains 'emp'
even i keep vcurrvalue = null or ''
it is still emp.
Is there any way to solve this or there is any bug inmy code.
Could anyone helpme in this?
Thanks,b]/** First approach which didnt worked **/
Begin
v_currValue := to_char(' ');
v_currValue := Name_In('CONTROL.ENTITY_LIST');
If (v_currValue is null) then
v_alert_button := MSGBOX ('Select the entity type to be deleted.', 'STOP', 'Delete');
if v_alert_button = alert_button1 then
raise v_exception ;
go_item('CONTROL.ENTITY_TYPE');
end if;
End if;
v_curlist_index := Get_List_Index ('CONTROL.ENTITY_LIST');
Delete_List_Element('CONTROL.ENTITY_LIST',v_curlist_index);
End
Above is my previous code
I want to alert the user by using v_currvalue
/** Second type of approachwhich worked **/
/* Retrieves the index of the current item in the list */
v_curlist_index := Get_List_Index ('CONTROL.ENTITY_LIST');
/* Alert the user if list item is not selected */
If( ( v_curlist_index = 0 ))then
v_alert_button := MSGBOX ('Select the entity list item to be deleted.', 'STOP', 'Delete');
if v_alert_button = alert_button1 then
go_item('CONTROL.ENTITY_LIST');
end if;
Else
/* Deletes the list item */
Delete_List_Element('CONTROL.ENTITY_LIST',v_curlist_index);
End if;
Want to know why my first approach not working
Thanks, -
Custom List Item Pages in Search Result
Hi there,
We are using SharePoint 2013 and have built a custom web part that displays a series of items from a list. When you click on one of the items, it takes you to a custom page that displays the selected list item, styled with our company branding. This works
perfectly. However when a user performs a search, the search results includes the link to the SharePoint list item, and not the custom branded page. We'd like to have the search results include this custom page, instead of the standard SharePoint dispform.aspx
page. Is there anyway to exclude the dispform.aspx and include our CustomItem.aspx in this search results? If so, how is this possible?
For instance, a standard search returns the result:
https://mydomain.com/Lists/Announcements/DispForm.aspx?ID=23
Our custom branded page, which we want included in Search results is this:
https://mydomain.com/AnnouncementsDetail.aspx?ID=23
Thanks in advance!
cflbasserDoes you custom page have a managed property associated with its location, say 'myURL'? I think you should be able to achieve this by customizing one of the Search Display Templates. There are a couple of things involved here. For Result
Display rendering, Item_Default.html display template will have a "ctx.RenderBody(ctx)" call, in this case calling Item_CommonItem_Body.html template to display each item.
Take a look through Item_CommonItem_Body.html and there should be a place where instead of the OOTB managed property like Path or Url, you could put in your custom managed property to be displayed. It's best to not update the default display templates
but create custom ones and use custom result types with them. In this scenario, you are not touching what's being indexed, but simply changing the UI layer.
Another idea would be to use CEWS (Content Enrichment Web callout) and simply take the existing managed property responsible for printing out the link (like URL or Path), re-write it using some regex or similar logic and output it to the existing managed
property or a new one. You could have a trigger to only do this in specific scenarios to narrow this down, such as only to fire if an input path prefix matches a condition.
I would recommend doing this with Display Templates if possible, since introducing CEWS can have a performance impact on crawls, depending on how many items will need to be touched. -
In SharePoint 2010 I created workflows that used the 'Create list Item' Action, which then set the Content Type ID (so I could create documents of various types in a document library).
We just switched to the SharePoint 2013 platform, and now the drop down for Content Type ID is blank in all of the workflows that are still using the SharePoint 2010 platform. Is there any way to create a list item with specific content
type? Even if I could just input a string into that field instead of using this blank drop-down. Please help!Hi Sarah,
According to your description, my understanding is that you cannot create a new list item with a specific content type using SharePoint 2010 Platform Workflow.
I tested the same scenario in my environment, and the Create List Item worked fine with the specific content type.
How did you create the content type?
Please check if the content type is added to the list/library the workflow associated with.
Best regards.
Thanks
Victoria Xia
TechNet Community Support -
Retrieving list items from a specific view using CSOM
How can I query a specific view of a SharePoint List using the C# CSOM? I am dealing with SharePoint Online, so the only option is to use SharePoint.Client.
I have done this using Javascript, and I know how to do this with SharePoint On-Premises, but I haven't found a way to do with for SharePoint online using C#.hi Dkhouri,
thanks for posting your issue, you can create a specific view of a list using CSOM and C#.
Kindly find the code snippet below fort he same.
Code for CSOM :-
// Starting with ClientContext, the constructor requires a URL to the
// server running SharePoint.
ClientContext context = new ClientContext("http:SiteUrl");
// Assume the web has a list named "Announcements".
List announcementsList = context.Web.Lists.GetByTitle("Announcements");
// This creates a CamlQuery that has a RowLimit of 100, and also specifies Scope="RecursiveAll"
// so that it grabs all list items, regardless of the folder they are in.
CamlQuery query = CamlQuery.CreateAllItemsQuery(100);
ListItemCollection items = announcementsList.GetItems(query);
// Retrieve all items in the ListItemCollection from List.GetItems(Query).
context.Load(items);
context.ExecuteQuery();
foreach (ListItem listItem in items)
// We have all the list item data. For example, Title.
label1.Text = label1.Text + ", " + listItem["Title"];
For C#
public CamlQuery CreateInventoryQuery(string searchSku)
var qry = new CamlQuery();
qry.ViewXml =
@"<View>
<Query>
<Where>
<BeginsWith>
<FieldRef Name='SKU' />
<Value Type='Text'>" + searchSku + @"</Value>
</BeginsWith>
</Where>
</Query>
</View>";
return qry;
Also, checkout below mentioned URLs for more details
http://www.c-sharpcorner.com/UploadFile/sagarp/sharepoint-2013-caml-query-for-item-id-with-jquery/
http://msdn.microsoft.com/en-us/library/ff798388.aspx
I hope this is helpful to you, mark it as Helpful.
If this works, Please mark it as Answered.
Regards,
Dharmendra Singh (MCPD-EA | MCTS)
Blog : http://sharepoint-community.net/profile/DharmendraSingh -
FAQ - Print a List Item in SharePoint 2010
FAQ - Print a List Item in SharePoint 2010
step 1) Open a List;
step 2) Hit the List tab;
step 3) Click the Form Web Parts dropdownlist;
step 4) Choose “Default Display Form”;
step 5)At the top of the Page – Insert Tab, Click the Web Part button to add a new Content Editor web part (CEWP);
step 6) From Categories choose “Media and Content” > “Content Editor” and add it to the main section of the page;
Click the “Click here to add content” and then click the HTML button in the Ribbon to bring up the Edit source code window;
In the window add the following code to display a Print Button at the top of the list item window.
input type=”button” value=” Print” onclick=”window.print();return false;”
step 7) Next, hit the Page tab at the top of the page to view the List item. You should see the Print button;
Hit the Print button to print just the list item.
Amalaraja Fernando,
SharePoint Architect
This post is provided "AS IS" with no warrenties and confers no rights.References:
http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/28f02631-2291-4f8c-875a-4fa5397536ee/
Amalaraja Fernando,
SharePoint Architect
This post is provided "AS IS" with no warrenties and confers no rights.
Maybe you are looking for
-
File server: SunFire X4140 OpenSolaris SunOS 5.11 svn_111b Hi, I'm new to sysadmin, and very new to solaris. Any help would be very much appreciated - I'm trying to get a file server back on the internet that a couple dozen people are waiting for! It
-
Putting Image on a Frame Called From an Applet
I currently have an applet that opens up a JFrame when you click on a button. I am trying to figure out how I would put an image on the frame. When I try using ImageIcon image = new ImageIcon("image.jpg") I get an error when I run the applet in the w
-
I bought a Mac Book Pro 15 and after a week of using it it doesn´t start. I receive the message no bootable deevice. Is it possible to get into the EFI to change the boot disk?
-
Creating data entry forms in numbers
How do I create a data entry form in Numbers for Macbook Air?
-
Does anybody know that: Corresponds the include-updates flag in the weblogic-cmp-rdbms-jar.xml file only to UPDATE SQL commands or also to INSERTs? In other words: When I create a new ACCOUNT and call a finder in the same transaction that s