Developer forum

Forum » Integration » missing extension point in BC app.

missing extension point in BC app.

Jonas Krarup Dam
Reply

Hi, 
Our ERP partner is missing some functionality in the BC app for integration. 

Currently, it is not possible to extend the code that generates the EcomManufacturers section of the XML without bypassing all and write the logic yourself.

Could you please add an event
OnAddManufacturerXmlNode(var ManufacturerNode: XmlNode, vendor: Record Vendor)


  Ala the one for Item(Product)

     OnAddProductXmlNode(var productNode: XmlNode, item: Record Item)

 

 



Thanks, Jonas


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply
This post has been marked as an answer

Hi Jonas,

the quicker way to do it is to use the already existing event that can also be used for this purpose.

There is: OnBeforeExecuteGetEcomDataRequest event, so subscribe to it and set:

stopExecution = true

and fill the "responseRootNode" xml node with the code like that (the parameter is name XmlCurrNode): 

procedure AddEcomManufacturers(XMLCurrNode: XmlNode)
    var
        XMLNewChild: XmlNode;
        vendor: Record Vendor;
        pXmlNode: XmlNode;
    begin
        XmlHelper.AddElement(XMLCurrNode, 'table', '', '', XMLNewChild);
        XmlHelper.AddAttribute(XMLNewChild, 'tableName', 'EcomManufacturers');

        if vendor.FINDSET(false, false) then begin
            repeat
                XmlHelper.AddElement(XMLNewChild, 'item', '', '', pXmlNode);
                XmlHelper.AddAttribute(pXmlNode, 'table', 'EcomManufacturers');

                XmlHelper.AddField(pXmlNode, 'ManufacturerID', vendor."No.");
                XmlHelper.AddField(pXmlNode, 'ManufacturerName', vendor.Name);
                XmlHelper.AddField(pXmlNode, 'ManufacturerAddress', vendor.Address);
                XmlHelper.AddField(pXmlNode, 'ManufacturerZipCode', vendor."Post Code");
                XmlHelper.AddField(pXmlNode, 'ManufacturerCity', vendor.City);
                XmlHelper.AddField(pXmlNode, 'ManufacturerCountry', vendor."Country/Region Code");
                XmlHelper.AddField(pXmlNode, 'ManufacturerPhone', vendor."Phone No.");
                XmlHelper.AddField(pXmlNode, 'ManufacturerFax', vendor."Fax No.");
                XmlHelper.AddField(pXmlNode, 'ManufacturerEmail', vendor."E-Mail");
                XmlHelper.AddField(pXmlNode, 'ManufacturerWeb', vendor."Home Page");
            until vendor.NEXT = 0;
        end;
    end;

BR, Dmitrij

Votes for this answer: 1

 

You must be logged in to post in the forum