How to run inventory adjustment in form customization c# code

I found some code for running an inventory adjustment in a form using c# customization code in the past but I cannot find it again. Can anyone please find the post for me that has code to do an inventory adjustment on a form customization.

Please help!!!


I found it.
Here it is.
public static void Adjust(string PartNum, string BinNum, decimal AdjustQty)
string WH = “CPMAIN”;
string primaryBin;

        InventoryQtyAdjAdapter adj = new InventoryQtyAdjAdapter(oTrans);
        string Company = ((Session)epiSession).CompanyID;
        const string ReasonCode = "PHY";//S
        string LotNum = ""; //??
        const string Reference = "PhysInvCC";
        DateTime TransDate = DateTime.Now;

        //Get from part eventually...
        string UnitOfMeasure = "EA";
        string StkUOMCode = UnitOfMeasure;
        string OnHandUOM = UnitOfMeasure;
        string PCID = "";
        Guid SysRowID = Guid.Empty;
        string PartIUM = UnitOfMeasure;
        string PartSalesUM = UnitOfMeasure;
        string ptran;

        bool multipleMatches = false;
        string question, serialWarning;
        string negact, pcmsg;
        bool reqUserInput = false;
        bool snRequired = false;

        adj.GetPartXRefInfo(ref PartNum, null, null, ref UnitOfMeasure, out serialWarning, out question, out multipleMatches); //get any xrefs

        InventoryQtyAdjDataSet iqadj = adj.GetInventoryQtyAdj(PartNum,""); //??ea?
        InventoryQtyAdjBrwDataSet ibrw = adj.GetInventoryQtyAdjBrw(PartNum, WH, out primaryBin); //used to get mainly bin info?
        adj.NegativeInventoryTest(PartNum, WH, BinNum, LotNum, "", UnitOfMeasure, 1, AdjustQty, out negact, out pcmsg);
        bool preSetOK = adj.PreSetInventoryQtyAdj(out reqUserInput);

        adj.CheckSN(PartNum, WH, out snRequired);
            iqadj.Tables[0].Rows[0]["RowMod"] = "M";
            iqadj.Tables[0].Rows[0]["ReasonCode"] = ReasonCode;
            iqadj.Tables[0].Rows[0]["BinNum"] = BinNum;
            iqadj.Tables[0].Rows[0]["AdjustQuantity"] = AdjustQty;
            iqadj.Tables[0].Rows[0]["Reference"] = Reference;

            adj.SetInventoryQtyAdj(iqadj, out ptran);