Hello Experts ,
I am Writing a plugin to integrate between CRM and GP.The plugin fires when creating a product on CRM>> It should create a new product on GP with the same CRM (Part Number, Description ,Price List , ModelNumber ,... and other criteria given by CRM form).
I write down the plugin and it fires when create a new CRM product and create new GP Product
But I have 2 issue with the New GP Created Item
1- The Chart of accounts with associated with this product is Empty as it shown below
2- Although I am adding a Price list to the product but it does not appear that added correctly
eConnectType eConnect = new eConnectType();
taUpdateCreateItemRcd New_GPProduct = new taUpdateCreateItemRcd();
// Create an XML serializer object
XmlSerializer serializer = new XmlSerializer(eConnect.GetType());
// Populate elements of the taUpdateCreateItemRcd XML node object
New_GPProduct.ITEMNMBR = ProductNumber;
New_GPProduct.ITEMDESC = ItemDescription;
New_GPProduct.ITMTRKOP = (Serial_NonSerial == "Serial") ? Convert.ToInt16(2) : Convert.ToInt16(1);
New_GPProduct.TAXOPTNS = (Serial_NonSerial == "Taxable") ? Convert.ToInt16(1) : Convert.ToInt16(2);
New_GPProduct.USCATVLS_3 = ModelNumber;
New_GPProduct.Purchase_Item_Tax_Schedu = "VAT.P 14%";
New_GPProduct.ITMTSHID = "VAT.S 14%";
New_GPProduct.UOMSCHDL = "EACH";
New_GPProduct.ITMCLSCD = GP_ClassName;
New_GPProduct.USCATVLS_1 = GP_BC;
New_GPProduct.USCATVLS_2 = GP_PT;
New_GPProduct.CURRCOSTSpecified = true;
New_GPProduct.ALWBKORD = 1;
New_GPProduct.LOCNCODE = "MAIN";
New_GPProduct.UpdateIfExists = 1;
taIVCreateItemPriceListHeader ItemPrice1 = new taIVCreateItemPriceListHeader();
ItemPrice1.CURNCYID = "Z-US$";
ItemPrice1.ITEMNMBR = ProductNumber;
ItemPrice1.PRCLEVEL = "STANDARD";
ItemPrice1.UOFM = "EACH";
IVItemMasterType ivMasterType = new IVItemMasterType();
ivMasterType.taUpdateCreateItemRcd = New_GPProduct;
IVItemMasterType[] ivMasterTypeArray = { ivMasterType };
eConnect.IVItemMasterType = ivMasterTypeArray;
// Serialize the master vendor type in memory.
MemoryStream memoryStream = new MemoryStream();
XmlSerializer xmlSerializer = new XmlSerializer(eConnect.GetType());
//Serialize the eConnectType.
xmlSerializer.Serialize(memoryStream, eConnect);
//Reset the position of the memory stream to the start.
memoryStream.Position = 0;
// Create an XmlDocument from the serialized eConnectType in memory.
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(memoryStream);
memoryStream.Close();
// Call eConnect to process the XmlDocument.
eConnectMethods eConnectMethod = new eConnectMethods();
eConnectMethod.CreateEntity("String for my connectionSring", xmlDocument.OuterXml);
///////////////// Generated XML File /////////////////
<?xml version="1.0" encoding="UTF-8"?>
-<eConnect xmlns:xsi="www.w3.org/.../XMLSchema-instance" xmlns:xsd="www.w3.org/.../XMLSchema">
-<IVItemMasterType>
<eConnectProcessInfo xsi:nil="true"/>
<taRequesterTrxDisabler_Items xsi:nil="true"/>
-<taUpdateCreateItemRcd>
<ITEMNMBR>Marian3</ITEMNMBR>
<ITEMDESC>serializer.Serialize</ITEMDESC>
<ITMCLSCD>COMPATABLE </ITMCLSCD>
<ITMTSHID>VAT.S 14%</ITMTSHID>
<UOMSCHDL>EACH</UOMSCHDL>
<Purchase_Item_Tax_Schedu>VAT.P 14%</Purchase_Item_Tax_Schedu>
<CURRCOST>0</CURRCOST>
<USCATVLS_1>Katun </USCATVLS_1>
<USCATVLS_2>Toner </USCATVLS_2>
<USCATVLS_3>serializer.Serialize</USCATVLS_3>
<LOCNCODE>MAIN</LOCNCODE>
</taUpdateCreateItemRcd>
<taUpdateCreateItemCurrencyRcd_Items xsi:nil="true"/>
<taIVCreateItemPriceListLine_Items xsi:nil="true"/>
<taIVCreateItemPriceListHeader xsi:nil="true"/>
<taItemSite_Items xsi:nil="true"/>
<taCreateItemVendors_Items xsi:nil="true"/>
<taCreateKitItemRcd_Items xsi:nil="true"/>
<taCreateInternetAddresses_Items xsi:nil="true"/>
</IVItemMasterType>
</eConnect>
*This post is locked for comments