📚 SAP Business One SDK Help

GetHoliday Method
See Also  Example
pIHolidayParams

The key of the holiday to retrieve.

Description

Retrieves a holiday.

The holiday is specified by its key, which is contained in the HolidayParams object passed to the method.

Syntax

Visual Basic
Public Function GetHoliday( _
   ByVal pIHolidayParams As HolidayParams _
) As Holiday

Parameters

pIHolidayParams

The key of the holiday to retrieve.

Example

C#Copy Code
SAPbobsCOM.HolidayParams hdParam = holidayService.GetDataInterface(SAPbobsCOM.HolidayServiceDataInterfaces.hsHolidayParams); 
hdParam.HolidayCode = "2007 Feiertage"; 
SAPbobsCOM.Holiday hd = holidayService.GetHoliday(hdParam); 
Console.WriteLine(hd.HolidayCode); 
Console.WriteLine(hd.WeekendFrom); 
Console.WriteLine(hd.WeekendTO); 
Console.WriteLine(hd.ValidForOneYearOnly); 
Console.WriteLine(hd.SetWeekendsAsWorkDays); 
Console.WriteLine(hd.WeekNoRule); 
for (int i = 0; i < hd.HolidayDates.Count; i++) 

    Console.WriteLine(" " + hd.HolidayDates.Item(i).StartDate); 
    Console.WriteLine(" " + hd.HolidayDates.Item(i).EndDate); 
    Console.WriteLine(" " + hd.HolidayDates.Item(i).Remarks); 
}

See Also