Hi Ahmed,
 
 
There are two type of map in axapta. The first is in Data Dictionary | Maps. The second is map class.
For this problem, you should only consider the first one. Data Dictionary | Map is a table definition for the use of mapping ussually two or more tables. For example: In SalesPurchTable Map, there is SalesPurchId field and it is used to map between SalesTable.SalesId and PurchTable.PurchId.
 
If you create a method at SalesPurchTable Map (ex: void test () {}), then you can call from SalesTable table, by using :: operator.
 
SalesTable a;
;
a.SalesPurchTable::test(); //the format is: myTable.myMap::myMethod
 
If you have a method test2 at SalesTable table, then you may call it from SalesPurchTable Map. For this example, we can modifiy SalesPurchTable.test method:
 
void test()
{
    this.test2(); //this will call table method.
    //warning: Both mapped-table (SalesTable and PurchTable) should have test2 method.
}
 
So, for your problem, you can probably override validateWrite method on the tables and use a map for validating those tables in one place (at the map).
 
at MyMap Map:
public boolean validateWrite()
{
    boolean ret = false;
    //my validation
    return ret;
}
 
at MyTable1 Table and MyTable2 Table:
public boolean validateWrite()
{
    boolean ret = this.MyMap::validateWrite();
    return ret;
}
 
 
Regards,
 
Sonny Wibawa Adi


Ahmed Ibrahim <[EMAIL PROTECTED]> wrote:
Varden Morris,
Could you please brief me about the actual use of MAP. I read the help documents reg. MAP but I want to know the actual use.
 
regards
  Ahmed

Varden Morris <[EMAIL PROTECTED]> wrote:
I think the xRecord system class has methods that are common to all tables but the fact that it is a system method means that you cannot modify it. The only solution I can think of is using a MAP. In this case you will have to manually map all tables to this MAP and then use the required method(s) from the MAP in the mapped tables.
 

Varden Morris

 

J. Wray & Nephew Ltd. - Group I.S.

234 Spanish Town Road

Kingston 11, Jamaica, W.I.

 

Phone:  (876) - 923 - 6141 Ext. 2400, 2412
Fax:      (876) - 923 - 5372

Cell:      (876) - 3833566
Email:   [EMAIL PROTECTED]

            [EMAIL PROTECTED]

Take a guess <[EMAIL PROTECTED]> wrote:

Hi Guys,

Is there any way it is possible to set up global table methods in
Axapta?
E.g. validation that would have to happen when any record in any
table.

Regards,

Carsten






Sharing the knowledge on Axapta.



Do you Yahoo!?
The all-new My Yahoo! – Get yours free!

Sharing the knowledge on Axapta.



Do you Yahoo!?
The all-new My Yahoo! – Get yours free!

Sharing the knowledge on Axapta.



Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.

Sharing the knowledge on Axapta.


Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to