Issues loading credit note via sdk where line item needs to be a GL Account item

SUGGESTED

hi There

Looking for some help here on loading a credit note where some lines are inventory items and others need to be loaded as GL Account entries. 

We have been in touch with SAGE sdk support who sent us this:

            //Order detail for stock Line

            OrderDetail OD = new OrderDetail();

            CN.Detail.Add(OD);

            //Vaious Order Detail properties can be added like warehouse , sales reps , userfields etc

            OD.InventoryItem = new InventoryItem("ItemA");//Use the inventoryItem constructor to specify a Item

            OD.Quantity = 10;

            OD.ToProcess = OD.Quantity;

            OD.UnitSellingPrice = 20;

 

            //Order detail for GL Line

            OD = new OrderDetail();

            CN.Detail.Add(OD);

            OD.GLAccount = new GLAccount("Accounting Fees");//Use the GLAccount Item constructor to specify a Account

            OD.Quantity = 1;

            OD.ToProcess = OD.Quantity;

            OD.UnitSellingPrice = 30;

However when we try this we are getting an error to say that the GLAccount line needs to be loaded to an inventory item?

Failed : Inventory document detail record has to be assigned to an inventory document before specifying a general ledger account..

Any idea how to navigate this issue?