Scripting

  • 1.  Hi all - another Sales Order Detail question. w

    Posted 10-17-2016 13:26
    Hi all - another Sales Order Detail question. working on a script that will bring over the user keyed in cost from the SO to the Purchase order on drop ship line items. I tried using the SO_SalesOrderDetail UnitCost field retVal = oLines.GetValue(""UnitCost"", ItemUnitCost) dbgRetVal = oScript.DebugPrint("" Sales Order Detail (unit cost) is "" & ItemUnitCost) But this always returns the cost of the item NOT the cost the user keyed in. I am firing the script on PO_PurchaseOrderHeader table Pretotals. I have the script working - in the trace window I see it fire upon clicking the Generate PO button from the SO totals tab. Problem is it always grabs the unit cost of the item - not the unit cost the user keyed in on the SO detail. I tried multiplying the cost by 10% (eg. retVal = oLines.SetValue(""UnitCost"",ItemUnitCost*1.10) 'Insert purchase order detail unit cost) and my PO shows the item cost increased by 10%. So it ~appears~ that my logic is sound (the script part that writes the cost to the po) but for some reason i cant seem to get the cost the user keyed in on the Sales Order. Which field is it? I checked the SO_DropShip table and there isn't a cost field there. Any ideas where to get that drop ship unit cost??


  • 2.  RE: Hi all - another Sales Order Detail question. w

    Posted 10-17-2016 15:06
    Does the default setting in Auto Generate PO from SO for ""Update unit cost with"" affect what happens? or ""update unit cost with SO unit cost for drop ship items


  • 3.  RE: Hi all - another Sales Order Detail question. w

    Posted 10-18-2016 07:46
    Does DFDM show the cost number you are after in SO_SalesOrderDetail.m4t ???