API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

how to set other reference when creating an Order

How can we add other reference when creating an Order?

created Jan 22, 2012 by manish
0% Accept Rate
Q 1 A 1 C 0

2 Answers

Hi manish,

You need to set the OtherReference property on the corresponding Order object (or, in SOAP terms: Call Order_SetOtherReference).

Best regards,
answered Jan 23, 2012 by Christian Estrup

Thanks for your reply..

here is my code to add set other refrence::
 $orderno = $client-Order_Create(array(debtorHandle = $newDebtorHandle))-Order_CreateResult;
        $client-Order_SetOtherReference(array('OrderHandle'=$orderno, 'value' = '84'));
        $orderline = $client-OrderLine_Create(array(orderHandle = $orderno))-OrderLine_CreateResult;
        $quantity = 1;
        $description = test desc;
        $UnitCostPrice = 80;
        $UnitNetPrice = 80;
        $netamount = $quantity * $UnitNetPrice;
          $newOrderHandle = $client-OrderLine_CreateFromData(array(data = array(
            Handle = $orderline,
            'Id'                = $orderline-Id,          
            'Number'            = $orderline-Number,
            'OrderHandle'        = $orderno,      
            'Description'        = $description,              
            'DeliveryDate'        = date('Y-m-d\TH:i:s'),
            'ProductHandle'        = $productHandle,
            'Quantity'            = $quantity,
            'UnitNetPrice'        = $UnitNetPrice,
            'DiscountAsPercent'    = 0,
            'UnitCostPrice'        = $UnitCostPrice,
            'TotalNetAmount'    =  $UnitNetPrice,
            'TotalMargin'        = 0,
            'MarginAsPercent'    = 0

But i have got a some exception warning so m not able to add
order as well as other refrence field.

Can u please check this code  let me know where is the mistake.

one thing i also want to tell u if  i do create order without refrence then it
will create but when i set otherrefrence then if
can't add orders.

Please do reply m in trouble.

answered Jan 24, 2012 by manish
Visma e-conomic A/S