[集成]{class="badge positive"}
创建数据元素
[AEM Forms as a Cloud Service]{class="badge informative"}
在罢补驳蝉属性中,我们添加了两个新数据元素(础辫辫濒颈肠补迟颈辞苍蝉厂迟补迟别翱蹿搁别蝉颈诲别苍肠别和惫补濒颈诲补迟颈辞苍贰谤谤辞谤)。
ApplicantStateOfResidence
通过在扩展下拉列表中选择? Core ?并为数据元素类型选择? 自定义代码,配置了? ApplicantStateOfResidence ?数据元素,如下面的屏幕快照所示
以下自定义代码用于捕获? 状态 ?自适应表单字段中的值。
// use the GuideBridge API to access adaptive form elements
//The state field's SOM expression is used to access the state field
var ApplicantsStateOfResidence = guideBridge.resolveNode("guide[0].guide1[0].guideRootPanel[0].state[0]").value;
_satellite.logger.log("Returning Applicants State Of Residence is "+ApplicantsStateOfResidence);
return ApplicantsStateOfResidence;
validationError
通过在扩展下拉列表中选择? Core ?并为数据元素类型选择? 自定义代码,配置了? ValidationError ?数据元素,如下面的屏幕快照所示
编写了以下自定义代码以设置validationError
数据元素值。
var validationError = "";
// Using GuideBridge API to access adaptive forms fields using the fields SOM expression
var tel = guideBridge.resolveNode("guide[0].guide1[0].guideRootPanel[0].telephone[0]");
var email = guideBridge.resolveNode("guide[0].guide1[0].guideRootPanel[0].email[0]");
_satellite.logger.log("Got tel in Tags custom script "+tel.isValid)
_satellite.logger.log("Got email in Tags custom script "+email.isValid)
if (tel.isValid == false) {
validationError = "error: telephone number";
_satellite.logger.log("Validation error is "+ validationError);
}
if (email.isValid == false) {
validationError = "error: invalid email";
_satellite.logger.log("Validation error is "+ validationError);
}
return validationError;
4859a77c-7971-4ac9-8f5c-4260823c6f69