Home > Intercompany > Intercompany – for custom tables

Intercompany – for custom tables

If you need to create records in custom Tables using standard Intercompany Classes, then you need to make some code changes in order to extend the standard Intercompany functionality. For example if you need to create records in your custom table when an Intercompany Sales order is being created, you need to follow the steps

below :

1. Create a Axd Class for your custom table.

2. Add a field InterCompanyCompanyId in your custom table.This field will store value of company id for Intercompany which is set up under Basic—>Set up –>Application Integration Framework–>Endpoints .

3. Make changes to PurchTableType Class in interCompanyMirror method and add the following code in changecompany block  :

         axDbQuestionAnswer.parmSalesPurchId(axSalesTable.salesTable().SalesId);
         axDbQuestionAnswer.parmInterCompanyCompanyId(purchTable.InterCompanyCompanyId);
         axDbQuestionAnswer.save();
4.  Now create a Sales order in the company for which Intercompany is set up (Customer account is set up in Constraints  for related Intercompany). You should see the record is inserted in your Custom Table now 🙂

Advertisements
Categories: Intercompany
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: