cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error about apparent data type

Former Member
0 Likes
335


Hi


Building a formula which works as expected with the commented code.  When I uncomment, I was getting an error that highlights the else line at the bottom (NewBOM := "";) with a message that says "a boolean is expected here".  After playing around with semicolons and brackets, the error now says "a number is required".


Keener, less bleary eyes might see what I'm doing wrong.  I hope so.


Thanks!



whileprintingrecords;

global numbervar CurrInv;     global numbervar CurrPOS;    global numbervar CurrBOM;

global numbervar PrevInv;     global numbervar PrevPOS;    global numbervar PrevBOM;

global stringvar NewInv;      global stringvar NewPOS;     global stringvar NewBOM;

global stringvar CommTypePOS; global stringvar CommTypeInv;

global numbervar CommRatePOS; global numbervar CommRateInv;

if isnull({Commission.AROBP_A_IDINVC}) then CurrInv := 0 else CurrInv := {Commission.AROBP_A_IDINVC};

if isnull({Commission.POS_POS_NR})     then CurrPOS := 0 else CurrPOS := {Commission.POS_POS_NR};

if isnull({Commission.STKL_BOM_ID})    then CurrBOM := 0 else CurrBOM := {Commission.STKL_BOM_ID};

if CurrInv <> PrevInv

then (NewInv := "I";)

else (NewInv := "";);

if CurrInv <> PrevInv or CurrPOS <> PrevPOS

then (NewPOS := "P";)

else (NewPOS := "";);

if CurrInv <> PrevInv or CurrPOS <> PrevPOS or CurrBOM <> PrevBOM

then (NewBOM := "B";

         (if {@Flag_STKL_Alice}

          then (CommTypePOS := "";

                CommTypeInv := "ALI";

//                    (if  ({Commission.ARSAP_NAMEEMPL} = 'Bernard Ruhl'

//                       or {Commission.ARSAP_NAMEEMPL} = 'MB Building Products'

//                       or {Commission.ARSAP_NAMEEMPL} = 'Carlan Group'

//                       or {Commission.ARSAP_NAMEEMPL} = 'Gerald Fornell')

//                     then (CommRateInv := 10;)

//                     );

               );

         );

     )

else (NewBOM := "";);

PrevInv := CurrInv; PrevPOS := CurrPOS; PrevBOM := CurrBOM;

View Entire Topic
Former Member
0 Likes

Okay, found it, * not %.

Thank you everyone for your help.