I have created some lists & related lists using object model. Im changing my column names also at the time of creating the field with SPRelationshipDeleteBehavior.
when I try to delete the item in parent list, istead of showing the message "This item cannot be deleted because ....." , it threw error like "Cannot complete this action...", when I check log , no luck. (found one related to lock, not sure what it is).
Then after long trial and error methods, I changed my code to two parts.
1. Create lists and related lists
2. for the specific fields set deleterelationshipBehaviour
from then its working. I guess the field name might cause the error, as index is created using old name.
Tuesday, February 22, 2011
add additional fields in sharepoint list 2010, using object model
http://msdn.microsoft.com/en-us/library/ff623048.aspx
here is the logic
string strFirstNameCol = relatedList.Fields.AddDependentLookup("First Name", primaryCol.Id);
SPFieldLookup firstNameCol = (SPFieldLookup)relatedList.Fields.GetFieldByInternalName(strFirstNameCol);
where, "primaryCol" is the main look up field in the second list.
here is the logic
string strFirstNameCol = relatedList.Fields.AddDependentLookup("First Name", primaryCol.Id);
SPFieldLookup firstNameCol = (SPFieldLookup)relatedList.Fields.GetFieldByInternalName(strFirstNameCol);
where, "primaryCol" is the main look up field in the second list.
Thursday, February 17, 2011
The language-neutral solution package was not found
Sometimes u get this error while deploying ur package, then u can try the following commands in sharepoint 2010 powershell
//find the deployed solutinos
get-spsolution
//then replace mysol with ur solution
(get-spsolution mysol.wsp).Delete()
then try to deploy ur sol. again
--happy coding
//find the deployed solutinos
get-spsolution
//then replace mysol with ur solution
(get-spsolution mysol.wsp).Delete()
then try to deploy ur sol. again
--happy coding
SharePoint Custom fields
1. Thanks to jeremyluerken for writing such a wonderful article (custom picker in SP 2010)
http://sharepointsolutions.com/sharepoint-help/blog/2009/10/create-a-custom-picker-in-sharepoint-2010/
2. Thanks to Waldek Mastykarz for his marvelous work, i've been lookin for this kind of solution for a long time, finally found this.
(Custom picker, fill multiple fileds at a time)
http://blog.mastykarz.nl/filling-forms-entitypicker-callback/
http://sharepointsolutions.com/sharepoint-help/blog/2009/10/create-a-custom-picker-in-sharepoint-2010/
2. Thanks to Waldek Mastykarz for his marvelous work, i've been lookin for this kind of solution for a long time, finally found this.
(Custom picker, fill multiple fileds at a time)
http://blog.mastykarz.nl/filling-forms-entitypicker-callback/
Thursday, January 27, 2011
Timer jobs in sharepoint (WSS) subsites
http://sharepoint2010shyju.blogspot.com/2010/12/creating-custom-timer-job.html?showComment=1296184785817#c3173481420652015259
please refer this link. I must say thanks to the author Mohan for his great post.
the logic is
1. use the properties like below in ur timer job class
[Persisted()]
public string MyCustomProperty;
2. assign the url of the web (site/subsite..whatever) to the property in feature activated event
SPWeb webN = properties.Feature.Parent as SPWeb;
taskLoggerJob.MyCustomProperty = webN.ServerRelativeUrl;
Note:- my scope is web
3. Use the property in Execute method
SPSite _siteCol = new SPSite(this.WebApplication.Sites[0].Url);
SPWeb _site = _siteCol.AllWebs[MyCustomProperty]; //
Note:- I have one site collection, (u can refer ur site collection using contentdbId)
:-), thats it...Happy coding
please refer this link. I must say thanks to the author Mohan for his great post.
the logic is
1. use the properties like below in ur timer job class
[Persisted()]
public string MyCustomProperty;
2. assign the url of the web (site/subsite..whatever) to the property in feature activated event
SPWeb webN = properties.Feature.Parent as SPWeb;
taskLoggerJob.MyCustomProperty = webN.ServerRelativeUrl;
Note:- my scope is web
3. Use the property in Execute method
SPSite _siteCol = new SPSite(this.WebApplication.Sites[0].Url);
SPWeb _site = _siteCol.AllWebs[MyCustomProperty]; //
Note:- I have one site collection, (u can refer ur site collection using contentdbId)
:-), thats it...Happy coding
Thursday, January 13, 2011
SharePoint Foundation + Search Server 2010
http://sptechpoint.wordpress.com/2010/11/30/your-search-cannot-be-completed-because-this-site-is-not-assigned-to-an-indexer/
This blog saved my day. Once you install the SSE, u have to configure it in Central Admin site
1. Go to Central Admin as login as the farm Administrator
2. Go to Application Management tab
3. Select SharePoint Web Application Management heading | Content databases
4. Ensure your web application is the one selected
5. Select your content database name
6. Under Search Server – select your server (if your search server drop down is disabled please follow the additional steps below)
7. Go to 12 hive folder and open stsadm.exe utility
8. Run the following command psconfig.exe -cmd services -install
9. Then run stsadm -o spsearch -action start (specify the farm account if required)
Thnx to the author of the mentioned link
This blog saved my day. Once you install the SSE, u have to configure it in Central Admin site
1. Go to Central Admin as login as the farm Administrator
2. Go to Application Management tab
3. Select SharePoint Web Application Management heading | Content databases
4. Ensure your web application is the one selected
5. Select your content database name
6. Under Search Server – select your server (if your search server drop down is disabled please follow the additional steps below)
7. Go to 12 hive folder and open stsadm.exe utility
8. Run the following command psconfig.exe -cmd services -install
9. Then run stsadm -o spsearch -action start (specify the farm account if required)
Thnx to the author of the mentioned link
Thursday, October 28, 2010
SharePoint 2010 BCS
Good site I found is
http://www.chakkaradeep.com/post/BDC-NET-Assembly-Connector-Updating-a-BCS-Entity.aspx
Thanks a lot bro.
It is missing the CREATE/DELETE method, here it is
public static BookEntity Create(BookEntity bookEntity)
{
books.Insert(books.Count, String.Format("{0},{1},{2},{3},{4}", bookEntity.ISBN,
bookEntity.Name, bookEntity.Author, bookEntity.Price, bookEntity.Publisher));
return bookEntity;
}
public static void Delete(string parameter)
{
books.Remove(books.FirstOrDefault(s => s.Contains(parameter)));
}
http://www.chakkaradeep.com/post/BDC-NET-Assembly-Connector-Updating-a-BCS-Entity.aspx
Thanks a lot bro.
It is missing the CREATE/DELETE method, here it is
public static BookEntity Create(BookEntity bookEntity)
{
books.Insert(books.Count, String.Format("{0},{1},{2},{3},{4}", bookEntity.ISBN,
bookEntity.Name, bookEntity.Author, bookEntity.Price, bookEntity.Publisher));
return bookEntity;
}
public static void Delete(string parameter)
{
books.Remove(books.FirstOrDefault(s => s.Contains(parameter)));
}
Subscribe to:
Posts (Atom)