Mattersphere Developers Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

C# And The Appointment Class Empty C# And The Appointment Class

Mon 27 Jan 2020 - 8:48
I have two C# questions involving the appointment class.
1) The users want the ability of selecting a category that gives the appoint a colour. So for instance by creating an appointment we want to set it so that the category colour is purple. I know that it involves the...


FWBS.OMS.OMSFile myFile = FWBS.OMS.Session.CurrentSession.CurrentFile; string myDesc =
“Test Appointment - Created On “ + System.DateTime.Now.ToString(“yyyy-MM-dd HH🇲🇲ss.fff”);
string category = “Purple Category”;
// More variables
FWBS.OMS.Appointment myApp = new FWBS.OMS.Appointment(myFile, myDesc);
// Set more variables myApp.Categories = category;
myApp.ExchangeSync = exchangeSync; myApp.Update();


But there seems to be no examples of how to set the category colour in C#. How do you do this?
2) Appointments in C#, within Mattercentre, seem to be only available to Fee Earners. We also want to create appointments for secretaries who are only users within the Mattercentre database. How can this be done without turning all secretaries to Fee Earners?
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

C# And The Appointment Class Empty Response from TR

Mon 27 Jan 2020 - 8:49
RE 1:
I might be wrong, but I believethat the colour of the category is entirely a user selection. So you can create an appointment passing the category name, but it will be down to the users category set up to allocate a colour to that specific category name.
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

C# And The Appointment Class Empty Re: C# And The Appointment Class

Mon 27 Jan 2020 - 8:49
We are using default categories. So for instance [Red Catgory] is coloured red for all Outlook users withing my practice but when I set myAppointment.Categories = “Red Category”;
Nothing is happening to the colouring of the appointment. What am I missing?
Also any answer about how I can send an appointment to a user who is not a Fee Earner?
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

C# And The Appointment Class Empty Re: C# And The Appointment Class

Mon 27 Jan 2020 - 8:49
You will need to add a column to dbAppointments and alter the appointment screens or your code to populate it.
Then you will have to change the stored procedure sprExcGetAppointments which the Exchange sync service uses to get appointments.
For the categories.
Also have a look at what is returned for 'Category' in that stored procedure. It looks like the core code ignore Appoinment.Categories unless the appointment table has
a column called appCategories which you'll have to manually add. It is just a string so you should make it an nvarchar(any size you want, except exchange may have a
limit that you need to be aware of).
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

C# And The Appointment Class Empty Re: C# And The Appointment Class

Mon 27 Jan 2020 - 8:50
Solution
========
1) Get a list of categories used in the recipient Fee Earner's Outlook. e.g [Family], [Personal], [Purple Category]
2) Add these categories to [Code Lookups] -> [FILEINFO] -> [APPTYPE]
e.g. [Code] = [APP123] [Description] = [Family]
e.g. [Code] = [APP124] [Description] = [Personal]
e.g. [Code] = [APPTST] [Description] = [Purple Category]
3) Use C# code to send The Appointment.
e.g.
//*****************************************************************************
// Code lookup for the Category you want the appointment associated with
//*****************************************************************************
const string MY_CATEGORY = “APPTST”;
//const string MY_CATEGORY = “APP123”;
//*****************************************************************************
// Get details of recipient Fee Earner
//*****************************************************************************
int userID = 167;
FWBS.OMS.FeeEarner myFeeEarner = FWBS.OMS.FeeEarner.GetFeeEarner(userID);
//*****************************************************************************
// Get Current File
//*****************************************************************************
FWBS.OMS.OMSFile myFile = FWBS.OMS.Session.CurrentSession.CurrentFile;
//*****************************************************************************
// Set up Appointment Details
//*****************************************************************************
string apptLocation = myFeeEarner.FullName + @”'s Desk”;

System.DateTime? apptStartDateTime = DateTime.UtcNow.AddDays(1.00); System.DateTime? apptEndDateTime = DateTime.UtcNow.AddDays(1.05); bool apptAllDayEvent = false;
int apptReminderMinutesBeforeStart = 15; bool myExchangeSync = true;
string apptNotes = “Hello World!!!”;
string apptDesc = “Test Appointment - Created On “ + System.DateTime.Now.ToString(“yyyy-MM-dd HH🇲🇲ss.fff”);

//*****************************************************************************
// Create Appointment object
//***************************************************************************** FWBS.OMS.Appointment myAppt = new FWBS.OMS.Appointment(myFile, apptDesc);

//*****************************************************************************
// Set Appointment properties
//***************************************************************************** myAppt.FeeEarner = myFeeEarner;
myAppt.Location = apptLocation;
myAppt.StartDate = Convert.ToDateTime(apptStartDateTime); myAppt.EndDate = Convert.ToDateTime(apptEndDateTime); myAppt.AllDay = apptAllDayEvent;
myAppt.Reminder = apptReminderMinutesBeforeStart; myAppt.Notes = apptNotes;
myAppt.ExchangeSync = myExchangeSync;

//*****************************************************************************
// Set up category for appointment
//***************************************************************************** myAppt.Type = MY_CATEGORY;

myAppt.Update();

string cr = System.Environment.NewLine;
string theMessage = cr + cr + “Appointment Sent” + cr + “Appointment Description: “ + cr + apptDesc;

EnquiryForm.GetIBasicEnquiryControl2(“lblTest1”, EnquiryControlMissing.Exception).Value = theMessage
Sponsored content

C# And The Appointment Class Empty Re: C# And The Appointment Class

Back to top
Similar topics
Permissions in this forum:
You cannot reply to topics in this forum