You are on page 1of 3

Following framework personalization can be achieved by using the following

Lot Number must in CAPS


Lot number should not be more than 15 Char
Lot Expiration can be greater than 15 Characters

1. Go to the personalize area on the OAF page


Click on the Lot Details link

2.

Create a new Item of type Raw Text

3.

4. Paste the below script in the Text field


<script> function setRules () { var lotTableBody; var lotNum = []; var
lotExp = []; var now = new Date(); lotTableBody =
document.getElementById('lotTable').firstChild.firstChild.firstChild.firstChild;
if (lotTable.tagName != "TABLE") { lotTableBody =
lotTableBody.firstChild.firstChild; }
if
(lotTableBody.children[1].firstChild.firstChild.tagName != "BR") { for (var i =
1; i < lotTableBody.children.length - 1; i++) { lotNum[i] =
lotTableBody.children[i].firstChild.firstChild; lotNum[i].maxLength = 15;
lotNum[i].onchange = function() {
this.value =
this.value.toUpperCase(); }; lotExp[i] =
lotTableBody.children[i].children[3].getElementsByTagName('input')[0];
lotExp[i].onchange = function () {
if (this.value.substr(7, 4) ==
now.getFullYear()) {
alert('Warning: lot expiration year the same as current
year');
} } } } var addRowBtn =
lotTableBody.children[lotTableBody.children.length 1].getElementsByTagName('button')[0]; var origOnclick =

addRowBtn.onclick; addRowBtn.onclick = function() { origOnclick();


setTimeout(function () { setRules(); }, 1000); }; } setRules(); </script>

You might also like