EDITAR SOCIO DE NEGOCIO USANDO DI SERVER

Code with Edd

COMO EDITAR UN SOCIO DE NEGOCIO EN SAP BUSINESS ONE USANDO DI SERVER.

Socio de negocio. Estructura que debe de tener el XML que se genera para actualizar/modificar un socio de negocio en SAPB1 utilizando la librería DI Server.

public UpdateResponseBusinessPartner UpdateBusinessPartner(string SessionID, string CardCode, BusinessPartnerUpdateReq businessPartner)
{
    try
    {
        string soap_cmd = "";
        string response = "";
        string tYES = "tYES";
        string tNO = "tNO";

        soap_cmd = "<?xml version=\"1.0\" encoding=\"UTF-16\"?>";
        soap_cmd += "<env:Envelope xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\">";
        soap_cmd += "<env:Header>";
        soap_cmd += "<SessionID>" + SessionID + "</SessionID>";
        soap_cmd += "</env:Header>";
        soap_cmd += "<env:Body>";

        soap_cmd += "<dis:UpdateObject xmlns:dis=\"http://www.sap.com/SBO/DIS\">";
        soap_cmd += "<BOM>";
        soap_cmd += "<BO>";

        soap_cmd += "<AdmInfo>";
        soap_cmd += "<Object>oBusinessPartners</Object>";
        soap_cmd += "</AdmInfo>";
        soap_cmd += "<QueryParams>";
        soap_cmd += "<CardCode>" + CardCode + "</CardCode>";
        soap_cmd += "</QueryParams>";

        soap_cmd += "<BusinessPartners>";
        soap_cmd += "<row>";

        soap_cmd += "<Phone1>" + businessPartner.Phone1 + "</Phone1>";
        soap_cmd += "<Phone2>" + businessPartner.Phone2 + "</Phone2>";
        soap_cmd += "<EmailAddress>" + businessPartner.EMail + "</EmailAddress>";
        soap_cmd += "<AliasName>" + businessPartner.AliasName + "</AliasName>";
        soap_cmd += "<Industry>" + businessPartner.IndustryC + "</Industry>";

        soap_cmd += "<Properties2>" + (businessPartner.Mon == "Y" ? tYES : tNO) + "</Properties2>";
        soap_cmd += "<Properties3>" + (businessPartner.Tue == "Y" ? tYES : tNO) + "</Properties3>";
        soap_cmd += "<Properties4>" + (businessPartner.Wed == "Y" ? tYES : tNO) + "</Properties4>";
        soap_cmd += "<Properties5>" + (businessPartner.Thu == "Y" ? tYES : tNO) + "</Properties5>";
        soap_cmd += "<Properties6>" + (businessPartner.Fri == "Y" ? tYES : tNO) + "</Properties6>";
        soap_cmd += "<Properties7>" + (businessPartner.Sat == "Y" ? tYES : tNO) + "</Properties7>";

        soap_cmd += "<Properties15>" + (businessPartner.Evento == "Y" ? tYES : tNO) + "</Properties15>";
        soap_cmd += "<Properties16>" + (businessPartner.EventoAAA == "Y" ? tYES : tNO) + "</Properties16>";
        soap_cmd += "<Properties17>" + (businessPartner.Degustacion == "Y" ? tYES : tNO) + "</Properties17>";
        

        soap_cmd += "</row>";
        soap_cmd += "</BusinessPartners>";

        soap_cmd += "</BO>";
        soap_cmd += "</BOM>";
        soap_cmd += "</dis:UpdateObject>";
        soap_cmd += "</env:Body>";
        soap_cmd += "</env:Envelope>";

        response = NodeDIS.Interact(soap_cmd);

        UpdateResponseBusinessPartner res = this.xml.UpdateObjectResponse(response);

        return res;
    }
    catch (Exception ex)
    {
        return new UpdateResponseBusinessPartner { Success = false, CodeErr = 400, CardCode = null, Message = ex.Message };
    }
}

Referencia: SAP Business One SDK – Help Center

https://help.sap.com/viewer/product/SAP_BUSINESS_ONE/9.3/es-ES

.

EDITAR SOCIO DE NEGOCIO USANDO DI SERVER
Web | + posts

Full Stack Web Developer && SDK SAPB1 Developer.

Melómano, Gamer (Xbox), Comprador compulsivo de Amazon y Posiblemente con TDAH.

Scroll hacia arriba