Solution
Firstly, we need to check, where we use the ‘&’ in the record . It may be billing address, shipping address, item name and Lot number in the inventory details . After that using the below mentioned code for replace the ‘&’
replace(/&/gi, ‘&’) || “”;
For Example:
var get_des = create_invoice.getSublistText({
sublistId: ‘item’,
fieldId: ‘item’,
line: p
}).replace(/&/gi, ‘&’) || “”;