Skip to content

Which format we need to while create setLines for Inventory Transaction Create #181

@kuldip1

Description

@kuldip1

Hi

I had just setup this SDK in my system and I start create Inventory and Inventory Transaction Create but when I use to function setLines then it will show me error.

I had create array of lines.

Below is the code for the same

$line_items =  
                array(
                    'itemid' => 'AIX-1234',
                    'warehouseid' => 'Warehouse',
                    'quantity' => 1
            );
    
    $create->setLines($line_items);

It throws me error
Fatal error: Uncaught Error: Call to a member function writeXml() on array in D:\Projects\CustomPHP\intacct\vendor\intacct\intacct-sdk-php\src\Intacct\Functions\InventoryControl\InventoryTransactionCreate.php:62 Stack trace: #0 D:\Projects\CustomPHP\intacct\vendor\intacct\intacct-sdk-php\src\Intacct\Xml\Request\OperationBlock.php(141): Intacct\Functions\InventoryControl\InventoryTransactionCreate->writeXml(Object(Intacct\Xml\XMLWriter)) #1 D:\Projects\CustomPHP\intacct\vendor\intacct\intacct-sdk-php\src\Intacct\Xml\RequestBlock.php(115): Intacct\Xml\Request\OperationBlock->writeXml(Object(Intacct\Xml\XMLWriter)) #2 D:\Projects\CustomPHP\intacct\vendor\intacct\intacct-sdk-php\src\Intacct\Xml\RequestHandler.php(144): Intacct\Xml\RequestBlock->writeXml() #3 D:\Projects\CustomPHP\intacct\vendor\intacct\intacct-sdk-php\src\Intacct\AbstractClient.php(97): Intacct\Xml\RequestHandler->executeOnline(Array) #4 D:\Projects\CustomPHP\intacct\vendor\intacct\intacct-sdk-php\src\Intacct\OnlineClient.php(36): Intacct\AbstractClient->executeOnlineRequest(Array, Object(Intacct\RequestConfig)) #5 D:\Projects\CustomPHP\intacct\crud-inventory.php(47): Intacct\OnlineClient->execute(Object(Intacct\Functions\InventoryControl\InventoryTransactionCreate)) #6 {main} thrown in D:\Projects\CustomPHP\intacct\vendor\intacct\intacct-sdk-php\src\Intacct\Functions\InventoryControl\InventoryTransactionCreate.php on line 62

Can you please guide me what we need to pass on setLines function do you have any reference or piece of code then I will check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions