GetParentContentControl
function GetParentContentControl(): ApiBlockLvlSdt | ApiInlineLvlSdt | "null"
Description
Returns a content control that contains the current content control.
Returns
ApiBlockLvlSdt | ApiInlineLvlSdt | "null"
Try It
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
var oInlineLvlSdt1 = Api.CreateInlineLvlSdt();
oInlineLvlSdt1.AddText("This is a parent inline text content control.");
oParagraph.AddInlineLvlSdt(oInlineLvlSdt1);
var oInlineLvlSdt2 = Api.CreateInlineLvlSdt();
oInlineLvlSdt2.AddText("This is an inline text content control added in another content control.");
oInlineLvlSdt1.AddElement(oInlineLvlSdt2, 0);
var oParentInlineLvlSdt = oInlineLvlSdt2.GetParentContentControl();
oParentInlineLvlSdt.SetAlias("№1");