Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Add new field Real Type at SalesLine Table

(0) ShareShare
ReportReport
Posted on by 2,067

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,067 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,067 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,067 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,816 Moderator 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,816 Moderator 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,067 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,816 Moderator 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,067 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,816 Moderator 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,067 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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans