Report - OnPostReport() AddDimVal('SEGMENT', '2300', 'QSR', 3); AddDimVal('SEGMENT','2399','QSR Total',4); AddDimVal('END-USER-SEGMENT','2300','QSR',3); AddDimVal('END-USER-SEGMENT','2399','QSR Total',4); AddDimVal(VAR DimCode : Code[20];VAR ValCode : Code[20];VAR Name : Text[50];VAR Type : Option) DimVal.INIT; DimVal."Dimension Code" := DimCode; DimVal.Code := ValCode; DimVal.Name := Name; DimVal."Dimension Value Type" := Type; IF NOT DimVal.INSERT(TRUE) THEN MESSAGE('Dimension Value with\Dimension Code=%1\Code=%2\aready exists', DimVal."Dimension Code", DimVal.Code); CLEAR(DimVal);
Answers
Since it is reference, it is expecting an actual CODE variable, and 'Text' always defaults to text. Since those values don't change inside the function, they should be passed by value instead.
My Blog - nav.education
Thanks for the quick and correct help!
Sorry could you mind to tell me how to pass by parameters and by values in C/AL.
I am reading the documentation, but there is no sample.
How am I supposed to know just from the following guide. It only explains the meaning of pass by value and reference in general programming language. I know that !! But what is the syntax in CAL.
VAR indicates passed by reference
(without VAR) indicates passed by VALUE..
#-o