| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod CreateMPSyncMessage ( | 
|   MacroPlan macroplan | 
| ) | 
| { | 
|   Description: 'Create sanity check message for process maximum quantity.' | 
|   TextBody: | 
|   [* | 
|     // CKG2 Aug-16-2016 (created) | 
|      | 
|     messagelimit := macroplan.GlobalParameters_MP().SanityCheckLimit(); | 
|      | 
|     //no need to sort because all the error belong to data warning | 
|     invalidobjects := selectset( macroplan,  | 
|                                  SanityCheckGroup.astype( SanityCheckGroupMPSync ).DatabaseSyncErrorMacroPlan,  | 
|                                  invalidobject, | 
|                                  true); | 
|                                         | 
|     objcount := 0;                                    | 
|     traverse( invalidobjects, | 
|               Elements, | 
|               invalidobject, | 
|               objcount <= messagelimit ) | 
|     { | 
|       objcount := objcount + 1; | 
|       SanityCheckMessageMPSync::Create( invalidobject.SanityCheckGroupMPSync(),  | 
|                                          Translations::MPSync_SanityCheckErrorMessage( invalidobject.ObjectType(), invalidobject.NrOfError() ),  | 
|                                          true, | 
|                                          SanityCheckCategoryLevel::GetSanityCheckCategoryDataWarning() ); | 
|     } | 
|   *] | 
| } |