diff --git a/languages/en_us/Vtiger.php b/languages/en_us/Vtiger.php index 4375a46322a1fc767cd3641bb83856a4ed499384..6d0caecee296a588c379b49ebdba50049328d54f 100644 --- a/languages/en_us/Vtiger.php +++ b/languages/en_us/Vtiger.php @@ -1936,6 +1936,8 @@ $jsLanguageStrings = array( 'JS_PASSWORD_MISMATCH_ERROR' => 'Please re-enter passwords. The "new password" and "confirm password" values do not match.', 'LBL_LIST_DELETE_CONFIRMATION' => 'Are you sure you want to delete?', 'JS_WIDGET_RESIZING_WAIT_MSG' => 'Widget contents will load after resizing.', - 'JS_COPIED_SUCCESSFULLY' => 'Copied successfully', - 'JS_ATLEAST_SELECT_ONE_FIELD' => 'At least one field should be selected', + 'JS_COPIED_SUCCESSFULLY' => 'Copied successfully', + 'JS_ATLEAST_SELECT_ONE_FIELD' => 'At least one field should be selected', + 'JS_RELATED_ACCOUNT_IS_NOT_AVAILABLE' => 'Related Organization record is not available', + 'JS_RELATED_CONTACT_IS_NOT_AVAILABLE' => 'Related Contact record is not available', ); diff --git a/layouts/v7/modules/Inventory/resources/Edit.js b/layouts/v7/modules/Inventory/resources/Edit.js index 1f1f5abdb35bf1ffd22d54d136f2038ed063132d..d4952e72ad1f15f570f482677c0158a764142a58 100644 --- a/layouts/v7/modules/Inventory/resources/Edit.js +++ b/layouts/v7/modules/Inventory/resources/Edit.js @@ -2576,6 +2576,10 @@ Vtiger_Edit_Js("Inventory_Edit_Js", { var objectToMapAddress; if(elementClass == "accountAddress"){ var recordRelativeAccountId = jQuery('[name="account_id"]').val(); + if(typeof recordRelativeAccountId == 'undefined'){ + app.helper.showErrorNotification({'message':app.vtranslate('JS_RELATED_ACCOUNT_IS_NOT_AVAILABLE')}); + return; + } if(recordRelativeAccountId == "" || recordRelativeAccountId == "0"){ app.helper.showErrorNotification({'message':app.vtranslate('JS_PLEASE_SELECT_AN_ACCOUNT_TO_COPY_ADDRESS')}); } else { @@ -2595,8 +2599,12 @@ Vtiger_Edit_Js("Inventory_Edit_Js", { } }else if(elementClass == "contactAddress"){ var recordRelativeContactId = jQuery('[name="contact_id"]').val(); + if(typeof recordRelativeContactId == 'undefined'){ + app.helper.showErrorNotification({'message':app.vtranslate('JS_RELATED_CONTACT_IS_NOT_AVAILABLE')}); + return; + } if(recordRelativeContactId == "" || recordRelativeContactId == "0"){ - app.helper.showErrorNotification({'message':app.vtranslate('JS_PLEASE_SELECT_AN_RELATED_TO_COPY_ADDRESS')}); + app.helper.showErrorNotification({'message':app.vtranslate('JS_PLEASE_SELECT_AN_RELATED_TO_COPY_ADDRESS')}); } else { var recordRelativeContactName = jQuery('#contact_id_display').val(); var editViewLabel = jQuery('#contact_id_display').closest('td');