Repository.Xfmea.AddXfmeaEffect Method

From ReliaWiki
Revision as of 16:10, 8 April 2016 by Kate Racaza (talk | contribs)
Jump to navigation Jump to search
APIWiki.png


Member of: SynthesisAPI.Repository


Adds a new effect to a failure. Returns a Boolean value; when true, indicates a successful save.

Syntax

.Xfmea.AddXfmeaEffect(Effect, FailureID)

Parameters

Effect

Required. The XfmeaEffect object to be added.

FailureID

Required. Integer. The record ID of the parent FMEA failure.


Example

This example assumes that FMEAs exist in a repository. It creates a new effect, and then saves it to one of the failures 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 effect. The following code creates a effect described as "No light, potential injury to user." 
  Dim AEffect As New XfmeaEffect
  AEffect.Dsc = "No light, potential injury to user"

 'Add the new effect to failure #1 located in project #1. 
  MyRepository.Project.SetCurrentProject(1)
  Call MyRepository.Xfmea.AddXfmeaEffect(AEffect,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 effect. The following code creates a effect described as "No light, potential injury to user." 
  Dim AEffect As New XfmeaEffect
  AEffect.Dsc = "No light, potential injury to user"

 'Add the new effect to failure #1 located in project #1. 
  MyRepository.Project.SetCurrentProject(1)
  MyRepository.Xfmea.AddXfmeaEffect(AEffect,1)