Shantha - Thursday, December 26, 2013 4:30 AM:
Hi All,
I created 1 list named "variance" with value as 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,........Z in the form i have item number as 2G040000100 it is the parent item number.
When i try to implement variant for that item number ,In form i have textbox "Additional Information" i try to enter some data that time i click the button so the 10th digit should be changed to 1 as 2G040000110 and save. next time when i edit it should check 10th digit and cross check with variance list index and the next value of the variance list should be grabbed and generate value as 2G040000120 .....2G040000190, 2G0400001A0...
Like that item number should change so i made variance list invisble.
my code is..,
// getting item_value
var item_number=document.getElementsByName("item_value").item().value;
//Substr
var pre = item_number.substr(0,9);
var manu_value =item_number.substr(9,1);
var manu_int = parseInt(manu_value,10);
// getItem count
var last_item = part_result1.getItemByIndex(part_count_1-1).getProperty("item_number);
if((software_variance===true)&&(version_update===false))
{
if(additional_description==="")
{
top.aras.AlertError("Please fill Additional Description");
return;
}
else
{
var select = document.getElementByName("suffix_sw_revision");
var x=select[0].selectedIndex;
var result=createOption();
var new_part_id = pre+ select.childNodes[currentIndex].value + variant_int.toString();
document.getElementsByName("new_part_id").item().value=new_part_id;
handleItemChange("new_part_id",document.getElementsByName("new_part_id").item().value);
}
function createOption(){
for(var i = 0; i <select[0].length ; i++)
{
if(i===manu_int )
{
var _val=select[0].options(index).value;
}
}
But the logic is not correct its getting error.null is not an object im facing.
Can any one help me to solve this issue.Im stuck for whole day.
Thanks.