Repository.Xfmea.AddXfmeaFailure Method: Difference between revisions
		
		
		
		Jump to navigation
		Jump to search
		
Kate Racaza (talk | contribs) mNo edit summary  | 
				Kate Racaza (talk | contribs) No edit summary  | 
				||
| (3 intermediate revisions by the same user not shown) | |||
| Line 9: | Line 9: | ||
===Parameters===  | ===Parameters===  | ||
''failure''  | ''failure''  | ||
:Required. The [[XfmeaFailure Class|XfmeaFailure]] object to be added.  | :Required. The [[XfmeaFailure Class|XfmeaFailure]] object that represents the failure to be added.  | ||
''FunctionID''  | ''FunctionID''  | ||
:Required. Integer. The record ID of FMEA function   | :Required. Integer. The record ID of parent FMEA function.    | ||
| Line 19: | Line 19: | ||
  '''VBA'''  |   '''VBA'''  | ||
  {{APIComment|'  |   {{APIComment|'Declare a new Repository object and connect to a Synthesis repository.}}  | ||
    {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository  |     {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository  | ||
   MyRepository.ConnectToAccessRepository({{APIString|"C:\RSRepository1.rsr10"}})  | |||
  {{APIComment|'Create a new failure. The following code creates a failure described as "Lamp shatters."}}  |   {{APIComment|'Create a new failure. The following code creates a failure described as "Lamp shatters."}}  | ||
   {{APIPrefix|Dim}} AFailure {{APIPrefix|As New}} XfmeaFailure  | |||
   AFailure.Dsc = {{APIString|"Lamp shatters"}}  | |||
  {{APIComment|'Add the new failure to function #1 located in project #1.}}  |   {{APIComment|'Add the new failure to FMEA function #1 located in project #1.}}  | ||
   MyRepository.Project.SetCurrentProject(1)  | |||
   {{APIPrefix|Call}} MyRepository.Xfmea.AddXfmeaFailure(AFailure,1)  | |||
  '''VB.NET'''  |   '''VB.NET'''  | ||
  {{APIComment|'  |   {{APIComment|'Declare a new Repository object and connect to a Synthesis repository.}}  | ||
    {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository  |     {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository  | ||
   MyRepository.ConnectToAccessRepository({{APIString|"C:\RSRepository1.rsr10"}})  | |||
  {{APIComment|'Create a new failure. The following code creates a failure described as "Lamp shatters."}}  |   {{APIComment|'Create a new failure. The following code creates a failure described as "Lamp shatters."}}  | ||
   {{APIPrefix|Dim}} AFailure {{APIPrefix|As New}} XfmeaFailure  | |||
   AFailure.Dsc = {{APIString|"Lamp shatters"}}  | |||
  {{APIComment|'Add the new failure to function #1 located in project #1.}}  |   {{APIComment|'Add the new failure to FMEA function #1 located in project #1.}}  | ||
   MyRepository.Project.SetCurrentProject(1)  | |||
   MyRepository.Xfmea.AddXfmeaFailure(AFailure,1)  | |||
Latest revision as of 18:53, 22 August 2016
![]()  | 
Member of:  SynthesisAPI.Repository   
Adds a new failure to an FMEA function. Returns a Boolean value; when true, indicates a successful save. 
Syntax
.Xfmea.AddXfmeaFailure(failure, FunctionID)
Parameters
failure
- Required. The XfmeaFailure object that represents the failure to be added.
 
FunctionID
- Required. Integer. The record ID of parent FMEA function.
 
Example
This example assumes that FMEAs exist in a repository. It creates a new failure, and then saves it to one of the FMEA functions in the repository.
VBA 'Declare a new Repository object and connect to a Synthesis repository. Dim MyRepository As New Repository MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr10") 'Create a new failure. The following code creates a failure described as "Lamp shatters." Dim AFailure As New XfmeaFailure AFailure.Dsc = "Lamp shatters" 'Add the new failure to FMEA function #1 located in project #1. MyRepository.Project.SetCurrentProject(1) Call MyRepository.Xfmea.AddXfmeaFailure(AFailure,1)
VB.NET 'Declare a new Repository object and connect to a Synthesis repository. Dim MyRepository As New Repository MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr10") 'Create a new failure. The following code creates a failure described as "Lamp shatters." Dim AFailure As New XfmeaFailure AFailure.Dsc = "Lamp shatters" 'Add the new failure to FMEA function #1 located in project #1. MyRepository.Project.SetCurrentProject(1) MyRepository.Xfmea.AddXfmeaFailure(AFailure,1)
