2 Replies Latest reply on Apr 23, 2010 2:47 PM by JFFortier

    Bug or Miss information FMS10

    JFFortier

      Title

      Bug or Miss information FMS10

      Your post

      Hi

       

      I was not able to make it work, and didn't find it in the instruction manuel.

       

      Can we use custom fonction in FMS10 schedule script runing on the server....

       

      I don't think so.... when I enter  a normal calculation the script run OK, when I eneter a custom fcontion.... it not working and I receive an e-mail with the error report, invalid script step.

       

      FMS10v2, Windows Server 2003

       

      TY

       

      JF

        • 1. Re: Bug or Miss information FMS10
          mps1773

          Hello JFFortier,

           

          You may need to be a bit more specific. I use custom functions a great deal for a wide variety of things and have had no issues with them in scripts running server-side. What is the function? What does it do? What other functions does it call? That sort of thing. :)

           

          -Matthew Smith

          • 2. Re: Bug or Miss information FMS10
            JFFortier

            Ok so we can use custom fonction in a Server Script.

            So why it's returning me an invalid script step ??

             

            My Script step is: Insert Calculated Result [ Entretien_Data::ED_DateFin_Contrat; Let([_date=Get ( CurrentDate );firstday=Date(Month(_date);0;Year(_date)-1)+1];Date_Switch ( firstday)&"..."&Date_Switch ( DateIncrement ( Get ( CurrentDate ); "Bi-Monthly"))) ][ Select ]

             

            When pasting "1/1/10...12/12/10" the script step is working.

             

            Since the french date and the english date format are not the same dd/mm vs mm/dd when inserting a calc result, using the standard dating formula fonction in FM... it's no working.

            I also need to paste a range of date.

             

            The custom fonction Date_Switch is:

            Let ([
            _date= Substitute ( date_; "/" ; "¶" );
            mois=LeftValues(_date;1);
            jour=MiddleValues(_date;2;1);
            annee=RightValues(_date;1);
            date_ok= jour & "/" & mois & "/" & annee];

            Substitute ( date_ok; "¶" ; ""))

             

            The custom fonction DateIncrement is: (this one was very long so I try the unneeded CASE ....)

            Let (
                [
                LastDayOfStartMonth = Day ( Date ( Month ( GetAsDate ( StartDate ) ) + 1 ; 0 ; Year ( GetAsDate ( StartDate ) ) ) );

                YearOut = Year ( GetAsDate ( StartDate)  ) ;

                MonthOut =
                Case    (
                    Frequency = "Bi-Monthly" ;       Month ( GetAsDate ( StartDate ) ) + 2 ; ) ; // Close Month Case

                LastDayOfMonthOut = Day ( Date ( MonthOut + 1 ; 0 ; YearOut ) ) ;

                DayOut =
                Case    (

                    Frequency = "Bi-Monthly" ;
                    If     (
                        Day ( GetAsDate ( StartDate ) ) > LastDayOfMonthOut ;
                        LastDayOfMonthOut ;
                        
                        // Else
                        Day ( GetAsDate ( StartDate ) )
                        ) ;

             
                    ) // Close Day Case

                ] ;

            Date    (
                    MonthOut ;
                    DayOut ;
                    YearOut
                )