Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

Add new field Real Type at SalesLine Table

Posted on by 2,065

Dear All,

i have some question for adding new field at some table.

Previously i had add string type to table salesline, once added to salesline form and i edit sales line, this field typeable.

later, when i add real type to table salesline, once added to salesline form and i edit sales line, this field is not typeable, i had try several real field using extendedtype same as unitprice/qty field, but those added new field still not typeable.

Please help to inform , is there any location/class where i can write some code to make this field typeable.

Please help.

Any advice would be nice.

Thank you.

  • benjamin84 Profile Picture
    benjamin84 2,065 on at
    RE: Add new field Real Type at SalesLine Table

    Appreciate your help Ergun, already solved my hurdle.

    thank you.

  • benjamin84 Profile Picture
    benjamin84 2,065 on at
    RE: Add new field Real Type at SalesLine Table

    Hi Ergun,

    well noted, will checked this enable field first at code.

    will back again later. appreciate your advice.

    thanks

  • benjamin84 Profile Picture
    benjamin84 2,065 on at
    RE: Add new field Real Type at SalesLine Table

    HI Ergun,

    had create new 2 fields, i have at salesline grid and at line detail tab general, but its still not typeable.

    i copied those 2 newly fields into salestable, and its typeable, seem like there's something on salesline grid.

  • Verified answer
    ergun sahin Profile Picture
    ergun sahin 8,812 Super User on at
    RE: Add new field Real Type at SalesLine Table

    For your case, I think it's either you are putting it in different places or there's a code that works on the old field. (although it is small, there is a possibility of checking the wrong fields)

    There are several different methods for closing a field  for edit, but two different fields that are with not changed properties and codes will give the same result.

    Form datasource is completely closed to edit (it may also be done with code)

    Objects such as the group that the field is in are closed to edit (property or code).

    Datasource.Field has been closed to edit (property or code).

    Control has been closed to edit (property or code).

    Control can be used in the codes for property changes (AutoDecleration property of control must be set to yes)

    Or codes such as below can be used

    enableDSField(_salesLine.dataSource(), fieldNum(SalesLine, RemainInventFinancial), _enable && !isCWItem);

    or

    ds.object(fieldNum(SalesLine, PdsBatchAttribAutoRes)).allowEdit(allowEditAttrib);

    salesLine_ds.object(fieldNum(SalesLine, CostPrice)).allowEdit((creditNote && editCostPrice));

    The first two examples are from the salesTableForm class. The last example is from the form salesTable. In short, the code does not have to be on the form.

  • ergun sahin Profile Picture
    ergun sahin 8,812 Super User on at
    RE: Add new field Real Type at SalesLine Table

    Open two new fields (forget the old editable string field for now, open new field) and put them in the same place in the form (some objects like groups can be closed to edit, it is important to have both fields in the same place).

    Check now (It is technically not possible to have one open for edit and the other closed)

  • benjamin84 Profile Picture
    benjamin84 2,065 on at
    RE: Add new field Real Type at SalesLine Table

    HI Ergun,

    had tried create new form, drag table salesline to datasource ( no touch anything at property )

    compile, increment cil, then open my form and its typeable.

    strange why its not typeable at form salesline grid.

    is there any other location i could check ?

    Thank you

  • ergun sahin Profile Picture
    ergun sahin 8,812 Super User on at
    RE: Add new field Real Type at SalesLine Table

    Can you create new form and try change values (at least we can understand that are we have table (sql) problem or problem come from form)

  • benjamin84 Profile Picture
    benjamin84 2,065 on at
    RE: Add new field Real Type at SalesLine Table

    Hi Ergun,

    had tried both, duplicated from qtyordered and from unitprice ( since they typeable at salesline ), but still same, the created file is not typeable.

    thank you

  • ergun sahin Profile Picture
    ergun sahin 8,812 Super User on at
    RE: Add new field Real Type at SalesLine Table

    Did you add a new field or duplicate an existing field

  • benjamin84 Profile Picture
    benjamin84 2,065 on at
    RE: Add new field Real Type at SalesLine Table

    Hi Ergun,

    i never do edit in the code, i usually only add new field and personalize at form to shown it.

    only me do the customization, no one else understand X++ in my office.

    i had compile, sinchronize and increment CIL too.

    never change at table or form datasource, 

    my practice is create new field and i can use those field directly.

    if i open at table, i can it directly.

    the strange thing is : if i create string type, its typeable, but if i create real/int its not typeable when i edit data at salesline form.

    thank you

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,459 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,783 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans