SharePoint Advanced List Relations - sharepoint

Ok - so here's the preface. I realize that SharePoint isn't really the best solution for this, and if I have to use SharePoint, then coding this would be preferable. However, my wings are clipped due to IT policy, and they have no time to do this "for me".
I am developing a document control system for an Environmental Management System. The basic concept is that there is a list of 'General Responsibilities', which identifies a regulatory agency, some category info, links to laws, etc... There's a second list 'EMS Responsibilities', which basically just links (via a lookup) a particular site to a general responsibility, to identify which sites have which responsibilities. We have many sites, and most have most responsibilities so it doesn't make sense to combine the two lists and repeat all this stuff 10x. Finally, I have a document library (for simplicty sake I am ignoring the draft/published libraries aspect) which contains the actual documents. These documents should reference an EMS Responsibility, which in turn references a General Responsibility. The categorization from 'General Responsibilities' needs to propagate all the way to the document library.
Currently, I use workflow to automatically copy the secondary lookup columns referencing the 'General Responsibility' to a 'Single Line of Text' column in 'EMS Responsibilities' so that it is available to the lookup in 'EMS Documents'. However, despite the values being present in both responsibility lists, the values do not propagate to my final list.
This workflow-based approach is stupid. The lookup columns are stupid. There's no way to get this to work elegantly using out of the box components. I want to believe that the reason this isn't working is because I am missing something... but I have searched for hours and can't find any more effective relational capabilities.
First of all, any theories as to why the values do not end up in the final list despite referencing a single line of text column that is filled?
Second, is there a better overall approach that doesn't rely so much on workflows copying data back and forth, and these pathetic lookup columns?
Thanks in advance!

Given the requirements you gave above together with your answer to my question I believe you won't need a workflow to link all three items together. I have two options for you:
1st Option:
Create a General Responsibility list. This list should contain at least two columns. The ID and Title column.
Create an EMS Responsibilities list. This list should contain at least three columns. The ID, the Title column and a lookup column linked to the General Responsibility list.
Create a Document Library. Add a lookup column linked to EMS Responsibilities.
Since the lookup list you are using is already linked to General Responsibilities then there is no need to have another column solely dedicated to point to General Responsibilities. If however, you need to have specific columns in your document library so that it explicitly has columns for both General Responsibilities and EMS Responsibilities use option 2 below.
Option 2
Create a General Responsibility list. This list should at least contain the ID and Title column.
Create an EMS Responsibility list. This list should at least contain the ID, lookup column linked to General Responsibility and Title columns.
Create a document library. You should add two lookup columns. One pointing to General Responsibility the other to EMS Responsibility.
(now the fun part starts)
Follow the guide to edit both your NewForm and EditForm aspx in this link so that your lookup dropdowns will be a cascading dropdown. This will make sure that items from EMS dropdown will only be populated once you select a value from the General dropdown.
Let me know if you need any more clarifications.

Related

Multiple Dependent drop down list in excel/vba

I am trying to do sector classification for GICS sector. GICS structure consists of 11 sectors, 24 industry groups, 69 industries and 158 sub-industries. the below link gives the sector classfication
https://en.wikipedia.org/wiki/Global_Industry_Classification_Standard
can i create a drop down list like the attached image using data validation and name range function ?
like this with a vba button to refresh
On the web there are many step-by-step guides to create interdependent validation drop-downs. This is one of them. Working your way through the instructions is serious work. To help you on your way I have created a starting point for you.
The picture shows a table named Industry_Groups. It has one column for each group, and in this column are listed all the industries in that group. Now you can create a drop-down with all the column captions which would enable you to select any of the industry groups. This drop-down would have the list specification
=INDIRECT("Industry_Groups[#Headers]")
A dependent drop-down would have the list specification given below.
=INDIRECT("Industry_Groups["&A10&"]")
As you see, it takes the referenced table column name from cell A10, which is occupied by the first drop-down. Therefore the list in the second drop-down will change depending upon the selection in the first.
Of course, whatever can be selected in the second drop-down is nothing but the name of another list in another table. Each of them would name a table like the one shown above - literally hundreds of them. They have to be created before you can start on the programming.
Talking of programming, it seems that you tried to create a VBA based system that would generate the lists on the fly. No doubt that is possible but it would require some serious programming for which your attempts do not show an aptitude. The advantage of the system I show you here is that you can create and implement it with your own resources. You know, it's the story of the sparrow in your hand and the pigeon on the roof.

How to create a view using a count of certain field

I am trying to create a categorized view of all Notes documents that have a field with exact same value, i.e. there is a field for Contractor Name and I want to create a view that lists each Contractor and the documents that relevant to each. How do I do this? I have tried view formulas like the following but no success as yet
SELECT #IsAvailable(Contractorid) & #Count(Contractorid) > 1
SELECT #Count(#IsAvailable(Contractorid)) >1
Nsf databases are no relational databases. The count of different documents with a unique value in a specific field cannot be used to build a view selection formula.
You could write an agent, that runs through all documents and counts them and puts all with count > 1 in a folder, but this is quite a lot of LotusScript code and needs some advanced knowledge.
The other possibilit would be to categorize the view by ContractorId and add one column before that categorized column: simply use 1 as column formula and select "display totals" in the column properties as well as "hide details".
Then at least you have the information, how much documents are in each category, but unfortunately you cannot filter by it and you cannot sort by this column.
A third possibility would be to use an xpage interface, but that is even more work to do and a completely different story developmentwise.
This is similar to view to identify duplicates. My approach is to use folder.
Make a new folder with design of your view. Instead of (not working) selection formula use short LS code as an action, or QueryOpen event (make sure only one user runs the script).
The code should cooperate with another (hidden) view sorted by Contractorid. Make a ViewNavigator for that view and traverse through it with simple logic - if previous entry has the same Contractorid as the current one, put both documents into folder**. That way you will get list of all documents with duplicate Contractorid. Make sure to wipe all the current content from the folder at the start.
** This can be optimized further by slightly more complicated algorithm to handle first duplicate diferently - for more than two duplicates this algorithm makes extra calls of PutInFolder method.

How to create a sharepoint list column that links to another list that is editable

I'm not sure if the title is a proper descriptor of what I'm trying to achieve here, hopefully it's close enough. I'm not a SharePoint expert, but I'm comfortable with creating forms and workflows as necessary to get something like this to work.
Basically, I need to have two separate SharePoint lists that are linked together, but one list needs to have row level security to hide data from other users that shouldn't see it. I need the column that is being linked to be an editable text box though, rather than a simple lookup field.
For example:
List A
Customer (text)
Description (text)
Sales People (person, multiple selections allowed)
Expenses (linked field)
List B
Customer (text)
Expenses (number)
Created by (just a reference that the sales people would actually "create" each row here)
Essentially, multiple people can be assigned to a customer in list a. The "sales people" are assigned by another user who actually creates the item for list a. I need to be able to have the people who are assigned as "sales people" to have a text box where they can enter their expenses, but on an individual basis, that would then be stored in list b with row level permissions to prevent them from seeing each others expenses totals.
List B would be able to show each sales person their full list of expenses across all the customers they are connected to, but not be able to see each others expenses. It's not a problem if the person creating the item for List A ends up with items in List B that are 0, but I need to be able to have the Expense field be an editable text box from a form that allows the sales people to enter their total expenses for that customer.
If I was building a custom application, this wouldn't be difficult to do, but I can't for the life of me figure out how to do this in SharePoint, or if it is even possible.
This is possible, but it will require custom development, using the SharePoint Object Model. Create your two lists and then you can either create a javascript/HTML based solution using libaries like jQuery and SPServices, or you can create a custom web part and use C# to update the lists. There's lot of examples out on the internet on how to do this. Write some code, and bring any problems you have with the code back to StackOverflow.

Joining sharepoint 2007 lists in a web view based on a common key field

So - I'm making a data view that is to contain a list. This list has a field that will be used to match up against two other lists. If there is an entry for this value, it should show the value from the other list, otherwise show a link to add a new one.
So, what I need to do is make a data source consisting of the rows from list 1, and fill in the Ticket field with a value from the Tickets table matching the ID value from list 1. The same should be done for the Change Type field.
Can anyone point me in the right direction to accomplish this? I've found a few tutorials, but they seem to be for showing all the data together and not match up on any specific columns for linkage.
Thank you
What you are aiming at is not available in SharePoint out of the box.
There are two approaches you can look at:
Create your own custom lookup field template for single/multiple field
selection with some sort of field
editor. Create your own controls and
program the associated code behind
logic.
Use some existing custom solutions. One such sample is on codeplex:
SharePoint Filtered Lookup Field

Auto number column in SharePoint list

In a SharePoint list I want an auto number column that as I add to the list gets incremented. How best can I go about this?
Sharepoint Lists automatically have an column with "ID" which auto increments. You simply need to select this column from the "modify view" screen to view it.
You can't add a new unique auto-generated ID to a SharePoint list, but there already is one there! If you edit the "All Items" view you will see a list of columns that do not have the display option checked.
There are quite a few of these columns that exist but that are never displayed, like "Created By" and "Created". These fields are used within SharePoint, but they are not displayed by default so as not to clutter up the display. You can't edit these fields, but you can display them to the user. if you check the "Display" box beside the ID field you will get a unique and auto-generated ID field displayed in your list.
Check out: Unique ID in SharePoint list
If you want to control the formatting of the unique identifier you can create your own <FieldType> in SharePoint. MSDN also has a visual How-To. This basically means that you're creating a custom column.
WSS defines the Counter field type (which is what the ID column above is using). I've never had the need to re-use this or extend it, but it should be possible.
A solution might exist without creating a custom <FieldType>. For example: if you wanted unique IDs like CUST1, CUST2, ... it might be possible to create a Calculated column and use the value of the ID column in you formula (="CUST" & [ID]). I haven't tried this, but this should work :)
I had this issue with a custom list and while it's not possible to use the auto-generated ID column to create a calculated column, it is possible to use a workflow to do the heavy lifting.
I created a new workflow variable of type Number and set it to be the value of the ID column in the current item. Then it's simply a matter of calculating the custom column value and setting it - in my case I just needed the numbering to begin at 100,000.
it's in there by default. It's the id field.
If you want something beyond the ID column that's there in all lists, you're probably going to have to resort to an Event Receiver on the list that "calculates" what the value of your unique identified should be or using a custom field type that has the required logic embedded in this. Unfortunately, both of these options will require writing and deploying custom code to the server and deploying assemblies to the GAC, which can be frowned upon in environments where you don't have complete control over the servers.
If you don't need the unique identifier to show up immediately, you could probably generate it via a workflow (either with SharePoint Designer or a custom WF workflow built in Visual Studio).
Unfortunately, calculated columns, which seem like an obvious solution, won't work for this purpose because the ID is not yet assigned when the calculation is attempted. If you go in after the fact and edit the item, the calculation may achieve what you want, but on initial creation of a new item it will not be calculated correctly.
As stated, all objects in sharepoint contain some sort of unique identifier (often an integer based counter for list items, and GUIDs for lists).
That said, there is also a feature available at http://www.codeplex.com/features called "Unique Column Policy", designed to add an other column with a unique value. A complete writeup is available at http://scothillier.spaces.live.com/blog/cns!8F5DEA8AEA9E6FBB!293.entry
So I am not sure I can really think of why you would actually need a "site collection unique" id, so maybe you can comment and let us know what is actually trying to be accomplished here...
Either way, all items have a UniqueID property that is a GUID if you really need it: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistitem.uniqueid.aspx
Peetha has the best idea, I've done the same with a custom list in our SP site. Using a workflow to auto increment is the best way, and it is not that difficult. Check this website out: http://splittingshares.wordpress.com/2008/04/11/auto-increment-a-number-in-a-new-list-item/
I give much appreciation to the person who posted that solution, it is very cool!!

Resources