RCMenuLayout Class Methods
In this section, the RCMenuLayout class methods are presented in alphabetical order.
Syntax
AddFolder(folder_lbl, folder_seqnum)
Description
Use the AddFolder method to instantiate a PTCS_MENULAYOUT:RCMenuFolder object to add a new menu folder to the menu layout.
Note: Folders cannot be created for the related content menu.
Parameters
Field or Control |
Definition |
---|---|
folder_lbl |
Specifies the label for the folder as a string value. |
folder_seqnum |
Specifies the sequence number for the folder as an integer value. |
Returns
A PTCS_MENULAYOUT:RCMenuFolder object.
Example
import PTCS_SERVICE:RCService;
import PTCS_SRVCONFIG:RCServiceConfig;
import PTCS_MENULAYOUT:RCMenuLayout;
import PTCS_MENULAYOUT:RCMenuFolder;
Component PTCS_SERVICE:RCService &rcService;
Component PTCS_SRVCONFIG:RCServiceConfig &rcServConfig;
Component PTCS_MENULAYOUT:RCMenuLayout &rcMenuLayout;
&rcServConfig = &rcService.AddNewService("MY_SERVICE", 0);
&rcMenuLayout = &rcServConfig.AddPageFieldMenu("QE_BOOK.2", "0.QE_BOOK.QE_BOOK_NAME.2");
Local PTCS_MENULAYOUT:RCMenuFolder &lclMenuFolder = &rcMenuLayout.AddFolder("CRM", 2);
Local boolean &bRet = &rcMenuLayout.Save();
Syntax
CloneForNew(&RCmenu_layout)
Description
Use the CloneForNew method to create an identical copy of the menu layout executing this method to an already instantiated PTCS_MENULAYOUT:RCMenuLayout object—for example, a standalone RCMenuLayout object, one associated with this RCServiceConfig object, or one associated with a different RCServiceConfig object.
Parameters
Field or Control |
Definition |
---|---|
&RCmenu_layout |
Specifies an already instantiated PTCS_MENULAYOUT:RCMenuLayout object that the configuration is copied to. |
Returns
A boolean value: True if the copy is successful, False otherwise.
Example
import PTCS_SERVICE:RCService;
import PTCS_SRVCONFIG:RCServiceConfig;
import PTCS_MENULAYOUT:RCMenuLayout;
import PTCS_MENULAYOUT:RCMenuFolder;
import PTCS_MENULAYOUT:RCMenuLink;
Component PTCS_SERVICE:RCService &rcService;
Component PTCS_SRVCONFIG:RCServiceConfig &rcServConfig;
Component PTCS_MENULAYOUT:RCMenuLayout &rcMenuLayout, &rcMenuLayoutNew;
Component PTCS_MENULAYOUT:RCMenuFolder &rcMenuFolder;
Component PTCS_MENULAYOUT:RCMenuLink &rcMenuLink;
&rcServConfig = &rcService.AddNewService("MY_SERVICE", 0);
&rcServConfig.IsCompService = "C";
&rcServConfig.PnlName = "";
&rcServConfig.SeqNum = 0;
&rcServConfig.HideFromSearch = "N";
&rcServConfig.IsDefault = "N";
&rcServConfig.MapSecOptions = "P";
&rcServConfig.HandlerName = "";
&rcServConfig.InstanceLbl = "CLONERCPGLT";
&rcServConfig.UrlTarget = "RCF";
&rcServConfig.MenuOpt = "Y";
&rcServConfig.MainMenuOpt = "N";
&rcServConfig.nSeqNumMmnu = 0;
&rcServConfig.nSeqNumRmnu = 0;
&rcServConfig.PackageRoot = "";
&rcServConfig.QualifyPath = "";
&rcServConfig.AppClassId = "";
&rcServConfig.cInitMin = "N";
&rcServConfig.cEnable = "Y";
&rcServConfig.SrvcOpenOpt = "";
&rcServConfig.IsEmbeddable = "";
&rcServConfig.IsSingleUOW = "";
&rcServConfig.MasterTemplate = "";
&rcServConfig.AllowPersonalization = "Y";
&rcServConfig.CompEvent = "";
&rcServConfig.ProcessSeq = "";
Local boolean &bRet1 = &rcServConfig.Save();
&rcMenuLayout = &rcServConfig.AddPageFieldMenu("", "");
&rcMenuFolder = &rcMenuLayout.AddFolder("Root", Value(&rcServConfig.SeqNum));
&rcMenuLink = &rcMenuFolder.AppendMenuLink(&rcServConfig.ServiceId, &rcServConfig.InstanceId);
Local boolean &bRet2 = &rcMenuLayout.Save();
Local boolean &bRet3 = &rcMenuLayout.CloneForNew(&rcMenuLayoutNew);
If (&bRet3) Then
/* do some processing */
Local boolean &bRet4 = &rcMenuLayoutNew.Save();
End-If;
Syntax
CloneForNewFull(&rcServiceConfig, page_fld_ID, pg_rec_fld_ID)
Description
Use the CloneForNewFull method to instantiate a new PTCS_MENULAYOUT:RCMenuLayout object associated with the specified service configuration object. The menu layout of the object executing this method is copied to the new object.
Parameters
Field or Control |
Definition |
---|---|
&rcServiceConfig |
Specifies an already instantiated PTCS_SRVCONFIG:RCServiceConfig object that this new menu layout will be associated with. |
page_fld_ID |
Specifes a string value representing the page field’s ID in the following format:
The field ID can be obtained from the Order tab of the page definition in Application Designer. For example:
|
pg_rec_fld_ID |
Specifes a string value representing the page record field’s ID in the following format:
The occurs level, record name, field name, and field ID can be obtained from the Order tab of the page definition in Application Designer. For example:
|
Returns
A PTCS_MENULAYOUT:RCMenuLayout object.
Example
import PTCS_SERVICE:RCService;
import PTCS_SRVCONFIG:RCServiceConfig;
import PTCS_MENULAYOUT:RCMenuLayout;
import PTCS_MENULAYOUT:RCMenuFolder;
import PTCS_MENULAYOUT:RCMenuLink;
Component PTCS_SERVICE:RCService &rcService;
Component PTCS_SRVCONFIG:RCServiceConfig &rcServConfig;
Component PTCS_MENULAYOUT:RCMenuLayout &rcMenuLayout, &rcMenuLayoutNew;
Component PTCS_MENULAYOUT:RCMenuFolder &rcMenuFolder;
Component PTCS_MENULAYOUT:RCMenuLink &rcMenuLink;
&rcServConfig = &rcService.AddNewService("MY_SERVICE", 0);
&rcServConfig.IsCompService = "C";
&rcServConfig.PnlName = "";
&rcServConfig.SeqNum = 0;
&rcServConfig.HideFromSearch = "N";
&rcServConfig.IsDefault = "N";
&rcServConfig.MapSecOptions = "P";
&rcServConfig.HandlerName = "";
&rcServConfig.InstanceLbl = "CLONERCPGLT";
&rcServConfig.UrlTarget = "RCF";
&rcServConfig.MenuOpt = "Y";
&rcServConfig.MainMenuOpt = "N";
&rcServConfig.nSeqNumMmnu = 0;
&rcServConfig.nSeqNumRmnu = 0;
&rcServConfig.PackageRoot = "";
&rcServConfig.QualifyPath = "";
&rcServConfig.AppClassId = "";
&rcServConfig.cInitMin = "N";
&rcServConfig.cEnable = "Y";
&rcServConfig.SrvcOpenOpt = "";
&rcServConfig.IsEmbeddable = "";
&rcServConfig.IsSingleUOW = "";
&rcServConfig.MasterTemplate = "";
&rcServConfig.AllowPersonalization = "Y";
&rcServConfig.CompEvent = "";
&rcServConfig.ProcessSeq = "";
Local boolean &bRet1 = &rcServConfig.Save();
&rcMenuLayout = &rcServConfig.AddPageFieldMenu("", "");
&rcMenuFolder = &rcMenuLayout.AddFolder("Root", Value(&rcServConfig.SeqNum));
&rcMenuLink = &rcMenuFolder.AppendMenuLink(&rcServConfig.ServiceId, &rcServConfig.InstanceId);
Local boolean &bRet2 = &rcMenuLayout.Save();
&rcMenuLayoutNew = &rcMenuLayout.CloneForNewFull(&rcServConfig, "QE_BOOK.2", "0.QE_BOOK.QE_BOOK_NAME.2");
If (&rcMenuLayoutNew <> Null) Then
/* do some processing */
End-If;
Syntax
Delete()
Description
Use the Delete method to delete the menu layout.
Parameters
None.
Returns
A boolean value: True if the delete is successful, False otherwise.
Example
import PTCS_SERVICE:RCService;
import PTCS_SRVCONFIG:RCServiceConfig;
import PTCS_MENULAYOUT:RCMenuLayout;
Component PTCS_SERVICE:RCService &rcService;
Component PTCS_SRVCONFIG:RCServiceConfig &rcServConfig;
Component PTCS_MENULAYOUT:RCMenuLayout &rcMenuLayout;
&rcServConfig = &rcService.AddNewService("MY_SERVICE", 0);
&rcMenuLayout = &rcServConfig.AddPageFieldMenu("QE_BOOK.2", "0.QE_BOOK.QE_BOOK_NAME.2");
Local boolean &bRet = &rcMenuLayout.Delete();
If (&bRet) Then
/* do some processing */
End-If;
Syntax
DeleteFolder(nItem)
Description
Use the DeleteFolder method to delete the specified menu folder from this menu layout.
Parameters
Field or Control |
Definition |
---|---|
nItem |
Specifies the menu folder as a number value. |
Returns
A boolean value: True if the delete is successful, False otherwise.
Example
import PTCS_SERVICE:RCService;
import PTCS_SRVCONFIG:RCServiceConfig;
import PTCS_MENULAYOUT:RCMenuLayout;
Component PTCS_SERVICE:RCService &rcService;
Component PTCS_SRVCONFIG:RCServiceConfig &rcServConfig;
Component PTCS_MENULAYOUT:RCMenuLayout &rcMenuLayout;
&rcServConfig = &rcService.AddNewService("MY_SERVICE", 0);
&rcMenuLayout = &rcServConfig.AddPageFieldMenu("QE_BOOK.2", "0.QE_BOOK.QE_BOOK_NAME.2");
Local boolean &bRet = &rcMenuLayout.DeleteFolder(2);
Local boolean &bRet = &rcMenuLayout.Save();
Syntax
DeleteMenuLink(service_ID, instance_ID)
Description
Use the DeleteMenuLink method to delete the specified menu link from the layout.
Parameters
Field or Control |
Definition |
---|---|
service_ID |
Specifies a string value representing the service ID for the parent related content service configuration. |
instance_ID |
Specifies an integer value representing the instance ID for the parent related content service configuration. |
Returns
A boolean value: True if the delete is successful, False otherwise.
Example
import PTCS_SERVICE:RCService;
import PTCS_SRVCONFIG:RCServiceConfig;
import PTCS_MENULAYOUT:RCMenuLayout;
import PTCS_MENULAYOUT:RCMenuLink;
Component PTCS_SERVICE:RCService &rcService;
Component PTCS_SRVCONFIG:RCServiceConfig &rcServConfig;
Component PTCS_MENULAYOUT:RCMenuLayout &rcMenuLayout;
Component PTCS_MENULAYOUT:RCMenuLink &rcMenuLink;
&rcServConfig = &rcService.AddNewService("MY_SERVICE", 0);
&rcMenuLayout = &rcServConfig.AddPageFieldMenu("QE_BOOK.2", "0.QE_BOOK.QE_BOOK_NAME.2");
If (&rcMenuLayout <> Null) Then
&bRet = &rcMenuLayout.DeleteMenuLink("MY_SERVICE", &rcServConfig.InstanceId);
If (&bRet) Then
/* do some processing */
Local boolean &bRet2 = &rcMenuLayout.Save();
End-If;
End-If;
Syntax
GetFolder(nItem)
Description
Use the GetFolder method to instantiate a PTCS_MENULAYOUT:RCMenuFolder object for the specified menu folder.
Note: Folders cannot be created for the related content menu.
Parameters
Field or Control |
Definition |
---|---|
nItem |
Specifies the menu folder as a number value. |
Returns
A PTCS_MENULAYOUT:RCMenuFolder object.
Example
import PTCS_SERVICE:RCService;
import PTCS_SRVCONFIG:RCServiceConfig;
import PTCS_MENULAYOUT:RCMenuLayout;
import PTCS_MENULAYOUT:RCMenuFolder;
Component PTCS_SERVICE:RCService &rcService;
Component PTCS_SRVCONFIG:RCServiceConfig &rcServConfig;
Component PTCS_MENULAYOUT:RCMenuLayout &rcMenuLayout;
&rcServConfig = &rcService.AddNewService("MY_SERVICE", 0);
&rcMenuLayout = &rcServConfig.AddPageFieldMenu("QE_BOOK.2", "0.QE_BOOK.QE_BOOK_NAME.2");
Local PTCS_MENULAYOUT:RCMenuFolder &lclMenuFolder = &rcMenuLayout.GetFolder(1);
Syntax
GetFolderCount()
Description
Use the GetFolderCount method to return the count of menu folders for this menu layout as a number value.
Parameters
None.
Returns
A number value.
Example
import PTCS_SERVICE:RCService;
import PTCS_SRVCONFIG:RCServiceConfig;
import PTCS_MENULAYOUT:RCMenuLayout;
Component PTCS_SERVICE:RCService &rcService;
Component PTCS_SRVCONFIG:RCServiceConfig &rcServConfig;
Component PTCS_MENULAYOUT:RCMenuLayout &rcMenuLayout;
&rcServConfig = &rcService.AddNewService("MY_SERVICE", 0);
&rcMenuLayout = &rcServConfig.AddPageFieldMenu("QE_BOOK.2", "0.QE_BOOK.QE_BOOK_NAME.2");
Local number &n, &fld_cnt;
&fld_cnt = &rcMenuLayout.GetFolderCount();
For &n = 1 To &fld_cnt
/* Do some processing */
End-For;
Syntax
GetFolderFromFolderId(folder_lbl)
Description
Use the GetFolderFromFolderId method to return a PTCS_MENULAYOUT:RCMenuFolder object representing the menu folder for the specified folder label.
Parameters
Field or Control |
Definition |
---|---|
folder_lbl |
Specifies the label for the folder as a string value. |
Returns
A PTCS_MENULAYOUT:RCMenuFolder object.
Example
import PTCS_SERVICE:RCService;
import PTCS_SRVCONFIG:RCServiceConfig;
import PTCS_MENULAYOUT:RCMenuLayout;
import PTCS_MENULAYOUT:RCMenuFolder;
Component PTCS_SERVICE:RCService &rcService;
Component PTCS_SRVCONFIG:RCServiceConfig &rcServConfig;
Component PTCS_MENULAYOUT:RCMenuLayout &rcMenuLayout;
&rcServConfig = &rcService.AddNewService("MY_SERVICE", 0);
&rcMenuLayout = &rcServConfig.AddPageFieldMenu("QE_BOOK.2", "0.QE_BOOK.QE_BOOK_NAME.2");
Local PTCS_MENULAYOUT:RCMenuFolder &lclMenuFolder = &rcMenuLayout.GetFolderFromFolderId("CRM");
Syntax
Save()
Description
Use the Save method to save the menu layout to the database. Invoke the Save method after updating any configuration properties for the menu layout or after invoking any of the following methods: AddFolder, CloneForNew, DeleteFolder, or DeleteMenuLink
Parameters
None.
Returns
A boolean value: True if the save is successful, False otherwise.
Example
&rcMenuLayout = &rcServConfig.AddPageFieldMenu("", "");
&rcMenuFolder = &rcMenuLayout.AddFolder("Root", Value(&rcServConfig.SeqNum));
&rcMenuLink = &rcMenuFolder.AppendMenuLink(&rcServConfig.ServiceId, &rcServConfig.InstanceId);
Local boolean &bRet = &rcMenuLayout.Save();