AddNewService method: RCService class
Syntax
AddNewService(service_ID, instance_ID)
Description
Use the AddNewService method to instantiate and return a PTCS_SRVCONFIG:RCServiceConfig object. The object returned depends on the value of the instance_ID parameter:
-
When the instance_ID parameter is 0, the PTCS_SRVCONFIG:RCServiceConfig object represents a new related content service configuration and a new instance ID is automatically generated.
-
When the instance_ID parameter corresponds to an existing value, the PTCS_SRVCONFIG:RCServiceConfig object is instantiated from this existing configuration.
-
When either the service_ID parameter or the instance_ID parameter is invalid and does not corresponds to an existing value, Null is returned.
Parameters
| Parameter | Description |
|---|---|
|
service_ID |
Specifies a string value representing the service ID of an existing related content service definition. |
|
instance_ID |
Specifies an integer value representing the instance ID for a specific related content service configuration. |
Returns
A PTCS_SRVCONFIG:RCServiceConfig object.
Example 1
The following example demonstrates how to instantiate an RCServiceConfig object for a new service configuration:
import PTCS_SERVICE:RCService;
import PTCS_SRVCONFIG:RCServiceConfig;
Component PTCS_SERVICE:RCService &pgRFFlRcService;
&pgRFFlRcService = create PTCS_SERVICE:RCService("EMPLOYEE", "QE_NUI_RI_GBL");
Local PTCS_SRVCONFIG:RCServiceConfig &rcRFFlServConfig = &pgRFFlRcService.AddNewService("APPTEST_UTIL_SERVID", 0);
Local boolean &bRetSav = &pgRFFlRcService.Save();
Example 2
The following example demonstrates how to instantiate an RCServiceConfig object for an existing service configuration:
import PTCS_SERVICE:RCService;
import PTCS_SRVCONFIG:RCServiceConfig;
import PTCS_SRVCONFIG:RCMapFields;
Component PTCS_SERVICE:RCService &pgRFFlRcService;
Component PTCS_SRVCONFIG:RCMapFields &rcMapFields;
&pgRFFlRcService = create PTCS_SERVICE:RCService("EMPLOYEE", "QE_NUI_RI_GBL");
&pgRFFlRcService.LanguageCd = "ENG";
Local PTCS_SRVCONFIG:RCServiceConfig &rcRFFlServConfig = &pgRFFlRcService.AddNewService("APPTEST_UTIL_SERVID", 569863);
&rcMapFields = &rcRFFlServConfig.GetMapField(1);
If (&rcMapFields <> Null) Then
/* do some processing */
End-If;