Sunday, November 18, 2007

First off all, i would like to thank DataCog Guys to show newcomers (specifically in MOSS) like me that thing like this can be done in first place.So this was my problem. i was into a sharepoint project that had requirements so funny that made me think twice as to why are these guys opting for sharepoint 07 in first place.Y cant they happily do it through a .net 2.0 custom web app.Well, thats a different story all together.In short, one of those funny requirements was to get highly filtered data in a dropdown based list column. The "out-of-the-box" Lookup column is a plain lookup thats simply gives all the values of a particular column of a particular List in your List(It does not even take care to display distinct values ... lol)my requirements were way to much for this lookup guy to handle.Yes, we are talkin about full fledged query's here (like select [column] from [list] where [column1] = [value] and [column2] = [value] and [column3] <= [value]..... so on and on) We First thought that web parts are only bet in this case. When i found out this article of these Datacogs guys.(once again.. all hail DataCogs) However, even these guys are solving their own specific problem of cascading dropdowns. I feel, my requirement was far too generic then this and i m sure 100s and 1000s did faced it and are facing it still. My plans were, why not give people a full fledged query building interface wherin, they can put as many filtering criteria's as they wish..(like the one i pointed above) So this is what i came up with following the same idea of the that DataCogs article The Project is now moved to CodePlexSorry, i continued on his project and after every thing was done, i was too lazy to remove them. so just dont look at them, Unless, offcourse you are interested in cascading stuff.By the way, the only beauty of his control is a simple 4 line method called FindControlRecursive. Cool stuff!!!Any ways, a Big Thanks to DHTML goodies guys for making my fancy balloon toolTip dream come true in this controlHoping of a response for bugs or feature enhancement at baig.adil@gmail.com

Did you make any changes to the Manifest.xml file, cause dozens of people have installed it successfully without ne problem. Post me the content of your manifest. I Really cannot understand like this as to what 'Text' is it really referring to at the RootFiles node.

It seems that sharepoint uses different methods to get/set the values for its internal column then the one it exposes in SPFieldText.

Datasheet while rendering uses those method calls to get value. When it comes to our column, it tries to use the same method and rendering template but does not get it as i have not overridden it(for its not available to override), this is what an experienced sharepoint guy told me.. I really dont know as to how true is this. He says Microsoft's are workin on it. Its kinda bug

i fear you cant do that with the existing controls.parent child control (as the name suggest) has to server control tightly working together:1. the parent2. the child that get its data based on parent.

your case needs a third one ...the grand child!!!simple solution.. make one.. or if you think this would get a whole lot of family of related controls out there, then i suggest you make a web part for your scenario

first of all I want to thank you, Adil, for sharing this excellent solution. You really did some great work!

Additionally I wanted to give a solution to the problem posted on Dec 5th:I figured out the same error message when running "installwsp.bat". The solution is NOT to use the file from the "AGTech.Sharepoint.CustomFields"-project's root folder. The files located under "DeploymentFiles" are the working ones.

first of all, see the stack trace of the error, "unkown error" is not gonna help you trace one, for which you have to enable callstack (callstack=true),enable debug (debug=true), and custom error switched off(customerrors mode=Off)might be, try uninstalling the wsp, rebuilding the solution, recreating the wsp and reinstalling, there are certain things even i m clueless bout regarding the runtime behaviour of the control

Hello Adil, I have create cascading drop down list control type for rendering country and state. On basis of value in country drop down, child drop down will render. It is working fine. But when it is switched into "DataSheetView" fields turn into read only. So what would be the problem in it. !!!

simple... load the lists from the subsites or whichever specific site you want during load time.. when FieldEditControl loads (the edit user control)if it gives.. cannot complete this action.. means the user trying to use it does not have necceasry permission might be.. or just debug it and see...its definitely catching the exception somewhere and displaying it in the textbox. just see where

and you may also want to wrap the block in: ..SPSecurity.RunWIthElevatedPrivilidges() delegateto see if the permision is not the thing casuing this exception.

Thanks for the reply. One more snippet to narrow this down. It will load the List names from the subsites, but when it throws the error when trying to access the columns from one of the subsite lists.

"Cannot complete action. Please try again."

The results are the same when running on two different WSS environments as the Site Collection Administrator.

I am a bit of a newbie when it comes to programming in the WSS/SP environment, so can you help me out by helping me pinpoint where in the code to make the security change? Your solution meets all of my requirements except the requirement to access all lists in the site collection, including subsites/workspaces.

No..not in LoadListCOlumnsInDropDown()..i guess it should be in LoadLookUpListsInDropDown()..however.. to pin down on the exception..simple thing.. y dont you debug the solution..simple..rebuild the solution..put the dll in GAC. and reset IIS.. (thats not someething specific to sharepoint i guess)

Thanks for the great control Adil.I could successfully deploy it on my site and it correctly pulls all the lists created by WSS itself. However I am not able to see any custom lists that I have created.Do I need to do anything specific to load custom lists in 'List Name' dropdown?Please let me know...

first of all, "Unknown error occured" wont take any developer anywhere in solving his problem in sharepoint.

answer is simple, know what the problem is. see the stack trace.. set customerrors=Off and callstack=true in web.configthis will take off the beautifull "Unkown error occured" and get you your ASP.NET yellow screen of death.follow the screen

Al menos uno de los tipos de campo no se ha instalado correctamente. Vaya a la página de configuración de la lista para eliminar estos campos. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

great piece of work, thanks. One question: Once I've successfuly selected a value from a different list in a lookup field, and the original value changes, will the value in the lookup field be automatically updated?Thanks, Harmen

I'm implementing grandchild level, and then try to solve a tiny problem (at least for me).

When you create an element on the list, if the original source changes, the element that you recently created remains the same. I suppose because when you create a new element, it's a copy from the original source, and not a link to it (am i right?).

So let me see..yer saying, that even if you change the fields' meta data and point it to some different List, still they load thee values to the older reference??..is this what you meant..and clarify more on term "Element" that we're referring here.. Are we talking about fields meta data on the Edit page, like parent list, site, join on column, etc...or fields' instance on the new form page.

Hi,The Query Lookup is very nice, but i have one question/request:Is it possible to have the ability to dynamically get values from the sharepoint user profile (WSS 3.0 - Welcome -> My Settings) for CurrentUser in the "Third tiny dropdown" for example from the Department field?

I have the same problem, and i noticed it happens when you try to use a list in some parent site (maybe a permission problem?). If the list is in the same site, it works fine. Extrangely enough, you don't have the same problem with parent-child object. When you select a list on the parent site, you will not see the error.

Hello again,I have tried to add the Parent/Child control to a site, do a stsadm -o backup of the site collection and restoring to another url. What happends is that the Parent control will point to the old url. I have not managed to "re-map it".

not deleting the control!!!.. just changing the elements (meta data) in field edit. So lets say: if i create a field with value of reference site like : http://server1:8080 and restored on production say:http://server2:9000 what in the world will automatically change the pointers to newer server??something you have to do..but not deleting the field.. certainly not

Hello Adil,Thanks for taking the time to improve on such a sort after feature that one would expect MS to make a standard!My question is this, after a successful install of the Datacog controls, I found that while editing a documents properties within the browser everthing worked fine, but when I create a new document (Office 2003) and populate the metadata within the DIP form ready for saving, the new drop downs are not available. Will your developments allow the drop downs to render correctly in the office environment?

Office client integration!!interesting.. not tried..and have no clue..if data cogs dint rendered.. then i dont think mine can either!!i think its gotta do with the way the fields are made..i mean... i dont think mine is the perfect custom field control in the world.. i or datacogs guys might have not overriden and implemented required methods to do that..

I had this requirement. Please let me know if your codeplex project will help me.

I have "DepartmentName" as a lookup column where user can select more than one department. Currently this is a static list. I want this department data to come from SQL table and user should be able to select one or more departments.

Then for all the departments they selected, I need to show in the next list list of all employees matching those departments selected. Here one or more employees would be selected.

Please suggest me if this is possible or any other suggestions for this problem.

The Cascading dropdown solution do exactly the same, but not with SQL custom table. It expects the data from custom list. You can very well see that in the field creation/edit pageIf you want from custom SQL table of ,say, some partners' application, why don't you go for BDC object model??

Hi,The Query Lookup is very nice, but i have one question/request:Is it possible to have the ability to dynamically get values from the sharepoint user profile (WSS 3.0 - Welcome -> My Settings) for CurrentUser in the "Third tiny dropdown" for example from the Department field?

***************

I have developed a simple "CurrentUserFilter" for WSS 3.0 that reads the Department field of the current logged in user and passes it to connected webparts on page load. i was thinking of your Query-lookup and thought that it would be absolutly fantastic if it could filter based on curren user.

Is there any possibility that i could trick you into implementing this in your already brilliant solution?

Awesome, job it works great. I was wondering if it's possible to have the value link back to the list item itself. I believe this is how standard lookup columns function. I am using the dropdown to filter out people from a custom list based on a category type; however, I need to be able to click their name and take them to the list item.

Hi Adil great job can you suggest me in creating the grand child.Hi Nicolas I am having the problem in creating the grand child requirement i read you are also into the same problem do you made any workout, if so could you please share that. thanks

I tired your solution on SharePoint server with mixed authentication. Persons from intranet zone with windows based authentication works fine. But users with access from extranet zone with form based authentication get error, when they create new item in list with query based lookup field. Error message is “User not found”. Source and destination lists are on same web where users have Contributor role. Users have read access on all site collection. Authentication provider for extranet zone is ADAM. Any ideas?

thank you for this nice tool, i have problems to create more as one parent - child relationship in the same list, only the first works fine the second dosnt work, if i select in the second ralationship an parent value, the child value of the first is also emty. could you help me please in this one?

This control is fantastic, but I'm having difficulty following the example in the documentation. Please look at the example I describe below and tell me if I am misunderstanding the correct use for this tool.

I've created a custom list with two "Choice" columns: View1 and View2. These are my parent and child columns and each item in the list can have only one value for each column. View1 has the following available choices: A, B, C and D. View2 has the numbers one through twenty as available choices. I have populated the custom list with several entries. For example, Item1 in my list has a value of "A" for View1 and "1" for View2. Item2 in my list has the value "B" for View1 and "6" for View2.

In another list, I've created a "Lookup (Query Based Filtering)" column. I input the custom list created above as my List Name. The Display Column of LookUp Dropdown and the Value column of LookUp DropDown are set to View2. The Column to filter LookUp on is set to View1.

So far, my query is: WHERE View1 = A

How do I configure my query so that values 1-5 are shown when A is selected and values 6-10 are shown when B is selected, etc.

first of all, the thing here you want to do is something that can be done by parent-child cascading guys.. and not query based lookup filtering control.so you want 1-5 when A is selected and 6-10 when B is selected.Simple create a list.(purpose of this list would only b to hold the Items be coming in drop-down.)lets say list is "testList"... (you name it what you like.. what the heck!!).. let say.. this "testList" have 2 simple single line of text columns... say.."Column1" and "Column2"

put 10 entries in "testList" with folowing values:

column1 column2A 1A 2A 3A 4A 5B 6B 7B 8B 9B 10

Now coming to your desired List:make a parent field.. on "column1" of "testList"make a child field on "column2" of "testList" and Join column be "column1"

Hi Adil Thanks for your solution. It´s nice and it works really great in my site.Anyway I´m trying to add the field to a Content Type in Document library and sharepoint shows an alert saying that is not compatible with programs for editing documents. Is there anything I can do?

Yes I can add the field to the content although receiving the alert message "this columns are not compatible with programs for editing documents" type. But then when I open a document the field don´t show me the values inside

I select "", but then get the following error. I know my site is located at "http://genserv007-01/sites/Gencentric".

***** SOLUTION DEPLOYMENT ********** ERROR *****This solution contains resources scoped for a Web application and must be deployed to one or more Web applications.CodePlex.SharePointInstaller.InstallException: This solution contains resources scoped for a Web application and must be deployed to one or more Web applications. ---> Microsoft.SharePoint.SPException: This solution contains resources scoped for a Web application and must be deployed to one or more Web applications. at Microsoft.SharePoint.Administration.SPSolutionLanguagePack.CheckDeployParameters(Collection`1 collWebApps, Boolean globalInstallWPPackDlls, Boolean force) at Microsoft.SharePoint.Administration.SPSolutionLanguagePack.CreateSolutionDeployTimerJob(DateTime dt, Collection`1 webApplications, SPSolutionDeploymentJobType jobType, Boolean globalInstallDlls, Boolean force) at Microsoft.SharePoint.Administration.SPSolutionLanguagePack.Deploy(DateTime dt, Boolean globalInstallWPPackDlls, Boolean force) at Microsoft.SharePoint.Administration.SPSolution.Deploy(DateTime dt, Boolean globalInstallWPPackDlls, Boolean force) at CodePlex.SharePointInstaller.InstallProcessControl.CreateDeploymentJobCommand.Execute() --- End of inner exception stack trace --- at CodePlex.SharePointInstaller.InstallProcessControl.CreateDeploymentJobCommand.Execute() at CodePlex.SharePointInstaller.InstallProcessControl.TimerEventInstall(Object myObject, EventArgs myEventArgs)

the sharepoint setup installer itself is a open source project downloadable from codeplex itself. So if somethings going wrong in that setup, (And it does sometimes), try using the normal stsadm way of deploymentr on the wsp package.see if it works...

Another question, when using "Lookup (Query Based)" is it possible to not include server name when inputting Site URL? The reason i ask, is if i backup the site and restore teh site to a new server, the servername will have changed and i will have to manually go through all my lists to update the servername :-(

A cheeky question...can we have the source code? ;-) Reason, so that i can tinker a bit and change it to not make servername mandatory. So instead of

I'm trying to use the parent-child control.I created a custom list with a parent and a child and everything was ok.then I tried to create another parent type column (my objective is to create a grand child column) and since then when i lcick on the column to see its properties i get the following error

Cannot have multiple items selected in a DropDownList. at System.Web.UI.WebControls.DropDownList.VerifyMultiSelect() at System.Web.UI.WebControls.ListControl.RenderContents(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at ASP._controltemplates_inputformcontrol_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES\InputFormControl.ascx:line 15 etc... (th error goes on, if you want the whole text i can post it to you)

Hi,I am trying to install latest version from codeplex.com it gives me error that "This solutions contains some resouces scoped for a Web Application and must be deployed to one or more Web applications."

Durring installation I select my site "http://abc:1234/" where I want to install this solution.

Hi Adil,Trying to install your neato gadget. Install starts, confirms there is a Windows Sharepoint 3.0, then fails. "Sharepoint was unable to connect to the database server".I can't find anywhere this is configured, nor do I know what this means.Can you advise? (I do have lots of rights, but it's possible I'm missing something).

hey,this has got something to do with your server infrastructure and security settings. cannot connect to database, what so tough in that error??check the protocals on database server. ask the database people if both TCP/Ip and named pipes are enalbed for remote connections

We have a small problem when we use cascadign drop-downs. the value stored in the database is stored country;country instead of just country. and region;region instead of just region. We are probably doing something wrong but we dont know what. can someone please help.

Just a quick background, the current version of the solution that we have stores KEY;VALUE pair where as the previous version stores only KEY. Just because of this limitation we are unable to set up those columns are managed properties since the values returned in XML Data set also includes KEY;VALUE and it is directly consumed by faceted search web parts.

I want two pairs of cascading drop downs in one newformone pair is of country and stateand other is of category and question, right now for me the two pairs are not working simultaneously, if I delete one pair another one is working without any problem, please help, how put two pairs in one newform of a list

Thank you for the nice control.I am testing your "Query Based LookUp Filtering" field control and I very impressed to say the least. My question is regarding the bug you mentioned in your pdf guideline(i.e. #1 which talks about not using the Title column in the CAML query...).

I tested it and it seems to work for me and I was wondering if the guideline is not revised or I am not understanding your point. What I did was, I used the TITLE of my parent List in my filter. As a result when I put my cursor on the view query link I see such a CAML query in your beautiful pop up baloon. And it says "Where LinkTitle=the Value I used to filter LookUp On". Are you saying this should have given me an exception?

i would like to customize the cascadedropdown code from the source code which you have provided..i just build that code as WSP builder setup and installed on the site.when i press ok button, after filling all the values iam getting following exception.

Field type CascadingDropDownListField is not installed properly. Go to the list settings page to delete this field. at Microsoft.SharePoint.SPFieldCollection.CreateNewField(String typeName, String displayName)

Deployment of the Query Based Lookup solution not only renders affected columns in Datasheet view as read-only but disables (breaks) the Task Pane in this view. Is there any hope for a solution to this problem?

seem like this only can do one query lookup. I set the first query working fine (2 lists P / C) but when I tried to set a seconde query lookup for another set of P / C list, then both query failed. is that the limitation or i just don't know how.. can you explain?

I am sure there is nothing from control's side that would hinder two instances to run on a form.i also remember using more then 3 of them on one page long time back.Ne ways, need to look into this to conclude.Why dont you debug and see what's going wrong. as simple as that!!