# Why the FormInt64Control created by new() does not have method value?

**URL:** <https://www.dynamicsuser.net/t/why-the-formint64control-created-by-new-does-not-have-method-value/54713>\
**Category:** Developer Forum\
**Created:** [September 4, 2014, 11:29am UTC](https://www.dynamicsuser.net/t/why-the-formint64control-created-by-new-does-not-have-method-value/54713 "2014-09-04T11:29:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![boucekv](https://avatars.discourse-cdn.com/v4/letter/b/9f8e36/32.png) [@boucekv](https://www.dynamicsuser.net/u/boucekv)\
**Post date:** [September 4, 2014, 11:29am UTC](https://www.dynamicsuser.net/t/why-the-formint64control-created-by-new-does-not-have-method-value/54713/1 "2014-09-04T11:29:59Z")

</div>

I want to know why the FormInt64Control cread by new() does not have method value. For example when I run this code:

static void NewControlTest(Args \_args)

{

FormInt64Control FormInt64Control;

FormInt64Control = new FormInt64Control();

FormInt64Control.value(5);

info(FormInt64Control.valueStr());

}

it will end with:

Object object does not have have method ‘value’.

Stack trace …

When the same thing is created on existing form using existing design (in run() for example).

formInt64Control = formGroupControl.addControl(FormControlType::Int64, “”);

formInt64Control.value(5);

will run without problem. I would like to know how it is possible and how it is working behind.

|   
 |   
 |
| --- | --- |

---

<div class="post-metadata">

**Author:** ![MartinDrab](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@MartinDrab](https://www.dynamicsuser.net/u/MartinDrab)\
**Post date:** [September 4, 2014, 12:18pm UTC](https://www.dynamicsuser.net/t/why-the-formint64control-created-by-new-does-not-have-method-value/54713/2 "2014-09-04T12:18:58Z")

</div>

If you look at _Value_ property in debugger, you’ll see that it contains an _Object_ instance in the first case and a _FormInt64Control_ instance in the other cases. And _Object_ class really doesn’t have any _value()_ method.

It’s strange, without doubt, and it again shows that type control in X++ has its flaws. It seems that you should never use the constructor directly, even if it throws no error. Instead of that, create an instance by _addControl()._
