Repository.Pool.AddPool: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<noinclude>{{Template:API}}{{Template:APIBreadcrumb|10|[[Repository Class|Repository]]}}</noinclude>
<noinclude>{{Template:API}}{{Template:APIBreadcrumb|10|.[[Repository Class|Repository]]}}</noinclude>


Saves a new [[CPool Class|cPool]] object to the Synthesis repository. Returns a '''Boolean''' value; when true, indicates that the spare part pool now exists in the repository.  
 
Saves a new [[CPool Class|cPool]] object to the current project. Returns a '''Boolean''' value; when true, indicates indicates a successful save.  
<noinclude>
<noinclude>
If a pool with the same name already exists in the current project, the application will automatically increment the name. For example, if "Pool1" already exists, the new pool might be renamed to "Pool2," "Pool3," etc.
== Syntax ==
== Syntax ==
''object''.'''Pool.AddPool(''pool'')'''
'''.Pool.AddPool'''(''pool'')
 
where ''object'' is a variable that represents a Repository object.
 
=== Parameters ===
=== Parameters ===
{| {{APITable}}
''pool''
|-
:The [[CPool Class|cPool]] object to be added. (Required)
|pool{{APIParam|Required}}||The [[CPool Class|cPool]] object to be added  
|}




== Example ==
== Example ==
This example creates a new spare part pool resource, and then saves it in the first available project in a Synthesis repository.
  '''VBA'''
  '''VBA'''
   
   
  {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
{{APIComment|'Add code to connect to a Synthesis repository.}}
{{APIComment|...'Add code to connect to a Synthesis repository.}}
  {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  {{APIComment|...}}
   
   
  {{APIComment|'Create a new pool. The following example creates a pool named "MyNewSpares."}}
  {{APIComment|'Create a new pool. The following example creates a pool named "MyNewSpares."}}
Line 31: Line 31:
  '''VB.NET'''
  '''VB.NET'''
   
   
  {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
{{APIComment|'Add code to connect to a Synthesis repository.}}
{{APIComment|...'Add code to connect to a Synthesis repository.}}
  {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  {{APIComment|...}}
   
   
  {{APIComment|'Create a new pool. The following example creates a pool named "MyNewSpares."}}
  {{APIComment|'Create a new pool. The following example creates a pool named "MyNewSpares."}}

Revision as of 18:52, 20 July 2015

APIWiki.png


Member of: SynthesisAPI10.Repository


Saves a new cPool object to the current project. Returns a Boolean value; when true, indicates indicates a successful save.

If a pool with the same name already exists in the current project, the application will automatically increment the name. For example, if "Pool1" already exists, the new pool might be renamed to "Pool2," "Pool3," etc.

Syntax

.Pool.AddPool(pool)

Parameters

pool

The cPool object to be added. (Required)


Example

This example creates a new spare part pool resource, and then saves it in the first available project in a Synthesis repository.

VBA

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


 'Create a new pool. The following example creates a pool named "MyNewSpares." 
 Dim NewSpares As New cPool
 NewSpares.Name = "MyNewSpares"

 'Add the new spare part pool to project #1. The spare part pool will be visible in the Synthesis repository upon refresh. 
 MyRepository.Project.SetCurrentProject(1)   
 Call MyRepository.Pool.AddPool(NewSpares)
VB.NET

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


 'Create a new pool. The following example creates a pool named "MyNewSpares." 
 Dim NewSpares As New cPool ("MyNewSpares")

 'Add the new spare part pool to project #1. The spare part pool will be visible in the Synthesis repository upon refresh. 
 MyRepository.Project.SetCurrentProject(1)   
 MyRepository.Pool.AddPool(NewSpares)