Calculate 2fields from 2tables

kralykraly Member Posts: 14
edited 2006-12-06 in Dynamics AX
I have 2 tables where I need to get the field value then make a calculation of it and print it as a variable in report.

How can I do it? Sorry that I'm new. I don't even know the method I should create to be place in the report > Method or Report> Design>Method.

As I see the example, the coding is too long. I still puzzle of the usage of this term: init, fetch and run. How do I utilize this method? and what is a query for? How come some query is in the fetch() method.

During school time, I've learned init fetch and run is how the applet life cycle. But I just don't get how it work here.

I even go through the chm file, I have come across the display method, but how do I use it if I want to pass two fields from two tables. Errors keep prompt up saying syntax errors.

I really need help. Thanks in advance.
Noob in everything especially in Axapta.
Moving towards, start to understand about Axapta.
Live with Axapta and nothing else for my life atm..

Comments

  • kjærsgaardkjærsgaard Member Posts: 11
    Maybe you could come up with the details about the fields and the tables. It would be a help.
    Best regards
    Lars
  • kashperukkashperuk Member Posts: 53
    Display methods don't take arguments, so you need to create them where both variables you need to calculate on are accesible.

    For example, if you were showing the LineAmount of a SalesOrder Line, you could create a display Method on the SalesLine table and post code like this there:
    display LineAmount lineAmountMy()
    {
        return this.PurchQty * this.PurchPrice; //discounts are not inclduded in this example
    }
    

    So you see, using 2 variables we calculated the lineAmount. And we can put this method on a control in report.

    If you provide more info on your specific task, maybe we will be able to help you more
    Vanya Kashperuk,
    My blog - http://kashperuk.blogspot.com
    MorphX IT in Russian - http://www.lulu.com/content/723888
    Inside Dynamics AX 4.0 in Russian - http://www.ozon.ru/context/detail/id/3714582
  • kralykraly Member Posts: 14
    thanks a lot for the help.
    i get the idea already. :P
    Noob in everything especially in Axapta.
    Moving towards, start to understand about Axapta.
    Live with Axapta and nothing else for my life atm..
Sign In or Register to comment.