Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Add file to Change order

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
meck
434 Views, 4 Replies

Add file to Change order

I have the change order and the file, but I can't figure out how to add the file to the change order. Do I do it through the DocumentService of the file, or the ChangeOrderService? I have the ID of both, just can't tie them together. Also is there a way to specify the file to be added to the Records or the File tab.

 

Thanks

Mike Eck
Master Drafter/ CAD Programmer
Using Inventor 2018
4 REPLIES 4
Message 2 of 5
minkd
in reply to: meck

The method to do all the above is the UpdateChangeOrder method. I believe you first have to call EditChangeOrder and then you supply what changes to make to the UpdateChangeOrder method. You add file records via the addFileMasterIds array parameter, and you add file attachments to the files tab via the addAttmtMasterIds array parameter. -Dave


Dave Mink
Fusion Lifecycle
Autodesk, Inc.
Message 3 of 5
meck
in reply to: meck

I'm not sure if I can use Nothing in these arguments, but either way I get an error 109 when I run this code...

 

Dim Files(0) As Long

Files(0) = FileID

 

Dim ECO As ChangeOrder = mgr.ChangeOrderService.GetChangeOrderByNumber(ECONo)

ECO = mgr.ChangeOrderService.UpdateChangeOrder(ECO.Id, ECO.Num, ECO.Title, ECO.Descr, ECO.Deadline, Nothing, Nothing, _

                                                                 Files, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing)

Mike Eck
Master Drafter/ CAD Programmer
Using Inventor 2018
Message 4 of 5
minkd
in reply to: meck

Error code 109 means database error. What does the server vlog say about it? -Dave


Dave Mink
Fusion Lifecycle
Autodesk, Inc.
Message 5 of 5
meck
in reply to: minkd

I found the problem. I forgot to open the ECO for editing. This fixed the problem...

ECO = mgr.ChangeOrderService.EditChangeOrder(ECO.Id)

Mike Eck
Master Drafter/ CAD Programmer
Using Inventor 2018

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report