web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Retail POS: Cannot bind to the property or column “INNRetail” on the DataSource. Parameter name: dataMember

(0) ShareShare
ReportReport
Posted on by

Hi,

I added for Retail POS a new field "INNRetail" in new customer form, but i got the error DataMember property: Cannot bind to the property or column “INNRetail” on the DataSource. Parameter name: dataMember.

In Visual Studio, in frmNewCustomer.Designer.cs file, i added the next code:

this.textBoxINNRetail.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bindingSource, "INNRetail", true));

The INNRetail field are created in CustTable (AX) and POS DB, but in Visual Studio, i think Customer does not have the INNRetail field. ¿Where i should declare the field in Visual Studio?

Thanks in advance.

Regards,

Jorge García

 

 

*This post is locked for comments

I have the same question (0)
  • Oksana Kovaliova Profile Picture
    3,597 on at

    Hi Jorge,

    All properties should exist in 'View Model' of customer form.

    1) Form is binded to CustomerViewModel in form constructor:

    2016_2D00_06_2D00_10_5F00_20_2D00_51_2D00_33.png


    2) ViewModel has property for each binded field:

    2016_2D00_06_2D00_10_5F00_20_2D00_51_2D00_33.png 

    2016_2D00_06_2D00_10_5F00_20_2D00_51_2D00_48.png

    3) So for your new field you need to create a new property in CustomerViewModel and implement custom logic to populate this field.
    If you need to save this field in AX, store DB on customer create/update, you also need to modify SaveCustomer method of the form.

    Regards,
    Oksana

  • Community Member Profile Picture
    on at

    Hi Oksana,

    Thanks for answer.

    In CustomerViewModel.cs, i have the method, but is wrong because this.Customer.INNRetail not find in Customer. This is the problem, i don't know how to add the new field to Customer interface.

    CustomerViewModel.png

    Best regards,

    Jorge García.

  • Verified answer
    Oksana Kovaliova Profile Picture
    3,597 on at

    Hi Jorge,

    You cannot extend standard ICustomer interface, because it's located in closed DLL (without source code).

    But you can create your new class that stores new properties and use it inside ViewModel. Please, see picture below with possible steps to implement:

    2016_2D00_06_2D00_13_5F00_21_2D00_36_2D00_00.png

    Regards,

    Oksana

  • Community Member Profile Picture
    on at

    Thank you very much Oksana,

    You are my hero!!

    Best regards,

    Jorge García

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans