Repository.Task.AddCorrectiveTask: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{Template:APIClass|Repository Class|Repository}}
{{Template:APIBreadcrumb|10|Repository}}
{{Template:Repository.AddCorrectiveTask.Cmt}} {{Template:BooleanReturn.Cmt}}
{{Template:API}}
==Syntax==
Saves a new [[CCorrectiveTask Class|cCorrectiveTask]] object to the Synthesis repository. Returns a '''Boolean''' value; when true, indicates that the task now exists in the repository. 
*AddCorrectiveTask( task {{APIPrefix|As}} [[cCorrectiveTask Class|cCorrectiveTask]] ){{APIPrefix| As Boolean}}


Parameters
== Syntax ==
:''task'': The [[cCorrectiveTask Class|cCorrectiveTask]] to add.
''object''.'''Task.AddCorrectiveTask(''task'')'''


== Usage Example ==
where ''object'' is a variable that represents a Repository object.
  {{APIComment|'Declare a new repository connection object.}}
 
   Dim MyRepository As New Repository
=== Parameters ===
    
{| {{APITable}}
  {{APIComment|'Connect to the Synthesis repository.}}
|-
   Dim Success As Boolean = False
|task{{APIParam|Required}}||The [[CCorrectiveTask Class|cCorrectiveTask]] object to be added.
   Success = MyRepository.ConnectToRepository("RepositoryFileNamePath")
|}
    
 
  {{APIComment|'Set a first available project as current.}}
 
   MyRepository.Project.SetCurrentProject(0)
== Example ==
'''VBA'''
  {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
{{APIComment|...'Add code to connect to a Synthesis repository.}}
  {{APIComment|'Create a new corrective task. The following example creates a corrective task named "MyNewTask".}}
   {{APIPrefix|Dim}} NewTask {{APIPrefix|As New}} cCorrectiveTask
   NewTask.Name = "MyNewTask"
  {{APIComment|'Add the new task to project #1. The task will be visible in the Synthesis repository upon refresh.}}
   MyRepository.Project.SetCurrentProject(1) 
   {{APIPrefix|Call}} MyRepository.Task.AddCorrectiveTask(NewTask)
 
'''VB.NET'''
   {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  {{APIComment|...'Add code to connect to a Synthesis repository.}}
{{APIComment|'Create a new corrective task. The following example creates a corrective task named "MyNewTask".}}
   {{APIPrefix|Dim}} NewTask {{APIPrefix|As New}} cCorrectiveTask
  NewTask.Name = "MyNewTask"
   
   
  {{APIComment|'Declare a new cCorrectiveTask.}}
  {{APIComment|'Add the new task to project #1. The task will be visible in the Synthesis repository upon refresh.}}
   Dim newCorrectiveTask As New cCorrectiveTask("NewCorrectiveTask1")
   MyRepository.Project.SetCurrentProject(1)   
 
   MyRepository.Task.AddCorrectiveTask(NewTask)
{{APIComment|'After creating the task, update the repository}}
   Dim SuccessAddCorrectiveTask As Boolean = False
   SuccessAddCorrectiveTask = MyRepository.Task.AddCorrectiveTask(newCorrectiveTask)

Revision as of 15:46, 16 July 2015

Member of: SynthesisAPI10Repository

APIWiki.png


Saves a new cCorrectiveTask object to the Synthesis repository. Returns a Boolean value; when true, indicates that the task now exists in the repository.

Syntax

object.Task.AddCorrectiveTask(task)

where object is a variable that represents a Repository object.

Parameters

Name Description
taskborder="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse; text-align: left; cellborder"
Name Status The cCorrectiveTask object to be added.


Example

VBA

 Dim MyRepository As New Repository
 ...'Add code to connect to a Synthesis repository. 

 'Create a new corrective task. The following example creates a corrective task named "MyNewTask". 
 Dim NewTask As New cCorrectiveTask
 NewTask.Name = "MyNewTask"

 'Add the new task to project #1. The task will be visible in the Synthesis repository upon refresh. 
 MyRepository.Project.SetCurrentProject(1)   
 Call MyRepository.Task.AddCorrectiveTask(NewTask)
VB.NET

 Dim MyRepository As New Repository
 ...'Add code to connect to a Synthesis repository. 

 'Create a new corrective task. The following example creates a corrective task named "MyNewTask". 
 Dim NewTask As New cCorrectiveTask
 NewTask.Name = "MyNewTask"

 'Add the new task to project #1. The task will be visible in the Synthesis repository upon refresh. 
 MyRepository.Project.SetCurrentProject(1)   
 MyRepository.Task.AddCorrectiveTask(NewTask)