[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.axapta.programming

AxBC Classes like AxSalesTable

JimChw

12/7/2005 9:02:00 PM

Why do these classes exist? I see that they "shadow" the tables they are
named for. I believe they are used by the Business Connector or XCBL
classes. If I am not using this functionality why would these classes be
invoked? They also cache records I suppose to improve performance.
6 Answers

Mike Frank

12/8/2005 9:33:00 AM

0

Those classes are used by the Commerce Gateway, but you can also use them yourself. They are an easy
to use interface into Axapta Business logic if accessing Axapta from an external application or if
importing data.

So you could easily create a sales order with those classes like this.

static void CbsAxCreateSalesOrder(Args _args)
{
AxSalesTable axSalesTable = AxSalesTable::newValidateInput();
AxSalesLine axSalesLine = AxSalesLine::newValidateInput();
;
axSalesTable.custAccount('4000');
axSalesTable.save();

axSalesLine.AxSalesTable(axSalesTable);
axSalesLine.itemId('202001');
axSalesLine.salesQty(5);
axSalesLine.save();
}

JimChw

12/8/2005 2:57:00 PM

0

Thanks for the info. I'm having a problem where the classes are called
during normal processing. I'm not trying to do anything with the Commerce
Gateway. The logic is interferring with a mod/bugfix I'm trying to
implement. If I'm not using the Commerce Gateway, do you have any ideas on
how to disable these classes?

Mike Frank

12/8/2005 4:33:00 PM

0

In which situation exactly and which of the classes (methods) are called? AFAIK there is no way to
generally disable the use of the Ax classes.

JimChw

12/8/2005 4:49:00 PM

0

Specifically, when updating an Alt Address from a form like CompanyInfo or
CustTable, the AxAddress class gets involved. The problem I have revolves
around the zipcode lookup. When there are more than one matching zipcode
records and you select a zpcode other than the first one displayed in the
lookup, the record gets updated with the first one anyway because of the
ZipCode::find in method ZipCodeRecord. The AxBC classes further complicate
an already complicated update process. They should be "gated" with a
license/configuration key check.

Mike Frank

12/12/2005 10:20:00 AM

0

Now I can see, what you mean :-( This seems to be an SP4 bug. In SP3 no AxAdress object was created
in that situation and was able to spoil the already perfectly set address fields.

\Data Dictionary\Tables\Address\Methods\modifiedField

.....

if (formDataSourceHasMethod(this.dataSource(),classstr(AxAddress)))
{
formDataSource = this.dataSource();
axAddress = formDataSource.axAddress();
}
// SP4 code
else
{
axAddress = this.axAddress();
}
// SP4 code

.....

Maybe you should just try to deactivate this peace of code instead of trying to fix the AxAddress class.

Sorry, that I could not really help you.

Mike

JimChw

12/12/2005 2:16:00 PM

0

Thanks for your comments Mike. I'll probably deactivate the code like you've
identified.