GetParentContentControl
function GetParentContentControl(): ApiBlockLvlSdt | "null"
Description
Returns a content control that contains the current content control.
Returns
ApiBlockLvlSdt | "null"
Try It
var oDocument = Api.GetDocument();
var oBlockLvlSdt1 = Api.CreateBlockLvlSdt();
oBlockLvlSdt1.GetContent().GetElement(0).AddText("This is a parent block text content control.");
oDocument.AddElement(0, oBlockLvlSdt1);
var oBlockLvlSdt2 = Api.CreateBlockLvlSdt();
oBlockLvlSdt2.GetContent().GetElement(0).AddText("This is a block text content control added in another content control.");
oBlockLvlSdt1.AddElement(oBlockLvlSdt2, 0);
var oParentBlockLvlSdt = oBlockLvlSdt2.GetParentContentControl();
oParentBlockLvlSdt.SetAlias("№1");