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)

mark check box in contract class by default

(0) ShareShare
ReportReport
Posted on by

Hi,

First, I have check boxes in contract class, i want to mark these check boxes by default.

second, in the same contract, i have created by text box that had "created by" EDT, but list of created by does not appear why?, can i use another EDT or what i do?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Zain Bokhari Profile Picture
    3,208 Moderator on at

    You can do this by overriding the perPromptModifyContract() method of your controller class and assigning the desired value to the field for check box.

    Secondly, createdBy is not a field with a default lookup. You will have to write a UIBuilder class for it and Over-ride the lookup method for createdBy field so it can show you a list of users.

  • Community Member Profile Picture
    on at

    I used this code in controller class , but does not work:

    public void prePromptModifyContract()

    {

       InventoryControlReportContract    contract;

       contract=this.parmReportContract().parmRdpContract() as InventoryControlReportContract;

       contract.SalesOrder(true);

    }

  • Zain Bokhari Profile Picture
    3,208 Moderator on at

    This looks correct. Can you show me your contract class? Declaration and SalesOrder() Method?

  • Community Member Profile Picture
    on at

    //contract class declaration

    [

      DataContractAttribute,

      SysOperationGroupAttribute('Date',literalStr("Date"),'1'),

      SysOperationGroupAttribute('Creation User',literalStr("Creation User"),'2'),

      SysOperationGroupAttribute('Transactions',literalStr("Transactions"),'3')

    ]

    public class InventoryControlReportContract

    {

       CreatedDateTime          fromdate, todate;

       CreatedBy                createduser;

       boolean                  movement,transfer,salesorder,purchaseorder;

    }

    // sales order method

    [

    DataMemberAttribute("Sales Order"),

    SysOperationLabelAttribute(literalStr("Sales Order")),

    SysOperationHelpTextAttribute(literalStr("Sales Order")),

    SysOperationGroupMemberAttribute("Transactions"),

    SysOperationDisplayOrderAttribute('4')

    ]

    public boolean SalesOrder (boolean _SalesOrder = salesorder)

    {

       salesorder= _SalesOrder;

       return salesorder;

    }

  • Zain Bokhari Profile Picture
    3,208 Moderator on at

    Apparently this looks correct too. Just refresh all caches, refresh dataset on your report and re-deploy it. Run an Incremental CIL as well. :)

  • Community Member Profile Picture
    on at

    thanks very much Zain Bokhari ,

    controller class worked right, but UIBuilder when run it in menu item as object type of class, this message appear " class does not have method 'main' or is abstract or does not exist" what i do in main method of UIBuilder??

  • Suggested answer
    Zain Bokhari Profile Picture
    3,208 Moderator on at

    You cannot run the UIBuilder class directly and you don't need a main method, you will only run the controller class which will run the RDP class which calls the contract class and contract then utilizes the UIBuilderr classs. The reference for UIBuilder class is added to the contract class like this:

    [

      DataContractAttribute,

      SysOperationGroupAttribute('Date',literalStr("Date"),'1'),

      SysOperationGroupAttribute('Creation User',literalStr("Creation User"),'2'),

      SysOperationGroupAttribute('Transactions',literalStr("Transactions"),'3'),

      SysOperationContractProcessingAttribute(classStr(YourUIBuilderClassName))

    ]

    public class InventoryControlReportContract

    {

       CreatedDateTime          fromdate, todate;

       CreatedBy                createduser;

       boolean                  movement,transfer,salesorder,purchaseorder;

    }

    Please also take a look at these articles and see closely how the three classes are connected and used. You will also see which methods need to be added to UIBuilder class.

    https://community.dynamics.com/ax/b/faisalfareedaxlibrary/archive/2014/12/27/rdp-contract-ui-builder-and-controller-classes-for-ssrs-report-development

    https://mfmujahidmim.wordpress.com/2012/12/18/simple-ui-builder-class/

  • Community Member Profile Picture
    on at

    ok, i ran UIBuilder but when i ran controller the menu item run right

  • Zain Bokhari Profile Picture
    3,208 Moderator on at

    Great. Please mark the answers verified. Thanks

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