跳到主要内容

GetInternalId

返回当前表单的内部 ID。

继承自 ApiFormBase.GetInternalId。

语法​

expression.GetInternalId();

expression - 表示 ApiDateForm 类的变量。

参数​

此方法没有任何参数。

返回值​

string

示例​

获取文档中日期表单的唯一内部标识符。

// How do I get the internal ID assigned to a date form in a document?

// Use the identifier to distinguish one date form from another when multiple forms exist.

let doc = Api.GetDocument();
let dateForm = Api.CreateDateForm({"key": "Nowadays", "tip": "Enter current date", "required": true, "placeholder": "Your date here", "format": "mm.dd.yyyy", "lang": "en-US"});
let paragraph = doc.GetElement(0);
paragraph.AddElement(dateForm);
let internalId = dateForm.GetInternalId();
paragraph = Api.CreateParagraph();
paragraph.AddText("Internal id: " + internalId);
doc.Push(paragraph);