code for adding events to the event calendar?
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
code for adding events to the event calendar?

 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development
Author Message
jrmcdona
Guest





Posted: Wed Jan 05, 2005 1:45 am    Post subject: code for adding events to the event calendar? Reply with quote

Is is possible to add events to the event calendar by writing code to do this.

I am going to have a custom web part that will list several meetings with
date/times. I want to clikc on a meeting and have it automatically add to the
event calendar on the correct date and time. But i cannot find the necessary
documentation to write this code.

Is this possible?
Back to top
Jan Tielens
Guest





Posted: Wed Jan 05, 2005 2:20 pm    Post subject: Re: code for adding events to the event calendar? Reply with quote

A calendar is in fact just a normal SharePoint list, so you can use the
following code in a web part to add an item:
SPSite site = SPControl.GetContextSite(Context);
SPList destList =
site.AllWebs["Destination_Site"].Lists["Destination_List"];

SPListItemCollection listItems = destList.Items;

SPListItem newItem = listItems.Add();

newItem["Field1_Name"] = "Scenario 2";
newItem["Field2_Name"] = 45;
newItem["Field3_Name"] = "A sample note for this item.";

newItem.Update();Full article:http://tinyurl.com/43tkp

--
____________________________________
Jan Tielens
Read my weblog: http://weblogs.asp.net/jan


"jrmcdona" <jrmcdona@discussions.microsoft.com> schreef in bericht
news:9CA1A6EE-A2A8-4BD5-9CF5-A2E0C102F4B2@microsoft.com...
Quote:
Is is possible to add events to the event calendar by writing code to do
this.

I am going to have a custom web part that will list several meetings with
date/times. I want to clikc on a meeting and have it automatically add to
the
event calendar on the correct date and time. But i cannot find the
necessary
documentation to write this code.

Is this possible?
Back to top
jrmcdona
Guest





Posted: Wed Jan 05, 2005 10:37 pm    Post subject: Re: code for adding events to the event calendar? Reply with quote

Thanks for the help! This seems easy enough. However, I dont think I
understand how it knows that it is going to the calendar list. Where should
I look to find the name of my calendar list and also what the exact field
names are for calendar lists. For instance "title", "begin date" and so on....

This is my first time using the class library (all my other web parts have
just been simple)....

Thanks again for your input!

Jordan

"Jan Tielens" wrote:

Quote:
A calendar is in fact just a normal SharePoint list, so you can use the
following code in a web part to add an item:
SPSite site = SPControl.GetContextSite(Context);
SPList destList =
site.AllWebs["Destination_Site"].Lists["Destination_List"];

SPListItemCollection listItems = destList.Items;

SPListItem newItem = listItems.Add();

newItem["Field1_Name"] = "Scenario 2";
newItem["Field2_Name"] = 45;
newItem["Field3_Name"] = "A sample note for this item.";

newItem.Update();Full article:http://tinyurl.com/43tkp

--
____________________________________
Jan Tielens
Read my weblog: http://weblogs.asp.net/jan


"jrmcdona" <jrmcdona@discussions.microsoft.com> schreef in bericht
news:9CA1A6EE-A2A8-4BD5-9CF5-A2E0C102F4B2@microsoft.com...
Is is possible to add events to the event calendar by writing code to do
this.

I am going to have a custom web part that will list several meetings with
date/times. I want to clikc on a meeting and have it automatically add to
the
event calendar on the correct date and time. But i cannot find the
necessary
documentation to write this code.

Is this possible?


Back to top
Jan Tielens
Guest





Posted: Thu Jan 06, 2005 12:46 pm    Post subject: Re: code for adding events to the event calendar? Reply with quote

The name of the list is the name which you've chosen when you created the
calendar in your sharepoint site. You can verify what columns exists on the
list by clicking the Modify settings and columns link.

Fyi, you can use this tool as well to find out what's on your SharePoint
site:
http://www.ontolica.com/English/Products/SharePointExplorer/SharePointExplorerHome.html
Recommended!!

--
____________________________________
Jan Tielens
Read my weblog: http://weblogs.asp.net/jan


"jrmcdona" <jmc_1776@hotmail.com> schreef in bericht
news:FBD17512-FECC-4257-BAF4-B8D4CCE42431@microsoft.com...
Quote:
Thanks for the help! This seems easy enough. However, I dont think I
understand how it knows that it is going to the calendar list. Where
should
I look to find the name of my calendar list and also what the exact field
names are for calendar lists. For instance "title", "begin date" and so
on....

This is my first time using the class library (all my other web parts have
just been simple)....

Thanks again for your input!

Jordan

"Jan Tielens" wrote:

A calendar is in fact just a normal SharePoint list, so you can use the
following code in a web part to add an item:
SPSite site = SPControl.GetContextSite(Context);
SPList destList =
site.AllWebs["Destination_Site"].Lists["Destination_List"];

SPListItemCollection listItems = destList.Items;

SPListItem newItem = listItems.Add();

newItem["Field1_Name"] = "Scenario 2";
newItem["Field2_Name"] = 45;
newItem["Field3_Name"] = "A sample note for this item.";

newItem.Update();Full article:http://tinyurl.com/43tkp

--
____________________________________
Jan Tielens
Read my weblog: http://weblogs.asp.net/jan


"jrmcdona" <jrmcdona@discussions.microsoft.com> schreef in bericht
news:9CA1A6EE-A2A8-4BD5-9CF5-A2E0C102F4B2@microsoft.com...
Is is possible to add events to the event calendar by writing code to
do
this.

I am going to have a custom web part that will list several meetings
with
date/times. I want to clikc on a meeting and have it automatically add
to
the
event calendar on the correct date and time. But i cannot find the
necessary
documentation to write this code.

Is this possible?


Back to top
jrmcdona
Guest





Posted: Fri Jan 07, 2005 5:39 am    Post subject: Re: code for adding events to the event calendar? Reply with quote

That tool is great, thanks.

Excuse me for my lack of knowledge, however, I am on a crash course web
parts mission so I can work on a project for sharepoint.

I do not see "Modify settings and columns link"??? I only see "Modify Shared
Web Part" and then you basic tool pane? What am I doing wrong??

Thanks again, you have been very helpful!


"Jan Tielens" wrote:

Quote:
The name of the list is the name which you've chosen when you created the
calendar in your sharepoint site. You can verify what columns exists on the
list by clicking the Modify settings and columns link.

Fyi, you can use this tool as well to find out what's on your SharePoint
site:
http://www.ontolica.com/English/Products/SharePointExplorer/SharePointExplorerHome.html
Recommended!!

--
____________________________________
Jan Tielens
Read my weblog: http://weblogs.asp.net/jan


"jrmcdona" <jmc_1776@hotmail.com> schreef in bericht
news:FBD17512-FECC-4257-BAF4-B8D4CCE42431@microsoft.com...
Thanks for the help! This seems easy enough. However, I dont think I
understand how it knows that it is going to the calendar list. Where
should
I look to find the name of my calendar list and also what the exact field
names are for calendar lists. For instance "title", "begin date" and so
on....

This is my first time using the class library (all my other web parts have
just been simple)....

Thanks again for your input!

Jordan

"Jan Tielens" wrote:

A calendar is in fact just a normal SharePoint list, so you can use the
following code in a web part to add an item:
SPSite site = SPControl.GetContextSite(Context);
SPList destList =
site.AllWebs["Destination_Site"].Lists["Destination_List"];

SPListItemCollection listItems = destList.Items;

SPListItem newItem = listItems.Add();

newItem["Field1_Name"] = "Scenario 2";
newItem["Field2_Name"] = 45;
newItem["Field3_Name"] = "A sample note for this item.";

newItem.Update();Full article:http://tinyurl.com/43tkp

--
____________________________________
Jan Tielens
Read my weblog: http://weblogs.asp.net/jan


"jrmcdona" <jrmcdona@discussions.microsoft.com> schreef in bericht
news:9CA1A6EE-A2A8-4BD5-9CF5-A2E0C102F4B2@microsoft.com...
Is is possible to add events to the event calendar by writing code to
do
this.

I am going to have a custom web part that will list several meetings
with
date/times. I want to clikc on a meeting and have it automatically add
to
the
event calendar on the correct date and time. But i cannot find the
necessary
documentation to write this code.

Is this possible?





Back to top
Jan Tielens
Guest





Posted: Fri Jan 07, 2005 12:18 pm    Post subject: Re: code for adding events to the event calendar? Reply with quote

You have to navigate to the List by clicking on the link in the quick
navigation for example. Then on your left you will have a couple of links,
one of them is Modify columns and settings.

--
____________________________________
Jan Tielens
Read my weblog: http://weblogs.asp.net/jan


"jrmcdona" <jmc_1776@hotmail.com> schreef in bericht
news:49D6FCE4-DE9B-4954-84C3-72AA2236CFDC@microsoft.com...
Quote:

That tool is great, thanks.

Excuse me for my lack of knowledge, however, I am on a crash course web
parts mission so I can work on a project for sharepoint.

I do not see "Modify settings and columns link"??? I only see "Modify
Shared
Web Part" and then you basic tool pane? What am I doing wrong??

Thanks again, you have been very helpful!


"Jan Tielens" wrote:

The name of the list is the name which you've chosen when you created the
calendar in your sharepoint site. You can verify what columns exists on
the
list by clicking the Modify settings and columns link.

Fyi, you can use this tool as well to find out what's on your SharePoint
site:
http://www.ontolica.com/English/Products/SharePointExplorer/SharePointExplorerHome.html
Recommended!!

--
____________________________________
Jan Tielens
Read my weblog: http://weblogs.asp.net/jan


"jrmcdona" <jmc_1776@hotmail.com> schreef in bericht
news:FBD17512-FECC-4257-BAF4-B8D4CCE42431@microsoft.com...
Thanks for the help! This seems easy enough. However, I dont think I
understand how it knows that it is going to the calendar list. Where
should
I look to find the name of my calendar list and also what the exact
field
names are for calendar lists. For instance "title", "begin date" and so
on....

This is my first time using the class library (all my other web parts
have
just been simple)....

Thanks again for your input!

Jordan

"Jan Tielens" wrote:

A calendar is in fact just a normal SharePoint list, so you can use
the
following code in a web part to add an item:
SPSite site = SPControl.GetContextSite(Context);
SPList destList =
site.AllWebs["Destination_Site"].Lists["Destination_List"];

SPListItemCollection listItems = destList.Items;

SPListItem newItem = listItems.Add();

newItem["Field1_Name"] = "Scenario 2";
newItem["Field2_Name"] = 45;
newItem["Field3_Name"] = "A sample note for this item.";

newItem.Update();Full article:http://tinyurl.com/43tkp

--
____________________________________
Jan Tielens
Read my weblog: http://weblogs.asp.net/jan


"jrmcdona" <jrmcdona@discussions.microsoft.com> schreef in bericht
news:9CA1A6EE-A2A8-4BD5-9CF5-A2E0C102F4B2@microsoft.com...
Is is possible to add events to the event calendar by writing code
to
do
this.

I am going to have a custom web part that will list several meetings
with
date/times. I want to clikc on a meeting and have it automatically
add
to
the
event calendar on the correct date and time. But i cannot find the
necessary
documentation to write this code.

Is this possible?





Back to top
jrmcdona
Guest





Posted: Fri Jan 14, 2005 5:51 am    Post subject: Re: code for adding events to the event calendar? Reply with quote

So i have created a site called "My Team Site" and I am working with the code
you gave me below.

The site is located at "htto://localhost/sites/myteamsite"

However, I cannot seem to get the AllWebs["Destination_Site"] part
correctly. I have tried entering in several different things but they are
throwing errors. Haven't found any good examples using this yet.

I think i will have it after this!

Thanks!



"Jan Tielens" wrote:

Quote:
A calendar is in fact just a normal SharePoint list, so you can use the
following code in a web part to add an item:
SPSite site = SPControl.GetContextSite(Context);
SPList destList =
site.AllWebs["Destination_Site"].Lists["Destination_List"];

SPListItemCollection listItems = destList.Items;

SPListItem newItem = listItems.Add();

newItem["Field1_Name"] = "Scenario 2";
newItem["Field2_Name"] = 45;
newItem["Field3_Name"] = "A sample note for this item.";

newItem.Update();Full article:http://tinyurl.com/43tkp

--
____________________________________
Jan Tielens
Read my weblog: http://weblogs.asp.net/jan


"jrmcdona" <jrmcdona@discussions.microsoft.com> schreef in bericht
news:9CA1A6EE-A2A8-4BD5-9CF5-A2E0C102F4B2@microsoft.com...
Is is possible to add events to the event calendar by writing code to do
this.

I am going to have a custom web part that will list several meetings with
date/times. I want to clikc on a meeting and have it automatically add to
the
event calendar on the correct date and time. But i cannot find the
necessary
documentation to write this code.

Is this possible?


Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB