Hi,
how can we get the Activity Id after addinbg an activity to the database .any helps please urgent
thanks in advance
I've just looked at my own dayview program and I set and retrieve the datakey item.
I use a lot of my own custom things created by my company and me so when I set a value to the appointment its a Guid rather then an id.
in my C# I say
Appointment a = new Appointment();
a.DataKey = WorkRow.Uid.ToString();
then in the javascript I have an if statement.
if (oActivity.getDatakey() == null)
var uid = null
else
var uid = oActivity.getDatakey();
and then it loads a custom dataform with all the information about that record based on the Uid passed through the datakey
hi heran,
i was able to add the appointment through clientside event but couldnt get the id still can you please help me out with an example
Thanks
Anish
Best way I found to get information about the appointments after they have been added was through the Javascript events. If done right you can get any information you want about the appointment after its been added no matter when it was added on a click or double click event.
hi,
Thanks ...
I have a doubt
I added an appoint .The code is as follows:
.CreateAppointment();
// Add Activity to the Activities collection on WebScheduleInfo1.
.WebScheduleInfo1.Activities.Add(appt);
WebScheduleOleDbProvider1.AddActivity(appt,
createappointment was as follows:
private
FollowUpAppointment
CreateAppointment()
{
// Create an empty Activity owned by the WebScheduleInfo.
FollowUpAppointment appt = new FollowUpAppointment(this
.WebScheduleInfo1);
appt.StartDateTimeUtc = Infragistics.WebUI.Shared.
SmartDate
.Now;
// Set pertinent properties on the Activity.
appt.Subject =
"My Thirty-Minute Appointmentxc"
;
appt.Duration =
new TimeSpan
(0, 30, 0);
// Set Key property to a unique value on each appointment.
//appt.Key = "100";
appt.ProviderID =
"STEXT"
string
str = appt.Key;
// Set ResourceKey property to link Activity with organizing Resource.
appt.ResourceKey =
this
.WebScheduleInfo1.VisibleResources.UnassignedResource.Key;
// Return the newly initialized Activity.
return appt;
Afer adding this how can i get the correspopnding activity iD
this.WebScheduleInfo1.VisibleResources.UnassignedResource);
after this statement appt.datakey is null
how can i get it just after adding the appointment
Please help me on this regard
First, if you are using stored procedures then have you checked the DataKey property on the Activity after it has been added? WebScheduleSqlClientProvider will put the ID there if the add transaction commits successfully.
If you are using embedded SQL, then when the WebScheduleInfo data binds (which happens just after the client sends a request that adds or updates an Activity), its Activities should be re-loaded with their IDs. If your code remembers the date/time of the newly added Activity, you can go in and retrieve it with a call to GetAppointmentsForDate.