Notifications
Announcements
No record found.
Hello guys,How can I change dataSource in group control on the form from x++ code?I have got dataSource method on the group, but i dont know, how can i use it :(Anyone can help?
*This post is locked for comments
Setting the ChangeGroupMode property:
To create a change group, you use the ChangeGroupMode property of the Data Source node of the form. However, the default behavior is not to use a change group together with a form. You can use ChangeGroupMode to create a change group for any of the following types of forms:
A new form that you create in the AOT.
A form that includes date effective data.
A form with a data source where a parent table has a join relationship to a child table where the child holds a reference to the parent table. The reference can be either mandatory or optional.
Please read complete detail on : msdn.microsoft.com/.../jj129662.aspx
I havent got that property :/
I might add, that i need change the datasource of the buttonGroup in ActionPane.
Can i change it form x++ code?
I have delete button in that buttonGroup. I want to do smth like, deleting a record from dataSource which is activated. Maybe someone have any idea, how can i do that?
Thanks for your help!
Jerzy,
Doing what you are requesting may be confusing to users, however I would recommend that you create a standard button and overwrite the "clicked" method, in this method you can then detect what datasource is active and delete accordingly.
As i understand you need to get button on from and from AOT you need to change the properties to Achieve this functionality you need to set AllowUserSetup property that Specifies whether users can move controls on a form, and whether they can change control properties.
This property is also found on the design of a form. The property has the following outcomes:
1. No – users cannot customize any controls in this container.
2. Restricted– users can change properties of individual controls, but cannot move controls.
3. Yes – no restrictions on user setup.
Yes is the default value for AllowUserSetup.
Full user setup is not allowed if any of the parent containers for the control have restrictions on the user setup level.
The AllowAdd property on form data sources determines whether a user can add a new field to a form.
Probably you re right Jonathan Halland.
I though that i can change datasource in group property from x++ code, when I change TabPage. On form, I ve got two grids. First on TableTabPage, second on LinesTabPage.
Thanks for your response.
I do smth like that and thats work. Thanks for your help!
FormTabPageControl activeTabPage; ; activeTabPage = Tab.getActivePage(); if(activeTabPage.name() == "Lines") { if(RetroAllowanceLine_itp_ds.getFirst(true)) { RetroAllowanceLine_itp_ds.deleteMarked(); } else { RetroAllowanceLine_itp_ds.delete(); } } if(activeTabPage.name() == "General" || activeTabPage.name() == "Overview") { if(RetroAllowanceTable_itp_ds.getFirst(true)) { RetroAllowanceTable_itp_ds.deleteMarked(); } else { RetroAllowanceTable_itp_ds.delete(); } }
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2