|
|
Line 1: |
Line 1: |
| {{Template:API}}
| | #REDIRECT [[API Tutorials]] |
| | |
| ==Tutorial: Upload XML file to XFRACAS==
| |
| Below is the VBA version of the [[Upload_XML_File_to_XFRACAS|tutorial]].
| |
| | |
| '''VBA'''
| |
|
| |
| {{APIPrefix|Sub}} Main()
| |
|
| |
| {{APIComment|'Connect to the Synthesis enterprise repository.}}
| |
| {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
| |
| {{APIPrefix|Call}} MyRepository.ConnectToSQLRepository({{APIString|"ServerName"}}, {{APIString|"DatabaseName"}}){{APIComment|'Replace with values for test repository.}}
| |
|
| |
| {{APIComment|'Get a list of all available XFRACAS entities.}}
| |
| {{APIPrefix|Dim}} ListOfEntities() {{APIPrefix|As}} NameIdPair
| |
| ListOfEntities = MyRepository.XFRACAS.GetAllXfracasEntities
| |
|
| |
| {{APIComment|'Select an XFRACAS entity. This example gets the first available entity in the array.}}
| |
| {{APIPrefix|Dim}} EntityID {{APIPrefix|As}} Integer
| |
| EntityID = ListOfEntities(0).ID
| |
|
| |
| {{APIComment|'Upload the XML file to the import queue of the XFRACAS entity. This code assumes that an XML file}}
| |
| {{APIComment|'called XMLData.xml contains XFRACAS incidents and is saved in the C drive.}}
| |
| {{APIPrefix|Dim}} j {{APIPrefix|As}} Integer
| |
| j = MyRepository.XFRACAS.ImportXfracasXmlFile(EntityID, XFRACASImportType_Incident, {{APIString|"C:\XMLData.xml"}}, {{APIString|"My new data"}})
| |
|
| |
| {{APIPrefix|End Sub}}
| |