Options

novice AX developer needs help!

rponslerrponsler Member Posts: 8
edited 2010-08-17 in Dynamics AX
I am very new to AX development. I have created a form with tabs. When I click each tab I want the page to be in ADD mode, not edit mode. I dont see this as a setting on the form design for the tab page, but surely it must be somewhere?

Comments

  • Options
    pedroparrapedroparra Member Posts: 58
    Hi,

    You can modify the add, edit, .. mode of the dataSources of a form using the methods SalesTable_DS.allowCreate(), .allowEdit(), allowDelete() in case the table used is SalesTable. And so on with the table you use.

    You can aso introduce code when the tab is activated overriding the tabPageActivated() method on the tab element.
  • Options
    rponslerrponsler Member Posts: 8
    Thanks, I will give that a try. Do you know any forms that use this out of the box in AX so that I can compare?
  • Options
    pedroparrapedroparra Member Posts: 58
    Hi,

    You dont have to go very far. At the SalesTable form there is a editSales method which use these methods to enable or disable the edition of sales orders.

    This can be, for example, if you have specified at the Accounts Receivable parameters that you dont want to allow the edition of invoiced sales.

    Kind Regards and I recomend a book like PackPub Microsoft Dynamics Ax 2009 getting started to have a clear picture of all this.
  • Options
    rponslerrponsler Member Posts: 8
    OK, I got to play with the allowedit, allowcreate, etc and I can see that these lines of code enable or disable the user's ability to perform these tasks. This is similiar to what I need, but not exactly. Let me explain a little more...

    I have a form with an overview tab page and another tab where the user can edit the specifics of the overview record they have selected. That all works fine, but in my case when the user is on the overview tab and clicks to goto the other tab I want that second tab to be BLANK (so in add mode) so the user is CREATING a new record and is not EDITING the one they had selected on the overview tab.....is that possible?
  • Options
    pedroparrapedroparra Member Posts: 58
    Perhaps you can override the pageActivated method of the tabPage in this way:

    public void pageActivated()
    {
    ;
    super();
    MyTable_DS.create();
    }

    This will show you a new blank record when you move to that tab page.
  • Options
    rponslerrponsler Member Posts: 8
    You are so AWESOME! Thanks for helping and sorry I am so needy. Hopefully I can get the hand of this. I took AX Dev I and II, but they are NOT this deep into detail :-) Thanks again. I appreciate your time. :D:D
Sign In or Register to comment.