Method Community

 

2 New API Actions

Last post 07-23-2009 8:03 AM by Anonymous. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-20-2009 4:45 PM

    2 New API Actions

    Here are 2 new API calls related to appointment scheduling in Method and how they can be used.

    MethodAPIAppointment_CopySeries - This API will copy the appointments from one recurring record to another record. Here are the parameters required for the call.

    strTable: Table in which the specified Record exists.
    intCopySeriesFromRecordID: This is the record where the series information will come from. This record must have a RecurrenceType of Series.
    intCopySeriesToRecordID: This is the record where the series information will be copied to. This record must have a RecurrenceType of Series or One Time. Appointments with a Recurrence Type of Occurrence will fail as they are already are associated with a Series. One Time jobs will be turned into a Series.
    strCopySeriesDatesOption: This can be left blank and will follow the general rules of creating Occurrence appointments related to the copied from series basis (Daily, Weekly, Monthly, etc). If you do wish to specify an option here, here are a list of alternative ways you can generate occurrence dates.

    "Insert Dates" is the default (and is used if the value is left blank) and will be used to generate the dates based on the basis of the copied from series record.
    "Copy Exact Dates greater than today" - will copy the occurrence jobs currently in the record specified in intCopySeriesFromRecordID to the intCopySeriesToRecordID exactly as they are and will not create services older than today. 
    "Insert Dates Copy Exact Dates" - will copy all jobs currently in the record specified in intCopySeriesFromRecordID to the intCopySeriesToRecordID regardless if the current date is greater than the service's date. 
    "Copy no dates" will copy the information from the intCopySeriesFromRecordID record to the intCopySeriesToRecordID, but no Occurrence dates will be generated.  
     

    MethodApiAppointment_InsertDate - this will allow you to insert a record with the Recurrence Type Occurrence into a Series.  The API does not limit you in which dates you must insert the new appointment. The parameters are the following.

    intAppointmentRecordID: This is the record id of the Series you will be inserting a new occurrence for.
    strAppointmentStartDateAndTiime: This is the start date and time of the new occurrence. Please not this time must be in UTC or the times will be incorrect in Method when viewed in the browser. So for example if you wish to see a service as 2009-07-21 9:00:00 EST you will have to send the time as 2009-07-21 13:00:00.
    strAppointmentEndDateAndTiime: This is the end date and time of the new occurrence. Same rules applies as above with UTC time.

  • 07-20-2009 6:43 PM In reply to

    • Matt
    • Top 10 Contributor
    • Joined on 11-03-2008
    • Posts 877

    Peter,

    Is this different or better than inserting an occurence into the activity table?

    Matt


    Matt Raiser

    Founder,



    www.techinthefield.com

    matt@techinthefield.com

    219-221-9500



    ~ Method user / partner since 2008

    ~ Over 15 years field service experience

    ~ 2013 Method Partner of the Year

    ~ Degree in Computer Science





    Creator of:


        


  • 07-23-2009 8:03 AM In reply to

    Matt,

    It is better to use the MethodApiAppointment_InsertDate call as you only have to worry about the Series record id and the start and stop times of the service. All the other information, such as Recurrence Type, is handled for you.

    The MethodApiAppointment_CopySeries call helps so you don't have to regenerate the recurrence information in the xml format. All the other information from the record being copied to stays the same (such as start and stop times).

    Peter

Page 1 of 1 (3 items)