Repository.Xfmea.AddXfmeaCause Method: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
(Created page with '{{Template:API}}{{Template:APIBreadcrumb|10|.Repository}} <onlyinclude>Adds a new cause to an FMEA effect. Returns a '''Boolean''' value; when true, indica…')
 
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Template:API}}{{Template:APIBreadcrumb|10|.[[Repository Class|Repository]]}}
{{Template:API}}{{Template:APIBreadcrumb|.[[Repository Class|Repository]]}}




<onlyinclude>Adds a new cause to an FMEA effect. Returns a '''Boolean''' value; when true, indicates a successful save. </onlyinclude>
<onlyinclude>Adds a new cause to an effect. Returns a '''Boolean''' value; when true, indicates a successful save. </onlyinclude>


==Syntax==
==Syntax==
  '''.Xfmea.AddXfmeaCause'''(''Cause'', ''EffectID'')
  '''.Xfmea.AddXfmeaCause'''(''Cause'', ''EffectID'', ''FailureID'')


===Parameters===
===Parameters===
''Cause''
''Cause''
:Required. The [[XfmeaCause Class|XfmeaCause]] object to be added.
:Required. The [[XfmeaCause Class|XfmeaCause]] object that represents the cause to be added.


''EffectID''
''EffectID''
:Required. Integer. The record ID of FMEA effect to add the cause to.  
:Required. Integer. The record ID of the parent FMEA effect.  


''FailureID''
:Required. Integer. The record ID of the parent FMEA failure.


==Example==
==Example==
This example assumes that FMEAs exist in a repository. It creates a new cause, and then saves it to one of the FMEA effects in the repository.
This example assumes that FMEAs exist in a repository. It creates a new cause, and then saves it under one of the effects in the FMEA.
 
  '''VBA'''
  '''VBA'''
   
   
  {{APIComment|'Add code to connect to a Synthesis repository.}}
  {{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
  {{APIComment|...}}
  MyRepository.ConnectToAccessRepository({{APIString|"C:\RSRepository1.rsr10"}})
 
  {{APIComment|'Create a new cause. The following code creates a new cause described as "Over pressure in lamp due to no gas."}}
  {{APIComment|'Create a new cause. The following code creates a new cause described as "Over pressure in lamp due to no gas."}}
  {{APIPrefix|Dim}} ACause {{APIPrefix|As New}} XfmeaCause
  {{APIPrefix|Dim}} ACause {{APIPrefix|As New}} XfmeaCause
  ACause.Dsc = {{APIString|"Over pressure in lamp due to no gas"}}
  ACause.Dsc = {{APIString|"Over pressure in lamp due to no gas"}}
   
   
  {{APIComment|'Add the new cause to effect #1 located in project #1.}}
  {{APIComment|'Add the new cause to project #1, under effect #2 in failure #1.}}
  MyRepository.Project.SetCurrentProject(1)
  MyRepository.Project.SetCurrentProject(1)
  {{APIPrefix|Call}} MyRepository.Xfmea.AddXfmeaCause(ACause,1)
  {{APIPrefix|Call}} MyRepository.Xfmea.AddXfmeaCause(ACause, 2, 1)


  '''VB.NET'''
  '''VB.NET'''
   
   
  {{APIComment|'Add code to connect to a Synthesis repository.}}
  {{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
  {{APIComment|...}}
  MyRepository.ConnectToAccessRepository({{APIString|"C:\RSRepository1.rsr10"}})}
 
  {{APIComment|'Create a new cause. The following code creates a new cause described as "Over pressure in lamp due to no gas."}}
  {{APIComment|'Create a new cause. The following code creates a new cause described as "Over pressure in lamp due to no gas."}}
  {{APIPrefix|Dim}} ACause {{APIPrefix|As New}} XfmeaCause
  {{APIPrefix|Dim}} ACause {{APIPrefix|As New}} XfmeaCause
  ACause.Dsc = {{APIString|"Over pressure in lamp due to no gas"}}
  ACause.Dsc = {{APIString|"Over pressure in lamp due to no gas"}}
   
   
  {{APIComment|'Add the new cause to effect #1 located in project #1.}}
  {{APIComment|'Add the new cause to project #1, under effect #2 in failure #1.}}
  MyRepository.Project.SetCurrentProject(1)
  MyRepository.Project.SetCurrentProject(1)
  MyRepository.Xfmea.AddXfmeaCause(ACause,1)
  MyRepository.Xfmea.AddXfmeaCause(ACause, 2, 1)

Latest revision as of 17:50, 9 June 2016

APIWiki.png


Member of: SynthesisAPI.Repository


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

Syntax

.Xfmea.AddXfmeaCause(Cause, EffectID, FailureID)

Parameters

Cause

Required. The XfmeaCause object that represents the cause to be added.

EffectID

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

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 cause, and then saves it under one of the effects in the FMEA.

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 cause. The following code creates a new cause described as "Over pressure in lamp due to no gas." 
  Dim ACause As New XfmeaCause
  ACause.Dsc = "Over pressure in lamp due to no gas"

 'Add the new cause to project #1, under effect #2 in failure #1. 
  MyRepository.Project.SetCurrentProject(1)
  Call MyRepository.Xfmea.AddXfmeaCause(ACause, 2, 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 cause. The following code creates a new cause described as "Over pressure in lamp due to no gas." 
  Dim ACause As New XfmeaCause
  ACause.Dsc = "Over pressure in lamp due to no gas"

 'Add the new cause to project #1, under effect #2 in failure #1. 
  MyRepository.Project.SetCurrentProject(1)
  MyRepository.Xfmea.AddXfmeaCause(ACause, 2, 1)