Quintiq file version 2.0 
 | 
#parent: #root 
 | 
StaticMethod CanEdit ( 
 | 
  output String feedback_o, 
 | 
  Unit unit, 
 | 
  CampaignType_MP fromcampaigntype, 
 | 
  CampaignType_MP tocampaigntype 
 | 
) declarative remote as Boolean 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    // Validate input for TransitionType_MP 
 | 
    feedback_o := ''; 
 | 
     
 | 
    // Check if unit is null 
 | 
    if( isnull( unit ) ) 
 | 
    { 
 | 
      feedback_o := Translations::MP_TransitionType_ValidateInput_IsNullUnit() ; 
 | 
    } 
 | 
    // Check if from/to campaign type is null 
 | 
    else if( isnull( fromcampaigntype ) or isnull( tocampaigntype ) ) 
 | 
    { 
 | 
      feedback_o := Translations::MP_TransitionType_ValidateInput_IsNullFromToCampaignType() ; 
 | 
    } 
 | 
    // Check if from & to campaign type has different UnitID 
 | 
    else if( fromcampaigntype.UnitID() <> tocampaigntype.UnitID() ) 
 | 
    { 
 | 
      feedback_o := Translations::MP_TransitionType_ValidateInput_IsDifferentUnit(); 
 | 
    } 
 | 
    // Check if from & to campaign type is the same campaign type 
 | 
    else if( fromcampaigntype = tocampaigntype ) 
 | 
    { 
 | 
      feedback_o := Translations::MP_TransitionType_ValidateInput_HasSameFromToCampaignTypes(); 
 | 
    } 
 | 
     
 | 
    return feedback_o.Length() = 0; 
 | 
  *] 
 | 
} 
 |