User:Kate Racaza/test page: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
(Replaced content with '=DRAFT=')
No edit summary
Line 1: Line 1:
=DRAFT=
=DRAFT=
VBA versions of the new tutorials.
==Upload XML File to XFRACAS==
'''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}}

Revision as of 21:26, 23 June 2016

DRAFT

VBA versions of the new tutorials.


Upload XML File to XFRACAS

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