[SOLVED] 4.5 Articles in QUOTES Dont work

More
21 Mar 2014 11:46 #3100 by CPMAGRIN
I've a clean Installation of VTECRM 4.5 VMWARE.
I Created a QUOTES and Some Products.
When I try to recall a Articles inside a quote the description and Price didn't appear.
There is another problem. I can't select from the right mask any item.

Please Log in to join the conversation.

More
01 Apr 2014 13:38 #3111 by cpvt
It's probably a problem with jQuery and prototype used in 4.5 version on file modules/Products/products.js: at line 77 they call a disableReferenceField function (defined in modules/SDK/src/reference/Autocomplete.tpl) that rise this error in firebug consolle

TypeError: $(...).addClassName is not a function
$(field).addClassName('detailedViewReferenceRO');

It's hard for me to debug inside jQuery and prototype, so I hope some VTE developer could check this and answer.

What I tried is to replace the new code with the old one that the developers leave commented in product.js and it works. In both function set_return_inventory and set_return_inventory_po of products.js you can find the old code.
But I don't know the bug (crmv@48407) that they try to fix with the new code.

cp
The following user(s) said Thank You: CPMAGRIN

Please Log in to join the conversation.

More
14 Apr 2014 09:02 #3121 by CPMAGRIN
I tried to replace the old code like you wrote but it doesn't work.
Can you help me with the file you sure works?

Grazie

Please Log in to join the conversation.

More
16 Apr 2014 08:59 #3123 by cpvt
Hi, in attache you can find the product.js modified, compare it with yours to see the difference.
I also paste the code of modified functions below becouse I'm not sure that the "Add file" works.

function set_return_inventory(product_id,product_name,unitprice,qtyinstock,taxstr,curr_row,desc,subprod_id,product_code) { //crmv@16267
var subprod = subprod_id.split("::");
//cpvt non funziona con jQuery e prototype
/*
//crmv@48407
var jQuery_obj = jQuery;
if (jQuery("form[name=EditView] input#subproduct_ids"+curr_row).length <= 0){
jQuery_obj = parent.jQuery;
}
jQuery_obj("form[name=EditView] input#subproduct_ids"+curr_row).val(subprod[0]);
jQuery_obj("form[name=EditView] input#subprod_names"+curr_row).val(subprod[1]);
jQuery_obj("form[name=EditView] input#productName"+curr_row).val(product_name);
jQuery_obj("form[name=EditView] input#hdnProductId"+curr_row).val(product_id);
disableReferenceField(jQuery_obj("form[name=EditView] input#hdnProductId"+curr_row));
jQuery_obj("form[name=EditView] input#listPrice"+curr_row).val(unitprice);
jQuery_obj("form[name=EditView] input#productDescription"+curr_row).val(desc);
jQuery_obj("form[name=EditView] input#hdnProductcode"+curr_row).val(product_code);
jQuery_obj("form[name=EditView] #qtyInStock"+curr_row).html(qtyinstock);
var tax_array = new Array();
var tax_details = new Array();
tax_array = taxstr.split(',');
for(var i=0;i<tax_array.length;i++)
{
tax_details = tax_array.split('=');
}
jQuery_obj("form[name=EditView] input#qty"+curr_row).focus();
//crmv@48407 e
*/

//crmv@21048m
parent.document.EditView.elements["subproduct_ids"+curr_row].value = subprod[0];
parent.document.getElementById("subprod_names"+curr_row).innerHTML = subprod[1];

parent.document.EditView.elements["productName"+curr_row].value = product_name;
parent.document.EditView.elements["hdnProductId"+curr_row].value = product_id;
disableReferenceField(parent.document.EditView.elements["productName"+curr_row]); //crmv@29190

parent.document.EditView.elements["listPrice"+curr_row].value = unitprice;
//crmv@16267
//parent.document.EditView.elements["comment"+curr_row].value = desc;
parent.document.EditView.elements["productDescription"+curr_row].value = desc;
parent.document.EditView.elements["hdnProductcode"+curr_row].value = product_code;
//crmv@16267e
//getOpenerObj("unitPrice"+curr_row).innerHTML = unitprice;
getOpenerObj("qtyInStock"+curr_row).innerHTML = qtyinstock;

var tax_array = new Array();
var tax_details = new Array();
tax_array = taxstr.split(',');
for(var i=0;i<tax_array.length;i++)
{
tax_details = tax_array.split('=');
}

parent.document.EditView.elements["qty"+curr_row].focus();
//crmv@21048me
//cpvte

}

function set_return_inventory_po(product_id,product_name,unitprice,taxstr,curr_row,desc,subprod_id,product_code) { //crmv@26660
var subprod = subprod_id.split("::");
//cpvt non funziona con jQuery e prototype
/*
//crmv@48407
var jQuery_obj = jQuery;
if (jQuery("form[name=EditView] input#subproduct_ids"+curr_row).length <= 0){
jQuery_obj = parent.jQuery;
}
jQuery_obj("form[name=EditView] input#subproduct_ids"+curr_row).val(subprod[0]);
jQuery_obj("form[name=EditView] input#subprod_names"+curr_row).val(subprod[1]);
jQuery_obj("form[name=EditView] input#productName"+curr_row).val(product_name);
jQuery_obj("form[name=EditView] input#hdnProductId"+curr_row).val(product_id);
disableReferenceField(jQuery_obj("form[name=EditView] input#productName"+curr_row));
jQuery_obj("form[name=EditView] input#listPrice"+curr_row).val(unitprice);
jQuery_obj("form[name=EditView] input#productDescription"+curr_row).val(desc);
jQuery_obj("form[name=EditView] input#hdnProductcode"+curr_row).val(product_code);
var tax_array = new Array();
var tax_details = new Array();
tax_array = taxstr.split(',');
for(var i=0;i<tax_array.length;i++)
{
tax_details = tax_array.split('=');
}
jQuery_obj("form[name=EditView] input#qty"+curr_row).focus();
//crmv@48407 e
*/

//crmv@21048m
parent.document.EditView.elements["subproduct_ids"+curr_row].value = subprod[0];
parent.document.getElementById("subprod_names"+curr_row).innerHTML = subprod[1];

parent.document.EditView.elements["productName"+curr_row].value = product_name;
parent.document.EditView.elements["hdnProductId"+curr_row].value = product_id;
disableReferenceField(parent.document.EditView.elements["productName"+curr_row]); //crmv@29190
parent.document.EditView.elements["listPrice"+curr_row].value = unitprice;
parent.document.EditView.elements["productDescription"+curr_row].value = desc; //crmv@26660
parent.document.EditView.elements["hdnProductcode"+curr_row].value = product_code; //crmv@26660

var tax_array = new Array();
var tax_details = new Array();
tax_array = taxstr.split(',');
for(var i=0;i<tax_array.length;i++)
{
tax_details = tax_array.split('=');
}

parent.document.EditView.elements["qty"+curr_row].focus();
//crmv@21048me
//cpvte
}
The following user(s) said Thank You: CPMAGRIN

Please Log in to join the conversation.

More
05 May 2014 10:38 #3128 by CPMAGRIN
Thank you. NOW it works!!!!!

Please Log in to join the conversation.

Time to create page: 0.092 seconds