खोज…


परिचय

यह विषय स्क्रीन-आधारित एपीआई के माध्यम से एक्यूमैटिक ईआरपी से रिकॉर्ड निर्यात करने का तरीका प्रदर्शित करेगा। Acumatica ERP का स्क्रीन-आधारित API केवल SOAP इंटरफ़ेस प्रदान करता है। यदि आपके विकास प्लेटफ़ॉर्म में SOAP वेब सेवाओं के लिए सीमित समर्थन है, तो अनुबंध आधारित API पर विचार करें जो SOAP और REST दोनों इंटरफेस प्रदान करता है। स्क्रीन-आधारित API के बारे में अधिक जानकारी के लिए, Acumatica ERP प्रलेखन देखें

टिप्पणियों

इस विषय में प्रदान किए गए सभी नमूने स्क्रीन-आधारित एपीआई आवरण के साथ बनाए गए थे। यदि आप चाहते हैं कि आपका क्लाइंट एप्लिकेशन Acumatica ERP एप्लिकेशन में UI परिवर्तनों पर निर्भर न हो, तो आपको स्क्रीन-आधारित API आवरण का उपयोग करना चाहिए, जिसे Acumatica ERP दस्तावेज़ीकरण में वर्णित किया गया है

एकल प्राथमिक कुंजी के साथ प्रवेश फार्म से डेटा निर्यात

स्टॉक आइटम स्क्रीन (IN.20.25.00) डेटा निर्यात करने के लिए एक्यूमैटिक ईआरपी के सबसे अधिक बार उपयोग किए जाने वाले डेटा प्रविष्टि रूपों में से एक है। स्टॉक आइटम स्क्रीन पर इन्वेंट्री आईडी एकमात्र प्राथमिक कुंजी है: यहाँ छवि विवरण दर्ज करें

डेटा एंट्री फॉर्म से रिकॉर्ड निर्यात करने के लिए, आपका SOAP अनुरोध हमेशा ServiceCommands.Every[Key] कमांड से शुरू होना चाहिए, जहां [Key] को प्राथमिक कुंजी नाम से प्रतिस्थापित किया जाना है।

एकल वेब सेवा कॉल में सभी स्टॉक आइटम निर्यात करने के लिए:

Screen context = new Screen();
context.CookieContainer = new System.Net.CookieContainer();
context.Url = "http://localhost/AcumaticaERP/Soap/IN202500.asmx";
context.Login(username, password);
try
{
    Content stockItemsSchema = PX.Soap.Helper.GetSchema<Content>(context);
    Field lastModifiedField = new Field
    {
        ObjectName = stockItemsSchema.StockItemSummary.InventoryID.ObjectName,
        FieldName = "LastModifiedDateTime"
    };
    var commands = new Command[]
    {
        stockItemsSchema.StockItemSummary.ServiceCommands.EveryInventoryID,
        stockItemsSchema.StockItemSummary.InventoryID,
        stockItemsSchema.StockItemSummary.Description,
        stockItemsSchema.GeneralSettingsItemDefaults.ItemClass,
        stockItemsSchema.GeneralSettingsUnitOfMeasureBaseUnit.BaseUnit,
        lastModifiedField
    };
    var items = context.Export(commands, null, 0, false, false);
}
finally
{
    context.Logout();
}

किसी भी ईआरपी एप्लिकेशन में समय की मात्रा के साथ आकार में वृद्धि होती है। यदि आप एक एकल वेब सेवा कॉल में अपने Acumatica ERP उदाहरण से सभी रिकॉर्ड निर्यात कर रहे हैं, तो बहुत जल्द ही आप समय-समय पर त्रुटियों को नोटिस कर सकते हैं। समयबाह्य बढ़ाना एक संभव समय है, लेकिन बहुत अच्छा दीर्घकालिक समाधान नहीं है। इस चुनौती का समाधान करने के लिए आपका सबसे अच्छा विकल्प कई रिकॉर्ड के बैचों में स्टॉक आइटम निर्यात करना है।

10 रिकॉर्ड के बैचों में स्टॉक आइटम निर्यात करने के लिए:

Screen context = new Screen();
context.CookieContainer = new System.Net.CookieContainer();
context.Url = "http://localhost/AcumaticaERP/Soap/IN202500.asmx";
context.Login(username, password);
try
{
    Content stockItemsSchema = PX.Soap.Helper.GetSchema<Content>(context);
    Field lastModifiedField = new Field
    {
        ObjectName = stockItemsSchema.StockItemSummary.InventoryID.ObjectName,
        FieldName = "LastModifiedDateTime"
    };
    var commands = new Command[]
    {
        stockItemsSchema.StockItemSummary.ServiceCommands.EveryInventoryID,
        stockItemsSchema.StockItemSummary.InventoryID,
        stockItemsSchema.StockItemSummary.Description,
        stockItemsSchema.GeneralSettingsItemDefaults.ItemClass,
        stockItemsSchema.GeneralSettingsUnitOfMeasureBaseUnit.BaseUnit,
        lastModifiedField
    };
    var items = context.Export(commands, null, 10, false, false);

    while (items.Length == 10)
    {
        var filters = new Filter[]
        {
            new Filter
            {
                Field = stockItemsSchema.StockItemSummary.InventoryID,
                Condition = FilterCondition.Greater,
                Value = items[items.Length - 1][0]
            }
        };
        items = context.Export(commands, filters, 10, false, false);
    }
}
finally
{
    context.Logout();
}

एकल कॉल दृष्टिकोण और बैचों में निर्यात के बीच 2 मुख्य अंतर हैं:

  • एक्सपोर्ट कमांड का टॉपकाउंट पैरामीटर हमेशा सिंगल कॉल अप्रोच में 0 सेट होता था

  • जब बैचों में रिकॉर्ड निर्यात करते हैं, तो एक बैच का आकार कॉन्फ़िगर किया जाता है, हालांकि अगले परिणाम सेट का अनुरोध करने के लिए फ़िल्टर सरणी द्वारा पूरक टॉपकाउंट पैरामीटर।

समग्र प्राथमिक कुंजी के साथ प्रवेश फार्म से डेटा निर्यात

बिक्री आदेश स्क्रीन (SO.30.10.00) एक समग्र प्राथमिक कुंजी के साथ डेटा प्रविष्टि फॉर्म का एक आदर्श उदाहरण है। विक्रय आदेश स्क्रीन पर प्राथमिक कुंजी ऑर्डर प्रकार और ऑर्डर संख्या द्वारा बनाई गई है: यहाँ छवि विवरण दर्ज करें

सेल्स-ऑर्डर स्क्रीन या किसी अन्य डेटा प्रविष्टि फॉर्म से डेटा को निर्यात करने के लिए अनुशंसित 2-चरण की रणनीति, स्क्रीन-आधारित प्रक्रिया के माध्यम से समग्र प्राथमिक कुंजी के साथ:

  • चरण 1 पर आप अपने Acumatica ERP एप्लिकेशन में पहले बनाए गए सभी प्रकार के आदेशों का अनुरोध करते हैं

  • दूसरा चरण स्वतंत्र रूप से या तो एकल कॉल या बैचों में प्रत्येक प्रकार के आदेशों का निर्यात करना है

सभी प्रकार के मौजूदा आदेशों का अनुरोध करने के लिए:

Screen context = new Screen();
context.CookieContainer = new System.Net.CookieContainer();
context.Url = "http://localhost/AcumaticaERP/Soap/SO301000.asmx";
context.Login(username, password);
try
{
    Content orderSchema = PX.Soap.Helper.GetSchema<Content>(context);
    var commands = new Command[]
    {
        orderSchema.OrderSummary.ServiceCommands.EveryOrderType,
        orderSchema.OrderSummary.OrderType,
    };

    var types = context.Export(commands, null, 1, false, false);
}
finally
{
    context.Logout();
}

उपरोक्त SOAP कॉल में, निर्यात कमांड के टॉपकाउंट पैरामीटर को 1 सेट करें। इस अनुरोध का उद्देश्य केवल आपके एक्यूमैटिक ईआरपी एप्लिकेशन में बनाए गए सभी प्रकार के ऑर्डर प्राप्त करना है, न कि डेटा निर्यात करना।

स्वतंत्र रूप से बैचों में प्रत्येक प्रकार के रिकॉर्ड निर्यात करने के लिए:

Screen context = new Screen();
context.CookieContainer = new System.Net.CookieContainer();
context.Url = "http://localhost/AcumaticaERP/Soap/SO301000.asmx";
context.Login(username, password);
try
{
    Content orderSchema = PX.Soap.Helper.GetSchema<Content>(context);
    var commands = new Command[]
    {
        orderSchema.OrderSummary.ServiceCommands.EveryOrderType,
        orderSchema.OrderSummary.OrderType,
    };
    var types = context.Export(commands, null, 1, false, false);

    for (int i = 0; i < types.Length; i++)
    {
        commands = new Command[]
        {
            new Value
            {
                LinkedCommand = orderSchema.OrderSummary.OrderType,
                Value = types[i][0]
            },
            orderSchema.OrderSummary.ServiceCommands.EveryOrderNbr,
            orderSchema.OrderSummary.OrderType,
            orderSchema.OrderSummary.OrderNbr,
            orderSchema.OrderSummary.Customer,
            orderSchema.OrderSummary.CustomerOrder,
            orderSchema.OrderSummary.Date,
            orderSchema.OrderSummary.OrderedQty,
            orderSchema.OrderSummary.OrderTotal
        };
        var orders = context.Export(commands, null, 100, false, false);
        while (orders.Length == 100)
        {
            var filters = new Filter[]
            {
                new Filter
                {
                    Field = orderSchema.OrderSummary.OrderNbr,
                    Condition = FilterCondition.Greater,
                    Value = orders[orders.Length - 1][1]
                }
            };
            orders = context.Export(commands, filters, 100, false, false);
        }
    }
}
finally
{
    context.Logout();
}

ऊपर का नमूना दर्शाता है कि 100 रिकॉर्ड के बैचों में एक्युमैटा ईआरपी से सभी बिक्री आदेशों को कैसे निर्यात किया जाए। प्रत्येक प्रकार के बिक्री आदेश को स्वतंत्र रूप से निर्यात करने के लिए, आपके SOAP अनुरोध को हमेशा Value कमांड के साथ शुरू करना चाहिए, जो निर्यात किए जाने वाले आदेशों के प्रकार को निर्धारित करता है। पहला मुख्य मान सेट करने के लिए उपयोग किए जाने वाले मान कमांड के बाद ServiceCommands.Every[Key] कमांड जाता है, जहां [Key] को दूसरी कुंजी के नाम से प्रतिस्थापित किया जाना है।

एक विशिष्ट प्रकार के रिकॉर्ड निर्यात करने के लिए:

यदि आपको किसी विशिष्ट प्रकार के विक्रय आदेशों को निर्यात करने की आवश्यकता है, तो आपके SOAP अनुरोध की शुरुआत में Value आदेश के साथ आदेशों के प्रकार को स्पष्ट रूप से परिभाषित करना संभव है, जिसके बाद एकल कॉल दृष्टिकोण या बैचों में निर्यात होता है।

एक कॉल में IN प्रकार के सभी बिक्री आदेश निर्यात करने के लिए:

Screen context = new Screen();
context.CookieContainer = new System.Net.CookieContainer();
context.Url = "http://localhost/AcumaticaERP/Soap/SO301000.asmx";
context.Login(username, password);
try
{
    Content orderSchema = PX.Soap.Helper.GetSchema<Content>(context);
    var commands = new Command[]
    {
        new Value
        {
            LinkedCommand = orderSchema.OrderSummary.OrderType,
            Value = "IN"
        },
        orderSchema.OrderSummary.ServiceCommands.EveryOrderNbr,
        orderSchema.OrderSummary.OrderType,
        orderSchema.OrderSummary.OrderNbr,
        orderSchema.OrderSummary.Customer,
        orderSchema.OrderSummary.CustomerOrder,
        orderSchema.OrderSummary.Date,
        orderSchema.OrderSummary.OrderedQty,
        orderSchema.OrderSummary.OrderTotal
    };
    var orders = context.Export(commands, null, 0, false, false);
}
finally
{
    context.Logout();
}


Modified text is an extract of the original Stack Overflow Documentation
के तहत लाइसेंस प्राप्त है CC BY-SA 3.0
से संबद्ध नहीं है Stack Overflow