Here is a piece of code that will use a custom field instead of the GUID. Note that the code was just created for testing, i.e. no error handling.
You should be able to download the JS file from the Offline HTML section, modify it and upload again. Does that not work for you? Workaround would be to take the original .woodford file that you download from Microsoft, rename it to .zip, open it and navigate to www.zip\CustomerAsset. Update the code and upload in Woodford.
// code assumes that the serial number is stored in a field "sie_barcode" on the customer asset
var FS = FS || {};
FS.ScanCustomerAsset = {
localization: null,
scanCustomerAssetButtonId: "ScanCustomerAssetButton",
customerAssetOnLoad: function (goNow) {
MobileCRM.Localization.initialize(FS.ScanCustomerAsset.storeLocalization, MobileCRM.bridge.alert);
FS.ScanCustomerAsset.changeButtonColor();
MobileCRM.UI.IFrameForm.requestObject(function (iFrame) {
if (iFrame && iFrame.form && iFrame.form.caption)
iFrame.form.caption = "";
}, MobileCRM.bridge.alert, null);
if (goNow) {
FS.ScanCustomerAsset.scanCustomerAsset();
}
},
changeButtonColor: function () {
// Overrides default white background and black text to the apps styles
MobileCRM.Application.getAppColor("TitleBackground", function (backgroundColor) {
MobileCRM.Application.getAppColor("TitleForeground", function (foregroundColor) {
if (backgroundColor && foregroundColor) {
var element = document.getElementById(FS.ScanCustomerAsset.scanCustomerAssetButtonId);
if (element) {
element.style.backgroundColor = backgroundColor;
element.style.color = foregroundColor;
element.style.borderColor = backgroundColor;
}
}
}, MobileCRM.bridge.alert);
}, MobileCRM.bridge.alert);
},
scanCustomerAsset: function () {
MobileCRM.Platform.scanBarCode(function (res) {
if (res && res.length > 0) {
// If the code is an id for a Customer Asset in the db, open the Customer Asset form
var entity = new MobileCRM.FetchXml.Entity("msdyn_customerasset");
entity.addAttribute("msdyn_customerassetid");
entity.addAttribute("sie_barcode");
entity.filter = new MobileCRM.FetchXml.Filter();
entity.filter.where("sie_barcode", "eq", res [0]);
var fetch = new MobileCRM.FetchXml.Fetch(entity);
fetch.execute("Array", function (result) {
if (typeof (result) != "undefined" && result.length > 0) {
var productid;
for (var i in result) {
var results = result[i];
productid = results[0];
}
MobileCRM.DynamicEntity.loadById(FS.Schema.CustomerAsset.name, productid, function (customerAsset) {
MobileCRM.UI.FormManager.showEditDialog(FS.Schema.CustomerAsset.name, customerAsset.id, null);
}, function (error) {
MobileCRM.bridge.alert(FS.ScanCustomerAsset.localization.get("Alert.BadBarcode"));
});
}
}, function (error) {
MobileCRM.bridge.alert("An Error Has occurred " + error);
});
}
else if (FS.ScanCustomerAsset.localization) {
MobileCRM.bridge.alert(FS.ScanCustomerAsset.localization.get("Alert.NoBarcode"));
}
else {
MobileCRM.bridge.alert("No barcode");
}
}, MobileCRM.bridge.alert);
},
storeLocalization: function (localization) {
FS.ScanCustomerAsset.localization = localization;
document.getElementById(FS.ScanCustomerAsset.scanCustomerAssetButtonId).value = FS.ScanCustomerAsset.localization.get("Cmd.ScanCustomerAsset");
}
};