Check this post : https://blogs.sap.com/2015/07/15/overview-on-scripting-languages-for-adobe-forms-beginners/.
Hide field if empty
Using javascript :
//data.Main.HEADER.ADRESSE_CLIENT.NAME3::initialize - (JavaScript, client)
if(this.rawValue == "" || this.rawValue == null) {
this.presence = "hidden";
}
- “hidden” will hide the whole element and shift lower elements up.
- “invisible” will hide only the TEXT INSIDE the element NOT the element itself (no shifting of other elements).
Display pagination
Using javascript :
// data.#pageSet[0].Page1.FOOTER.NO_PAGE::initialize - (JavaScript, client)
this.rawValue = "Page : " + xfa.layout.page(this) + "/" + xfa.layout.pageCount();
Using FormCalc:
// data.#pageSet[0].Page1.FOOTER.NO_PAGE::initialize - (FormCalc, client)
var pageRef = ref($)
$.rawValue = Concat("Page : ", xfa.layout.page(pageRef), "/" , xfa.layout.pageCount())
Display day date
The goal is to get the day date in internal SAP format (YYYYMMDD), and bind it with a date field. On this field we can choose the output date format.
Using javascript :
// data.#pageSet[0].Page1.FOOTER.EDITION_DATE::initialize - (JavaScript, client)
// Day date on SAP internal format (YYYYMMDD)
var d = new Date();
var yyyy = d.getFullYear();
var mm = d.getMonth() + 1; // getMonth() is zero-based
var dd = d.getDate();
this.rawValue = [yyyy,(mm>9 ? '' : '0') + mm,(dd>9 ? '' : '0') + dd].join('');
Search tag: js_hidden
About the author