Upload XML File to XFRACAS/VBA

From ReliaWiki
Revision as of 15:22, 7 September 2016 by Kate Racaza (talk | contribs) (Created page with '{{Template:API}} ==Tutorial: Upload XML file to XFRACAS== Below is the VBA version of the tutorial. '''VBA''' {{APIPrefix|Sub}} Main() {{…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
APIWiki.png



Tutorial: Upload XML file to XFRACAS

Below is the VBA version of the tutorial.

VBA

Sub Main()

  'Connect to the Synthesis enterprise repository. 
   Dim MyRepository As New Repository
   Call MyRepository.ConnectToSQLRepository("ServerName", "DatabaseName") 'Replace with values for test repository. 

  'Get a list of all available XFRACAS entities. 
   Dim ListOfEntities() As NameIdPair
   ListOfEntities = MyRepository.XFRACAS.GetAllXfracasEntities

  'Select an XFRACAS entity. This example gets the first available entity in the array. 
   Dim EntityID As Integer
   EntityID = ListOfEntities(0).ID

  'Upload the XML file to the import queue of the XFRACAS entity. This code assumes that an XML file  
  'called XMLData.xml contains XFRACAS incidents and is saved in the C drive. 
   Dim j As Integer
   j = MyRepository.XFRACAS.ImportXfracasXmlFile(EntityID, XFRACASImportType_Incident, "C:\XMLData.xml", "My new data")
 
End Sub