Tables

A.  Document Master

B.  PO Master

C.  Invoice Master

 

Document Master (A) Keys

  • PO #
  • Invoice #

PO Master (B) Keys

  • PO #
  • Vendor #

Invoice Master (C) Keys

  • Invoice #
  • Vendor #

 

Join for A->B

relationship_A_to_B = relationshipMap.am_AddRelationshipMap(joinTable: TableName_B);

relationship_A_to_B.am_JoinWhere("PO #", "PO #");

               

Join for B->C

relationship_B_to_C = relationshipMap.am_AddRelationshipMap(joinTable: TableName_C, primaryTable: TableName_B);

relationship_B_to_C.am_JoinWhere("Vendor #", "Vendor #");

relationship_B_to_C.am_JoinWhere(new AB_JoinCondition(new AB_QueryField(TableName_A, "Invoice #"), "=", new AB_QueryField(TableName_C, "Invoice #"));

               

Maps for B

maps.am_AddDataMap(string.Format("{0}.[NAME OF FIELD]", TableName_B), [METADATA FOR FIELD], targetTable: TableName_B);

               

Maps for C

maps.am_AddDataMap(string.Format("{0}.[NAME OF FIELD]", TableName_C), [METADATA FOR FIELD], targetTable: TableName_C);