# CALCFIELD-query

I want to assign the value of a CALCFIELD to a variable.So i have defined a global variable with type as decimal and have writtent the code this way

BA := GLBE.CALCFIELDS(GLBE.“Budgeted amount”);

BA =Global variable with type as decimal

GLBE stands for G/L Budget Entry table

But i am getting an error saying that "Type conversion not possible"

"Decimal := Boolean"

What is the problem and can anyone gimme the exact syntax for this?

Hi Aravind.

Step one is to read the C/AL reference guide and learn the structure of programming in Navision’s C/SIDE language C/AL.

Step two is to look at the online help (F1) and lookup CALCFIELDS to see how the function is called.

Step three is to look at the code in Navision to see existing examples of how the function is used in the base application.

Don’t expect the forums to be a replacement for study and training and learning.

I agree with David about training and learning, when I started in navision there was limited training resources so the way I learnt was to look for some example code, being hands on suited my learning better, and the answer to your question is to calculate and then assign.

GLBE.CALCFIELDS(“Budgeted amount”);

BA := GLBE.“Budgeted amount”;

David

Hi David,

I totally agree what you have suggested me.

But without much of training,i was placed with a client alone.So,sometimes i don’t get time to practice and then give them solutions.They demand instant solutions,in that case i will seek for some expert help.

So i have requested for help.

[:^)] Someone has done something very wrong here - placing you, without training (experience?), with a customer that demand instant solutions from you??
Oh my! [:’(]

F1 (C/Side Reference Guide) as David suggested would have given you the answer. I don’t understand why no one wants to read anymore [:(] … Its sad.

CALCFIELDS(Field);

DecimalVar := Field; //Calculated.