How do I get the order lines to populate an Invoice/Shipment using BOI with C# when I set the order number?

I am working with an integration that was previously working (nothing was changed in the code).

An order is created in Sage 100, and I then go to set the SalesOrderNo as part of a new Invoice/Shipment in code, and this should load in the line items from Sage into the object. However, when I check the object after this step, nothing is populated from the sales order in Sage.

Is there anything else I should be doing first, or does anyone know what steps need to be taken or what needs to be set to get the order info to load into the new Invoice/Shipment?

Thanks