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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

New command button on customer form using wrong data source

(0) ShareShare
ReportReport
Posted on by

Hello!  

I'm having trouble with an extension to the CustTable form that I'm working on.  I am adding a new data source that associates customers to operating units (we call them branches) and a Tab Page under the details header tab with the Toolbar and List Pattern that includes a grid that will allow users to add any number of operating units that they would like to associate with a customer.  I've done an identical customization to the vendor form (associating operating units to vendors) that is working fine but on the customer form, my "new" command button that should add a record to my BranchCustomer grid is trying to create a new customer instead of a new row in my custom grid.  I've seen several forum posts with a similar issue and no resolutions.  I am not sure why my vendor solution works to create a BranchVendor record but my customer solution which is nearly identical is not working and instead creates a customer record. Here's a full detail of what I have done: 

The custom table for storing branch customer associations is pretty simple.  It has an OMOperatingUnit RecId and a CustTable RecId: 

pastedimage1630701009581v5.png

The form extension adds the above table as a data source, joined to CustTable, using a Delayed link type: 

pastedimage1630700430100v2.png

I've added a tab page using the toolbar and list pattern: 

pastedimage1630700714968v3.png

The data source is decorated on each object up down to the button group.  Here's the add branch command button: 

pastedimage1630700859618v4.png

When I click the add branch button, it tries to create a new customer.  I've used an identical solution for branch vendor associations and it's working great.  Any idea why it wouldn't work for customers?  

I have the same question (0)
  • ergun sahin Profile Picture
    8,824 Moderator on at
    RE: New command button on customer form using wrong data source

    Not sure if 365 has it but we used to use getPosition/setPosition in the past. You can try your luck.

  • Greg's Mom Profile Picture
    on at
    RE: New command button on customer form using wrong data source

    Thanks for the suggestion, Andre.  I did confirm and set the data source at each level and it didn't seem to make a difference.  

    I tried working around it by removing the command from the button and adding an event handler on the button click method and calling the create method of my BranchCustomer data source.  This works to generate a record in my grid but for some reason it makes the screen scroll to the top of the form.  I'm looking now at how i can set focus into the grid on the new row that I created

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    299,022 Super User 2025 Season 2 on at
    RE: New command button on customer form using wrong data source

    Hi Brawndo,

    Check the properties of your object 'BranchActionPane'. You can set a data source on this level.

  • Greg's Mom Profile Picture
    on at
    RE: New command button on customer form using wrong data source

    Thank you Ergün.  I did confirm the data source is correct up and down the chain of controls from the branch management tab down to the branch button group.  Since command buttons do not have a data source property, there is no data source selected on the command button itself.  I hope this is something Microsoft will implement in the future to make this implementation more straight forward.  I wonder what I'm missing as to why Microsoft has implemented command buttons without a data source.  Unfortunately, I'm creating an extension to the existing CustTable form which has the data source set to CustTable on the design and the New Record Action is blank.  I cannot make use of these settings as they are disabled on form extensions.  Even if I could, I don't think it would work well for the use case as it would probably break the creation of customer records if I pointed it to my custom table.  I'm very confused why my implementation works fine for vendor branches but not for customer branches as the configuration for the tables and form properties are identical:

    pastedimage1631026190970v2.png

    Somehow it's working fine for vendors
    pastedimage1631026232123v3.png

  • Suggested answer
    ergun sahin Profile Picture
    8,824 Moderator on at
    RE: New command button on customer form using wrong data source

    First check the dataSource properties of the new objects. Select your own dataSource if it is empty or incorrect.

    If this does not solve your problem, check the "new record action" properties.

    docs.microsoft.com/.../system-defined-buttons

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,206

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 847 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 596 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans