Giter VIP home page Giter VIP logo

Comments (5)

mrlannigan avatar mrlannigan commented on July 22, 2024

What is the JSON used to generate this structure?

from intacct-api.

jpiepkow avatar jpiepkow commented on July 22, 2024
customfields: [{
        customfield: {
            customfieldname: 'DELIVERY_UNITS',
            customfieldvalue: 'impressions'
        }
    },
    {
        customfield: {
            customfieldname: 'DELIVERY_AMOUNT',
            customfieldvalue: '1000'
        }
    }
]

from intacct-api.

mrlannigan avatar mrlannigan commented on July 22, 2024

What do you get if you try this:

customfields: [{
    customfield: [{
            customfieldname: 'DELIVERY_UNITS',
            customfieldvalue: 'impressions'
        },
        {
            customfieldname: 'DELIVERY_AMOUNT',
            customfieldvalue: '1000'
        }
    ]
}]

from intacct-api.

jpiepkow avatar jpiepkow commented on July 22, 2024

Screen Shot 2019-04-25 at 11 20 35 AM

from intacct-api.

mrlannigan avatar mrlannigan commented on July 22, 2024

Maybe you have changes locally because I did a fresh install from NPM with this script and got the right output:

const intacctAPI = require('intacct-api');
const xmlbuilder = require('xmlbuilder');

const cid1 = new intacctAPI.ControlFunction('create_invoice', {
    customerid: 'C99999',
    datecreated: {
        year: '2019',
        month: '04',
        day: '12',
    },
    invoiceitems: [{
        lineitem: {
            accountlabel: '4000',
            amount: '99999.99',
            customfields: [{
                customfield: [{
                    customfieldname: 'DELIVERY_UNITS',
                    customfieldvalue: 'impressions'
                }, {
                    customfieldname: 'DELIVERY_AMOUNT',
                    customfieldvalue: '1000'
                }]
            }],
            projectid: 'IP99999999'
        }
    }]
});

const root = xmlbuilder.create('request', {
    version: '1.0',
    encoding: 'UTF-8',
    standalone: true
});

console.log(cid1.toXML(root).toString());

and got this output:

<function controlid="7c1a36e0-6778-11e9-9269-81b11967ec15">
   <create_invoice>
      <customerid>C99999</customerid>
      <datecreated>
         <year>2019</year>
         <month>04</month>
         <day>12</day>
      </datecreated>
      <invoiceitems>
         <lineitem>
            <accountlabel>4000</accountlabel>
            <amount>99999.99</amount>
            <customfields>
               <customfield>
                  <customfieldname>DELIVERY_UNITS</customfieldname>
                  <customfieldvalue>impressions</customfieldvalue>
               </customfield>
               <customfield>
                  <customfieldname>DELIVERY_AMOUNT</customfieldname>
                  <customfieldvalue>1000</customfieldvalue>
               </customfield>
            </customfields>
            <projectid>IP99999999</projectid>
         </lineitem>
      </invoiceitems>
   </create_invoice>
</function>

from intacct-api.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.