Lookup Attachment from another list
I am looking to have an attachment field linked to another list in InfoPath 2010. How can I set up the data connection? Thanks!
David L. Crooks
Hi David,
According to your description, my understanding is that you want to use an attachment field linked to another list (like “Link from SharePoint”) in InfoPath form. Is it right?
Per my knowledge, there is no OOB way to achieve it. I suggest you develop a custom control in InfoPath to do it.
For developing customizations in InfoPath, I suggest you create a new thread on Visual Studio Tools for Office (VSTO) forum, more experts will assist you with Office development.
VSTO forum:
https://social.msdn.microsoft.com/Forums/en-US/home?forum=vsto&filter=alltypes&sort=relevancedesc&searchTerm=VS
Best Regards,
Wendy
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Wendy Li
TechNet Community Support
Similar Messages
-
Populate people picker from another list
Hi,
I have a task list that i want to populate the assigned to column with lookup information based on another list, by matching the "Project Name" of the two lists by using SPD 2013, no coding
Any thoughts?
Thanks a lot in advanceHi,
Per my knowledge, if you want to populate the Assigned To column value from another list in the New Item form in SharePoint Designer, then you need to use code to achieve this goal.
Here is the code example(my lookup column name is “lookup” in the task list and the People and Group field in the other list (ListA) is “User”):
<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("select[Title='lookup']").blur(function()//change the Title to the column name of your lookup column
var val1=$("select[Title='lookup']").val();
getItems(val1);
function getItems(val){
var clientContext = new SP.ClientContext('http://sp');//change the URL to your site
var oList = clientContext.get_web().get_lists().getByTitle('lookup test'); //change the list name to your list where the lookup column get values.
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef Name=\'ID\'/><Value Type=\'Counter\'>'+val+'</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 listItemEnumerator = collListItem.getEnumerator();
while (listItemEnumerator.moveNext()) {
var oListItem = listItemEnumerator.get_current();
for (var i = 0; i < oListItem.get_item("User").length; i++) {
var val2=oListItem.get_item("User")[i].get_lookupValue();
SetAndResolvePeoplePicker(val2);
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
function SetAndResolvePeoplePicker(userAccountName) {
var controlName = "Assigned To";
var peoplePickerDiv = $("[id$='ClientPeoplePicker'][title='" + controlName + "']");
console.log(peoplePickerDiv);
var peoplePickerEditor = peoplePickerDiv.find("[title='" + controlName + "']");
var spPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplePickerDiv[0].id];
peoplePickerEditor.val(userAccountName);
spPeoplePicker.AddUnresolvedUserFromEditor(true);
spPeoplePicker.SetEnabledState(false);
$('.sp-peoplepicker-delImage').css('display','none');
</script>
After that, the values will be populated in the New Item form after you have selected the lookup column value.
If you just want to set the Assigned To filed value, then you can use workflow to update the column value after creating the task.
More reference:
http://www.sharepointcolumn.com/sp2013-setting-people-picker-value-in-newform-aspx/
Best regards.
Thanks
Victoria Xia
TechNet Community Support -
Component to allow the user to build a list from another list's items
Hello everybody,
I'm looking for a widget that allows the user to create a list by choosing from items from another list.
Something like the tool to customize the button bar in MS Office or MS Explorer. You can see an example of what I'm talking about:
http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/databoundcomponents/displayedcolumns.gif
It would be easy to program a component like this (and I've already found some piece of code by Googling), but I'd like to know if someone made a stable Swing component of it to avoid reinventing the wheel.
Thanks in advance.There is one here
http://www.geocities.com/nirajkagarwal/html/ListSelect
or.htmlThanks, I already found this one via Google but I was looking for something more "professional".
It seems the apache project team made a utility to
control elements in a list...it seems very generic
(maybe over-flexible if there is such a thing...) and
really needs a tutorial !!!
http://incubator.apache.org/uima/apidocs/org/apache/ui
ma/tools/util/gui/ListSelector.htmlYes, it really looks like a work in progress.
I'll wait some more to see if other readers come with links, then I'll start coding my own ListSelector ;-)
NB: another example of what I want to accomplish is shown in figure http://java.sun.com/products/jlf/ed2/book/images/SelectableList1.gif -
Best practice to code Lookup Field to another list
Hello All,
Wanted to check what is the best way to create lookup field to another list. I have seen blog posts to create using feature receiver and using declarative way, but not able to find out pros and cons for the same. Want this answer urgently.
Rohit PasrijaHi,
Per my understanding, you might want to find a better way to create Lookup field.
Though there are different ways to create Lookup field(declaratively or programmatically), there would be no much difference between them in performance or maintenance.
If going in the declarative way, the whole definition of the field will be hardcoded, user simply need to deploy the solution, Lookup field to a specific list will be there.
If creating the field programmatically, there would be great flexibility when provisioning a field as we will be able to specify the properties dynamically.
Thus, you might need to make a choice depends on the scenario in the actual production environment.
Thanks
Patrick Liang
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
Moving a List Item attachment from one list to another
Hi,
What are the best way of coping / moving the List Item attachment using
jQuery / JavaScript in SharePoint 2013 from one list to another.
Thanks
Saroj
Impossible is nth but good coding :-)For your needs better try to code your own solution. See
SharePoint JavaScript Class Library for details. You can have two possible architectures:
Make all work from JavaScript. And the first your step will be
addItem method of SP.List.
Make processing of selection on client in JavaScript and call your custom server-side component (may be an application page) for items copying (creating copies in new list of already existed items from initial list.). See
this for example.
Also be careful with context.load. It's recommended to write all next code in context.executeQueryAsync. Use Firebug in FF and developer tools in Chrome for debugging your code and to find what is wrong.
Or
https://social.msdn.microsoft.com/Forums/sharepoint/en-US/1d01a48f-c28b-467b-acd1-22e5fb266670/how-to-retrieve-list-items-and-copy-it-to-other-list-using-javascript-object-model?forum=sharepointdevelopmentprevious
<script type="text/javascript">
ExecuteOrDelayUntilScriptLoaded(retrieveListItems, "sp.js");
var siteUrl = 'Site Url';
function retrieveListItems() {
var clientContext = new SP.ClientContext(siteUrl);
var oList = clientContext.get_web().get_lists().getByTitle('List1');
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml('<View><Query><Where><Geq><FieldRef Name=\'ID\'/>' +
'<Value Type=\'Number\'>1</Value></Geq></Where></Query><RowLimit>10</RowLimit></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 listItemInfo = '';
var listItemEnumerator = collListItem.getEnumerator();
while (listItemEnumerator.moveNext()) {
var objListItem = listItemEnumerator.get_current();
var clientContext = new SP.ClientContext(siteUrl);
var oList = clientContext.get_web().get_lists().getByTitle('List2');
var itemCreateInfo = new SP.ListItemCreationInformation();
this.oListItem = oList.addItem(itemCreateInfo);
oListItem.set_item('Title', objListItem.get_item('Title'));
oListItem.update();
clientContext.load(oListItem);
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceededFinal), Function.createDelegate(this, this.onQueryFailed));
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
function onQuerySucceededFinal(sender, args) {
//Do next set of operation if needed
</script><input name="btnVarIQReject" onclick="retrieveListItems()" type="button" value="Submit"/>
Please use my above POC code to start. This will copy all the title field value from list1 to list2
If this helped you resolve your issue, please mark it Answered -
Set lookup value from another item
Hi!
I add to my list in SP 2013 new column like type Lookup field and select item from another document library
and display field select "Title". How i can set this filed value for new item from document library item?Hi AllXander,
From your description, my understanding is that you want to set lookup field value with C# CSOM.
You could use method "FieldLookupValue()". Please refer to this code below to set lookup field value when add an new item to a list:
// replace your site URL
using (ClientContext context = new ClientContext("http://sp/sites/sp2013"))
// replace your user, password and domain
context.Credentials = new NetworkCredential("Administrator", "Access1", "contoso");
// the library that you get value for the lookup field
List list = context.Web.Lists.GetByTitle("Department");
context.Load(list);
context.ExecuteQuery();
CamlQuery query = new CamlQuery();
query.ViewXml = "<View/>";
ListItemCollection allContacts = list.GetItems(query);
context.Load(allContacts);
context.ExecuteQuery();
foreach (ListItem item in allContacts)
// replace the id that you want to set value to the lookup filed
if (item.Id == 1)
// replace the list title with your list that you want to add the item
List oList = context.Web.Lists.GetByTitle("Employee");
ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();
ListItem oListItem = oList.AddItem(itemCreateInfo);
oListItem["Title"] = "My New Item!";
// set the lookup field value
FieldLookupValue lookup = new FieldLookupValue();
lookup.LookupId = item.Id;
oListItem["Department"] = lookup;
oListItem.Update();
context.ExecuteQuery();
You could refer to this article about creating/updating/deleting a new item with C# CSOM:
http://www.c-sharpcorner.com/UploadFile/sagarp/create-update-delete-a-list-using-client-object-model-cso/
You could refer to this article about updating multi-value lookup column:
https://sunbin0704.wordpress.com/2013/10/11/update-multi-value-lookup-column-values-in-sharepoint-2010-using-managed-csom/
Best Regards,
Vincent Han
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected]. -
Auto numbering Column id and filter this lookup id in another list based on status="active"
Hi,
I am trying to autonumbeirng the column id with default column ID. But it is not reset if i delete the list item. Also i want this id in another column which have status="Active". How i will do this?
Thanks in Advance.
RoopeshHi,
According to your description, my understanding is that you want to reset the column ID when you delete the list item and then you want to filter the id in another list based on status.
For resetting column id, there is no direct way to achieve it. I suggest you can save the list as a template and recreate the list. ID columns will always keep incrementing and will never be reused.
Here is a similar thread about reset column ID for your reference:
https://social.technet.microsoft.com/Forums/sharepoint/en-US/848a3d73-6273-45fa-806f-96312a4d71d1/is-there-anyway-to-reset-the-default-id-number-that-sharepoint-gives-to-an-item-back-to-1?forum=sharepointgeneralprevious
For filtering look up field, here are some detailed demos for your reference:
http://filteredlookup.codeplex.com/
https://social.technet.microsoft.com/Forums/en-US/d23d6e9b-dc7b-4741-8746-dd4bf00b8110/how-to-filter-lookup-column-in-sharepoint-2010
v
Thanks
Best Regards
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Jerry Guo
TechNet Community Support -
How to check if a list contains items from another list
Hi all,
I am trying to check whether a text list contains items form
another list and then do something. I tried:
tlist contains text phrases (e.g., test1,test2,test3)
phrases = ["test1","test2"]
n = phrases.count()
tList.getPos(phrases.item[n])
alert("should not be inluded in the list")
But it is not working any ideas why?myPhrase is the loop index, but instead of a numerical index
(like n in your sample), myPhrase is set equal to each item in the
phrases list, first item to last. So, on the first iteration
myPhrase = “test1”, on the second iteration myPhrase =
“test2”. The loop automatically exits when the end of
the list is reached. The Director help docs have more information
on this syntax under “repeat”
BTW: if you're more comfortable using a numerical index, the
syntax for getting at the n-th item in a list is list[n], or in
your sample phrases[n] -
Issue with site template that contains a document library with a lookup column to another list
I have a document library called Proposals with a lookup column in the same site called Document Categories (multiple values allowed). It points to a list called document categories. I have several sample documents in the Proposal Library that
contain valid document categories. When I save the site as a template and instantiate it, everything is fine. However, when I remove the sample documents from the Proposal library and rebuild the site template, I can't get the template to
create another site. I get an error Unable To Open Lookup List.
I don't understand why I can instantiate a site from the template when there's sample data, but not when the document library containing the lookup column is empty.
Does SharePoint 2010 site template support lookup columns?
Why would it make a difference if the library is empty?
ThanksHi,
According to your description, my understanding is that the error occurred when you created a site from the template with no files in the document library.
I tested the same scenario per your post, and I can create a site from the template with no files in the document library with no errors.
To solve this issue, I recommend to verify the things below:
Did you save the site as a template with Include Content checked? If yes, I recommend to test if it works when saving the site as a template with Include Content unchecked.
Test the same scenario with a new site to narrow the issue scope.
I also recommend to check the event log and ULS log to see if anything unexpected occurred.
To check event log, click the Start button and type “Event Viewer” in the Search box.
For SharePoint 2010, by default, ULS log is at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS.
You can check the ULS log by the methods here:
http://blogs.msdn.com/b/opal/archive/2009/12/22/uls-viewer-for-sharepoint-2010-troubleshooting.aspx
http://msdn.microsoft.com/en-us/library/gg193966(v=office.14).aspx
Best regards.
Thanks
Victoria Xia
TechNet Community Support -
BCS and a Lookup column in another list pointing to the BCS
Hi,
SP 2010 Server.
Say I create a BCS to a line of business database with one Table named Customers.
Customers has an ID column and FullName column.
I create from this BCS an external list created in SP (say ExternalCustomers).
I create a standard SP List named InternalCustomers.
That list has a lookup field named CustomerName that is a lookup to the FullName column of the BCS ExternalCustomers list.
Is this possible? When the user chooses the FullName in the InternalCustomers list is he presented with a choice of fullnames from the ExternalCustomers list?
I am confused because of this statement from
here
11) Not everything from Lookups
Unfortunately the only thing that you can do a look up on in an external list is on the ID column, anything else and you are out of luck.
Thanks,
Maz
MazHi,
According to your description, my understanding is that you want to look up External Data in the Customer list.
I suggest you can add the "External Data" column in the list to access the external content type to look up the field you need.
Here is a detailed article for your reference:
How to: Create a SharePoint List with External Data Columns
Thanks
Best Regards
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
Need link to attachment from a list.
I've got a user who has a very large SharePoint list, to which she is attaching files (normally, I'd recommend a Document Library, but that's its own story). She wants to be able to have a direct link to the attached file as a list column. Much
to my surprise, this is not possible OOTB.
I've seen this described for 2007
elsewhere, but was unsuccessful in adapting it to SPD 2010. Has anybody encountered a solution for this for 2010, or know how the 2007 solution could be adapted?
Many thanks!Hi Josh,
From your description, I’d recommend you create a new column for attachments in the current list. Here are the steps:
1.In the List Tools > List > Modify View > Modify in SharePoint Designer (Advanced).
2.Then you come to SharePoint Designer 2010. Switch to Split view and locate the column. Then right-click and insert Column to the Right.
3.Then locate the td part as below:
<td><xsl:text xmlns:ddwrt="http://schemas.microsoft.com/webparts/v2/data....
</td>
4.Replace it with the code as below:
<td id="ItemAttchment" class="ms-vb">
<xsl:element name="SharePoint:AttachmentsField">
<xsl:attribute name="runat">server</xsl:attribute>
<xsl:attribute name="FieldName">Attachments</xsl:attribute>
<xsl:attribute name="ControlMode">Display</xsl:attribute>
<xsl:attribute name="Visible">true</xsl:attribute>
<xsl:attribute name="ItemId">
<xsl:value-of select="@ID"/>
</xsl:attribute>
</xsl:element>
</td>
5.Then view in the IE browser and see if it works as expected.
The screen shot below is the result from my lab environment:
Regards,
Rebecca Tu
TechNet Community Support -
Can not lookup EJB from another EAR file, the ClassCastException returned
Hi,
I try to call EJB module in A.ear from Servlet in another EAR file(B.ear) the ClassCastException returned on the context.lookup() code . So when i create a Dynamic Web Project(With the same code as Servlet in B.ear) and pack it in A.ear(The same EAR file with EJB module), it work fine. I have no idea. Could you please suggest me.
The ClassCastException : incompatible with interface ..... return on
HelloManBeanLocalHome home=(HelloManBeanLocalHome) ctx.lookup("localejbs/sap.com/HelloMan_EAR/HelloManBean");
The entire code is below :
try {
InitialContext ctx=new InitialContext();
HelloManBeanLocalHome home=(HelloManBeanLocalHome) ctx.lookup("localejbs/sap.com/HelloMan_EAR/HelloManBean");
HelloManBeanLocal remote=home.create();
lookupText=remote.helloMan("Test");
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace(out);
Many ThanksHi Saleem Mohammad.
Thank a lot for your post. I got this idea from your link. The below code work fine.
try {
InitialContext ctx=new InitialContext();
Object obj= ctx.lookup("localejbs/sap.com/HelloMan_EAR/HelloManBean");
ClassLoader homeCl = obj.getClass().getClassLoader();
Class<?> localHome = homeCl.loadClass(HelloManBeanLocalHome.class.getCanonicalName());
java.lang.reflect.Method method = localHome.getMethod("create");
Object homeObj = (Object)method.invoke(obj);
ClassLoader localCl=homeObj.getClass().getClassLoader();
Class<?> local = localCl.loadClass(HelloManBeanLocal.class.getCanonicalName());
Class args[] = {String.class};
java.lang.reflect.Method localMethod=local.getMethod("helloMan",args);
Object params[]={"Thongie"};
Object localObj = (Object)localMethod.invoke(homeObj,params);
lookupText=(String)localObj;
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace(out); -
Emails from another list are automatically deferred from Mailing list
I have several mailing lists setup on on a server. Most emails go through the listhost without any problems. Posts should be configured to automatically go through for all posters.
Some of these mailing lists are part of other mailing lists. If one sends an email to a mailing list, of which the server's mailing list is a member, the email will be deferred. The reason cited for deferring the email is "message has implicit destination." I have tried adding the original posters to automatically post all messages from this poster but that does not fix the problem.
I would prefer not to have any delays or waits for approval of such messages. How does one change this setting?
Thanks!
JuliaHi ,
Check the city LOV with hardcoded value first.
Ex : select city_name from cities where country_name = 'India';
Go with below query
select city_name from cities where country_name = ':P_COUNTRY';
Also select refersh on other parameter selection in the parameter.
Thanks,
Ananth -
Related to
this post, in cases where it's desirable to have two different workflows for two different Lists—is it possible to NOT bring forward a hardwired workflow when creating a new List from a saved template?
I.e. List #2 still has the workflow from List #1 hardwired in. List #1 still needs its workflow but List #2 wants to have a separate Workflow.More importantly, because it's relatively easy for most folks to just start from scratch with a new Workflow—how does one disassociate a carried-over Workflow from the new List?
Use the web-GUI. (List Settings > Workflow Settings)
From Designer, there's a shortcut button at the top of the page in the Workflows tab: "Administration Web Page". -
What I have is a Custom List, that got the following fields for each item.
ApplicationName(SingleText) OwnerApproval(Person) ManagerApproval(Person) InstallExeuction(Person)
Example data:
| ApplicationName: Photoshop
| OwnerApproval: Mister Blue
| ManagerApproval: Mister Red
| InstallExecution: IT Group
What I have now then, is a task list as well. Where the user can press new task, and type in their PC name (singletext) and a dropdown menu to choose what application they want, for instance Photoshop.
I'm not trying to make a workflow that starts when a new item is created to send an email to the OwnerApproval set for this specific application, Photoshop, if he approves it, a new email should be sent to ManagerApproval specific application, Photoshop.
And if the last person ManagerApproval accepts it, a last email should be sent to InstallExecution, which if this person approves the task is marked as completed.
I've been trying for mad now using SharePoint Designer and I almost got it to work.
Can anyone help me? I'm going mad here, I have VERY LIMITED knowledge in sharepoint designer.Hi Plankton,
To achieve this goal, we can create with three Start a task process steps in the workflow and the workflow needs to be set to start when an item is created.
For example, the custom list is called Custom, and the task list is called Task Custom.
We can use the Task Status column for showing as Rejected or Excuted/Installed based on the users’ approval, so we need to add Rejected and Excuted/Installed values to the Task Status column. (same settings for Custom:ManagerApproval and Custom:InstallExecution
as Custom:OwnerApproval with their own column value)
Best regards.
Thanks
Victoria Xia
TechNet Community Support
Maybe you are looking for
-
How to lock the Printer of LaserJet Pro 500 Color MFP m570dw
how to lock the Printer of LaserJet Pro 500 Color MFP m570dw
-
Creation of New Message by Customer - No Long Text
I am creating test messages as an end-user in our Service Desk. After I send the message and review it, the long text has disappeared. Has anyone else experienced this? Thanks. Jackie
-
The app store showed me that I had 3 apps to update, Drudge Report, iBooks
The app store app, showed that I had 3 apps to update, one of them being iBooks. Anyway I keep getting a message that they cannot be updated at this time however I have been able to update other apps. I can't find any troubleshooting advise. I have
-
Missing webservices jar files in 9.0.2
Hi, I am trying to deploy webserivces using stateless java class on oc4j version 9.0.2 but i do not have appropriate jar files. Only following jars are installed. %OC4J_INSTALL%\j2ee\home\WebServicesAssembler.jar %OC4J_INSTALL%\j2ee\home\WebServicesH
-
Using mac os x, and mac version of Mozilla Firefox. I don't know what is the problem but I haven't figured out single thing. How I open extension? So I can use it? Can u make this little bit easier?