📚 SAP Business One SDK Help

UpdateHoliday Method
See Also  Example
pIHoliday

The data for the holiday to be updated. The Holiday object must contain the key of the object to be updated.

Description

Updates an existing holiday.

The data for the holiday, including the key of the holiday to be updated, is contained in the Holiday object passed to the method. To update a holiday, you must first retrieve it using the GetHoliday method.

Syntax

Visual Basic
Public Sub UpdateHoliday( _
   ByVal pIHoliday As Holiday _
) 

Parameters

pIHoliday

The data for the holiday to be updated. The Holiday object must contain the key of the object to be updated.

Example

C#Copy Code
SAPbobsCOM.HolidayParams hdParams = holidayService.GetDataInterface(HolidayServiceDataInterfaces.hsHolidayParams); 
hdParams.HolidayCode = "holiday1"; 
SAPbobsCOM.Holiday hd2 = holidayService.GetHoliday(hdParams); 
 
hd2.WeekNoRule = BoWeekNoRuleEnum.fromFirstFullWeek; 
 
int count = hd2.HolidayDates.Count; 
SAPbobsCOM.HolidayDate hdDate1 = hd2.HolidayDates.Item(0); 
hdDate1.Remarks = "new remarks"; 
 
try 

    holidayService.UpdateHoliday(hd2); 

catch (Exception ex) 

    Console.WriteLine(ex.Message); 

See Also