Question

I have a combo Box that lists several products. Some of these products have quotes in their names signifying inches (i.e. 12" dressing Rod). Here is my issue. I have an "On Change" event that updates several computed fields using @DbLookup populating Product Cost, Unit of Measure, & Item Number. When I select any product that uses a quote to signify inches, the computed fields do not populate. What is the significance of the quote in the product name & how do I fix this? Here is the code from the Combo Box.

try {
        var vendor = getComponent("POVendor").getValue();
        var list = @DbLookup(@DbName(), "VPL", vendor, 2);
        if (@IsError(list))
            return "Select a Vendor first|";
        else
            return list;
    } catch (e) {
        return "Please select a vendor first (Error)|";
    }

Here is the code from the computed field (it's actually an edit box that is read only & the code is the default value.) that populates with the Item Cost:

var item = getComponent("Item1").getValue();

var cost = @DbLookup(@DbName(), "PL", item, 2);

return cost;
Was it helpful?

Solution 2

Since the product list was imported I needed a way to change the " to "in.". I did by using an agent & changed all of the product names containing """ & replaced them with "in.". That worked. Now I'm just going to write a script that prohibits use of the " mark for Inches.

OTHER TIPS

Are you using inch symbol?. If so you can try replacing it with the equivalent hex code \u2033.

var item = getComponent("Item1").getValue();
var cost = @DbLookup(@DbName(), "PL", @ReplaceSubstring(item, '″', '\u2033'), 2);
return cost;

If you're using right double quotation mark, your hex code will be \u201D.

Please look at this link, http://www.javascripter.net/faq/mathsymbols.htm to find the different types of codes for a given character.

Please give a try and let us know.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top