ChartOfCalculationTypesManager.<Chart of calculation types name>.CreateCalculationType
Syntax:
Returned value:
Description:
Availability:
Example:
Function CreateCalculationType(CCT, Code, Description, BaseCalculationTypes = Undefined) // CCT - chart of calcucaltion types CT = CCT.FindByCode(Code); If CT.IsEmpty() Then CT = CCT.CreateCalculationType(); Else CT = CT.GetObject(); CT.BaseCalculationTypes.Clear(); EndIf; CT.Code = Code; CT.Description = Description; If BaseCalculationTypes<>Undefined Then For each Item In BaseCalculationTypes Do NewRow = CT.BaseCalculationTypes.Add(); NewRow.CalculationType = Item.Value; EndDo; EndIf; CT.Write(); Return CT.Ref; EndFunction |