Unable to reference a function in a codeunit

twdavistwdavis Member Posts: 79
edited 2007-03-14 in Navision Attain
help! strange problem. running SQL 4.0 SP1
I am trying to reference a function (GetUnitCost) in a codeunit (SalesPrinted) from a form (Y).
The codeunit is CU313 to which I have added the function GetUnitCost which has a parameter of ItemNo and returns a Decimal value. I have compiled the CU.
I have added the codeunit (SalesPrinted) as a global variable to the form (Y). in the form code I have the following line of code:

ItemJournalLine."Unit Cost" := SalesPrinted.GetUnitCost("Item No.");

I saved the form without compiling and then came back into the form and tried to compile and it gives me the error,

"You have specified an unknown variable. GetUnitCost. Define the variable under Global C/Al symbols."

What gives?

Thanks for your input.

Comments

  • HalMdyHalMdy Member Posts: 429
    In the properties of the function (in the CU), are you sure you don't define it as "local" ?
Sign In or Register to comment.