| Quintiq file version 2.0 | 
| #parent: #root | 
| Method AddPeriodOfTimeForExport ( | 
|   Date startdate, | 
|   Date enddate, | 
|   String periodoftimedefinitionid, | 
|   String timeunit | 
| ) | 
| { | 
|   Description: 'Verify duplicate then append PeriodOfTime to PeriodOfTimeCache.' | 
|   TextBody: | 
|   [* | 
|     // Use converter to get right date format | 
|     stringStartDate := LibSCIIntegration_Utility::DateToStringISOConverter( startdate ); | 
|     stringEndDate := LibSCIIntegration_Utility::DateToStringISOConverter( enddate ); | 
|      | 
|     // Check if the PeriodOfTime is already existing | 
|     existingPeriodOfTime := LibSCIPeriodOfTime::FindLibSCIPeriodOfTimeTypeIndex( timeunit, startdate, enddate ); | 
|     if( isnull( existingPeriodOfTime ) ) | 
|     { | 
|       this.LibSCIPeriodOfTime( relnew, | 
|                                TimeUnit := timeunit, | 
|                                StartDate := startdate, | 
|                                EndDate := enddate ); | 
|                           | 
|       content := construct( Strings ); | 
|        | 
|       content.Add( stringStartDate ); // name | 
|       content.Add( stringStartDate ); // startDate | 
|       content.Add( stringEndDate );   // endDate | 
|       content.Add( LibSCIIntegration_Utility::FormatString( periodoftimedefinitionid ) ); // periodOfTimeDefinition | 
|      | 
|       addedvalues := content.ToString( LibSCIIntegration_Utility::Tokenizer() ); | 
|       addedvalues := this.PeriodOfTimeCache() + String::NewLine() + addedvalues; | 
|      | 
|       this.PeriodOfTimeCache( addedvalues ); | 
|     } | 
|   *] | 
| } |