The following, when placed in a job will create a SalesOrder. This should
show you exactly how to create one, and from this code you could then create
yourself a class, for processing your external Sales Orders.

      SalesTable               salesTable;
      SalesLine                salesLine;
      NumberSeq                numberSeq;
      NumberSequenceReference  numberSequenceReference;
      InventTable              InventTable;
      ;

      numberSequenceReference = NumberSeqReference::findReference
(typeId2ExtendedTypeId(typeid(SalesId))) ;
      numberSeq = NumberSeq::newGetNumFromCode
(numberSequenceReference.NumberSequence) ;

      ttsbegin;

      // Entry for Sales Header
      salesTable.SalesId = numberSeq.num() ;
      salesTable.CustAccount = "10" ;
      salesTable.initFromCustTable();
      salesTable.SalesType = SalesType::Sales ;
      salesTable.SalesStatus = SalesStatus::None ;
      salesTable.insert();

      // Entry for Sales Line
      InventTable = InventTable::find("1000");
      salesLine.initFromSalesTable(salesTable);
      salesLine.SalesId = salesTable.SalesId ;
      salesLine.ItemId = InventTable.ItemId;
      salesLine.SalesQty = 1 ;
      salesLine.createLine(false,true,true,false,false,true);
      numberSeq.used();

      ttscommit;

If you have any questions about the code please let us all know! Also
SalesAutoCreate will show you a similar thing, except it will be more
complicated... Using this to build your Class on will speed up the process.
This code works, and I am currently finishing up an ExternalOrderProcessing
Class that was based on this code.

-Brandon

-----Original Message-----
From: development-axapta@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Rolf Olsen
Sent: Friday, July 08, 2005 3:53 AM
To: development-axapta@yahoogroups.com
Subject: RE: [development-axapta] Importing external sales order


You should take a look at the SalesAutoCreate class hierarchy, that does
what you need (although you should probably make a sub class for your
specific import).

Kind regards,
Rolf

-----Original Message-----
From: development-axapta@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Zappia Alessandro
Sent: 8. juli 2005 09:38
To: development-axapta@yahoogroups.com
Subject: [development-axapta] Importing external sales order

Hello everybody!
I'd like to create an interface between axapta and an existing web site for
sales orders. These orders are passed to axapta using an ascii text file and
I should pick them up and import into axapta's SalesTable (and salesLine,
obviously!). I'd like also to replicate all the checks performed by axapta
as if the order were inserted manually, to notify possible errors. Is there
a class that helps me ot at which I should take a look?Or anyone has some
other suggestions?
Thank you all very much!



[Non-text portions of this message have been removed]






Yahoo! Groups Links











Yahoo! Groups Links











YAHOO! GROUPS LINKS




Reply via email to