Hello below is the code to automatically pick AX 2009 Journal Line.

Create the following method on InventJournalTrans table.

void pickInvent(InventQty _qty = this.Qty, boolean reversePick = false)

{
tmpInventTransWMS tmpInventTransWMS;
inventTrans inventTrans;
InventMovement movement;
InventTransWMS_Pick inventTransPick;
boolean first = true;
inventTransIdSum inventTransIdSum;

;

movement = InventMovement::construct(this);

if (movement.mustBePicked())
{
while select inventTrans index hint TransIdIdx order by qty
where inventTrans.StatusReceipt == StatusReceipt::None &&
inventTrans.inventTransId == this.InventTransId &&
((!reversePick && inventTrans.StatusIssue >= StatusIssue::ReservPhysical) ||
(reversePick && inventTrans.StatusIssue == StatusIssue::Picked)) &&
inventTrans.TransChildType == InventTransChildType::None &&
inventTrans.TransChildRefId == ”

{

tmpInventTransWMS.initValue();
tmpInventTransWMS.initFromInventTrans(inventTrans);

tmpInventTransWMS.inventQty = reversePick ? inventTrans.Qty : -inventTrans.Qty;
tmpInventTransWMS.insert();

// inventTrans.updateSumUp();

first = false;
}
}

if (!first)
{

InventTransWMS_Pick::updateInvent(this,tmpInventTransWMS);
}
}

Call to the above method using InventJournalTrans.pickInvent();

Where InventJournalTrans is the record on Journal lines which needs to be picked.