mapping different fields with the same EDT from different tables to each other.
Please click here for better example
For example let's that you have an a customer Table and a vendors table and
you want to fill in the fields of a new table from these tables.
If maps did not exist you would have to do this in your new table:
void initFromCustTable(CustTable _custTable)
{
this.AccountNum = _custTable.AccountNum;
this.Name = _custTable.Name;
this.country = _custTable.Country;
this.language = _custTable.Language;
}
AND
void initFromCustTable(VendTable _vendable)
{
this.AccountNum = _vendable.AccountNum;
this.Name = _vendable.Name;
this.country = _vendable.Country;
this.language = _vendable.Language;
}
BUT
if you use a map (mapping newTable, CustTable and Vendor) all you need is
this:
void initFromCustVendMap(CustVendMap _custVendMap)
{
this.AccountNum = _custVendMap.AccountNum;
this.Name = _custVendMap.Name;
this.country = _custVendMap.Country;
this.language = _custVendMap.Language;
}
ONLY once on the map and then you just call the same method with different
buffers:
this.initFromCustVendMap(YourCustTableBuffer);
this.initFromCustVendMap(YOurVendTableBuffer); // NOTE same method but
different buffer.
for more info visit:
http://msdn.microsoft.com/en-us/library/bb278211(AX.10).aspx
This blog is for Dynamics AX (AXAPTA) Developers,this will help you for your development issues. This site contains some Microsoft Dynamics AX X++ Codes for use in your day to day use.
Subscribe to:
Post Comments (Atom)
Ledger Voucher creation Framework and x++ code to create ledger voucher
Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension-...
-
{ "Message" : "Please verify that the user is valid and set up correctly." } Sol: System Administration > Se...
-
Please click here to access Custom Workflow step by step process:
-
FormRun formRun = sender.formRun(); Object inventTrans_ds = formRun.dataSource(formDataSourceStr(InventMarking,InventTransO...
Hi
ReplyDeleteNice example to understand but it'd be better if you explain little more further.
(mapping new table means....)
where to write the two methods initFromCustVendMap having two diff buffers.
I understood in which situation map is needed.But how to use the map
Could you please create the map "CustVendMap" with necessary properties like Mapping etc to understand your example better.
yes nice indeed, don't know why but Maps continue to be a more difficult concept to explain and use for productivity.
Delete