cancel
Showing results for 
Search instead for 
Did you mean: 

Change base document reference in matrix.

Former Member
0 Kudos
148

Hello.

I'm trying to use the Invoice form (133) from code to create an invoice document based on one or more sales orders.

I can fill the matrix with copies of lines from the sales orders, but I can't set the base ref on these lines. Therefore the sales order is not getting closed.

Im doing this because I don't want to create the invoice in the database without showing it to the user first.

Have anybody tried doing it this way?

Magnus

Message was edited by: Magnus Byrkjeflot

Accepted Solutions (1)

Accepted Solutions (1)

former_member185703
Active Contributor
0 Kudos

Hello Magnus,

I would maybe consider to do it as you indicated (filling the matrix...), but capture the et_ITEM_PRESSED on the "Add" button and instead save it as a draft...(see the few lines of code below); then add the real invoice through DI API...

This will of course raise the issue that you have to track the key of the draft so that you can delete it right after it had been added - there was some nice idea to use a UDF to mark the particular record!

HTH,

Frank

PS: The little piece of code I talked about above which might not be new to you...:

If pVal.FormTypeEx = "133" _

And pVal.EventType = BoEventTypes.et_ITEM_PRESSED _

And pVal.BeforeAction = True _

And pVal.ItemUID = "1" Then

BubbleEvent = False

SBO_Application.Menus.Item("5907").Activate()

End If

Answers (0)