| Quintiq file version 2.0 | 
| #parent: #root | 
| Method AddSaleSegmentForExport ( | 
|   String name, | 
|   String inhierarchyof | 
| ) | 
| { | 
|   Description: 'Verify duplicate then append SaleSegment to SaleSegmentCache' | 
|   TextBody: | 
|   [* | 
|     // Check if the SaleSegment is already existing | 
|     existingSaleSegment := LibSCISaleSegment::FindLibSCISaleSegmentTypeIndex( name ); | 
|     if( isnull( existingSaleSegment ) ) | 
|     { | 
|       this.LibSCISaleSegment( relnew, | 
|                               Uri := name ); | 
|                           | 
|       content := construct( Strings ); | 
|        | 
|       content.Add( LibSCIIntegration_Utility::FormatString( name ) );           // uri | 
|       content.Add( LibSCIIntegration_Utility::FormatString( name ) );           // name | 
|       content.Add( LibSCIIntegration_Utility::FormatString( inhierarchyof ) );  // inHierarchyOf | 
|      | 
|       addedvalues := content.ToString( LibSCIIntegration_Utility::Tokenizer() ); | 
|       addedvalues := this.SaleSegmentCache() + String::NewLine() + addedvalues; | 
|      | 
|       this.SaleSegmentCache( addedvalues ); | 
|     } | 
|   *] | 
| } |