2 Replies Latest reply on Jun 11, 2018 8:38 PM by 3588477

    Validation during run time in Business Rule

    3588477

      Hi Experts,

       

      I am working on a Capex application in Hyperion Planning 11.1.2.4.0.79 version. I want to insert a validation during the run time business rule that

       

      if ( "Installation Date" < "start Date")

      then @Return ("Installation date has to be after the Start Date")

      Endif

       

      I am using the following bit of code to accomplish in the Business Rule.

       

      FIX("No Scenario", "Ship Ops", "TNoAsset", "CCLNoCompany", &vYear , {rtpPlanYear}, {rtpProgram}, {rtpLocation}, {rtpComponent}, {rtpProject} , @RELATIVE ("Shoreside Centers", 0 ) , "ACNoAnalysisCode", "No Version" )

      "BegBalance" (

      IF ("BegBalance"->"No Location"->"No Component"->"No Plan Year"->"ACenterExists" == 1)

           "CapEx Costs" = {rtpCapexCosts};

           "Q1 Costs" = {rtpQ1Costs};

           "Q2 Costs" = {rtpQ2Costs};

           "Q3 Costs" = {rtpQ3Costs};

           "OpEx Costs" = {rtpOpexCosts};

           "Installation Date" = {rtpInstallDate};

           "Start Date" = {rtpStartDate};

           "Variance Notes" = {rtpVarianceNotes};

             IF ( {rtpInstallDate} < {rtpStartDate} ) 

                                  @RETURN ("Installation Date has to be after Start Date", ERROR) ;

             ENDIF

      ENDIF  )

      ENDFIX

       

      Now even the check is returned when the Start Date > Installation Date, but still the record is added. How can i prevent the record from being added in first place when the condition {rtpInstallDate} < {rtpStartDate} is satisfied?

      Any ideas or suggestions would be greatly helpful!

       

      Thanks,

      Pete`

        • 1. Re: Validation during run time in Business Rule
          adnan645

          Do you think it's different issue than you raised before?

           

          Compare two dates in Hyperion Planning On Prem

          • 2. Re: Validation during run time in Business Rule
            3588477

            Hi Adnan,

             

            Yeah, it's little bit different. Thanks again for helping me with the earlier question. In this case, if the "Installation date" < "start date" then the data in the run time prompt shouldn't be saved in the form. I was thinking and the solution came out to be simple.

            The following code helped:

             

            VAR _ValidDate = 0;

             

            FIX("No Scenario", "Ship Ops", "TNoAsset", "CCLNoCompany", &vYear , {rtpPlanYear}, {rtpProgram}, {rtpLocation}, {rtpComponent}, {rtpProject} , @RELATIVE ("Shoreside Centers", 0 ) , "ACNoAnalysisCode", "No Version" )

            "BegBalance" (

            IF ("BegBalance"->"No Location"->"No Component"->"No Plan Year"->"ACenterExists" == 1)

                    

                   IF ( {rtpInstallDate} < {rtpStartDate} )

                                        @RETURN ("Installation Date has to be after Start Date", ERROR) ;

                                          _ValidDate = 0;

                   ENDIF

                    _ValidaDate = 1;

             

            ENDIF  )

            "BegBalance" (

                 IF ("BegBalance"->"No Location"->"No Component"->"No Plan Year"->"ACenterExists" == 1 AND _ValidDate  == 1 )

                      "CapEx Costs" = {rtpCapexCosts};

                      "Q1 Costs" = {rtpQ1Costs};

                      "Q2 Costs" = {rtpQ2Costs};

                      "Q3 Costs" = {rtpQ3Costs};

                      "OpEx Costs" = {rtpOpexCosts};

                      "Installation Date" = {rtpInstallDate};

                      "Start Date" = {rtpStartDate};

                      "Variance Notes" = {rtpVarianceNotes};

                 ENDIF

            )

            ENDFIX