| Quintiq file version 2.0 | 
| #parent: #root | 
| Method AddUnconstrainedDemandForExport ( | 
|   String scenario, | 
|   String uriitem, | 
|   String uristocklocation, | 
|   String urisalessegment, | 
|   Date startdate, | 
|   Date enddate, | 
|   Real quantity, | 
|   Real revenue | 
| ) | 
| { | 
|   Description: 'Verify duplicate then append UnconstrainedDemand to UnconstrainedDemandCache' | 
|   TextBody: | 
|   [* | 
|     // Use converter to get right date format | 
|     stringStartDate := LibSCIIntegration_Utility::DateToStringISOConverter( startdate ); | 
|     stringEndDate := LibSCIIntegration_Utility::DateToStringISOConverter( enddate ); | 
|      | 
|     // Check if the UnconstrainedDemand is already existing | 
|     existingUnconstrainedDemand := LibSCIUnconstrainedDemand::FindLibSCIUnconstrainedDemandTypeIndex( scenario,uriitem, urisalessegment, uristocklocation, enddate ); | 
|     if( isnull( existingUnconstrainedDemand ) ) | 
|     { | 
|       this.LibSCIUnconstrainedDemand( relnew, | 
|                                       UriScenario := scenario, | 
|                                       UriItem := uriitem, | 
|                                       UriSalesSegment := urisalessegment, | 
|                                       UriStockLocation := uristocklocation, | 
|                                       UriEndDate := enddate ); | 
|                           | 
|       content := construct( Strings ); | 
|        | 
|       content.Add( LibSCIIntegration_Utility::FormatString( scenario ) );           // scenario | 
|       content.Add( LibSCIIntegration_Utility::FormatString( uriitem ) );            // item | 
|       content.Add( LibSCIIntegration_Utility::FormatString( uristocklocation ) );   // salesSegment | 
|       content.Add( LibSCIIntegration_Utility::FormatString( urisalessegment ) );    // stockLocation | 
|       content.Add( stringStartDate );                                                      // startDate | 
|       content.Add( stringEndDate );                                                        // endDate | 
|       content.Add( [String]quantity );                                                     // quantity | 
|       content.Add( [String]revenue );                                                      // revenue | 
|        | 
|       addedvalues := content.ToString( LibSCIIntegration_Utility::Tokenizer() ); | 
|       addedvalues := this.UnconstrainedDemandCache() + String::NewLine() + addedvalues; | 
|      | 
|       this.UnconstrainedDemandCache( addedvalues ); | 
|     } | 
|   *] | 
| } |