Page 2 of 2

Re: SO creation dll

PostPosted: Tue Nov 12, 2019 10:16 am
by Riyaz
Yes but I get this error "Collection index must be in the range 1 to the size of the collection" at the below line

.SalesOrderHistorys(.CurrentHistoryNo).DelAddress1 = "add1"

Re: SO creation dll

PostPosted: Tue Nov 12, 2019 10:18 am
by Scott.Pearce
Message box out .CurrentHistoryNo
Message box out .SalesOrderHistorys.Count

Let's see what values they are.

Re: SO creation dll

PostPosted: Tue Nov 12, 2019 10:19 am
by Mike.Sheen
Riyaz wrote:Yes but I get this error "Collection index must be in the range 1 to the size of the collection" at the below line

.SalesOrderHistorys(.CurrentHistoryNo).DelAddress1 = "add1"


You need to provide some code we can run to get that error.

At a guess I'd say you didn't invoke the CreateNew() method after creating the sales order object from the factory - but all I can do is guess without you giving me more.

Re: SO creation dll

PostPosted: Tue Nov 12, 2019 10:45 am
by Riyaz
Thanks Mike

Yes that was spot on, I had provided the code chunk in the post, it was missing the createnew

Re: SO creation dll  Topic is solved

PostPosted: Tue Nov 12, 2019 11:04 am
by Mike.Sheen
Mike.Sheen wrote:And then, as from what I can tell, you are creating a new sales order, so you want to invoke the CreateNew() method of the SalesOrder.