Localization Record Context Field Management (LRCFM)
The Localization record context field management system enables you to hide the fields, sublists, sublist columns on a record opened based on the localization context.
LRCFM hides the fields, sublists, sublist columns on a record if the localization context does not match.
The Localization Assistant SuiteApp supports the LRCFM feature. You or your developers can apply the filters of the localization record context to the workflows of different countries.
Implementation of LRCFM by Localization Assistant SuiteApp
A custom user event script is setup in the Localization Assistant SuiteApp. When a supported record is updated, the BeforeLoad user event script is triggered by the LRC Field Manager Plug-in type. For more information on the supported records, refer to Records Supporting LRCFM by Localization Assistant SuiteApp
The LRC Field Manager Plug-in hides the fields, sublists, sublist columns with internal Ids mentioned in the plug-in implementation.
The following image displays the flow of the plug-in implementation:
Advantages of Record Localization Context
The advantages of using the Localization Assistant SuiteApp for Record Localization Context are as follows:
-
Partners and customers can use this feature in their country-specific feature implementation.
-
You can avoid creating multiple user event scripts to hide fields based on their localization context for multiple SuiteApps.
-
Prevent performance delays by avoiding multiple user event scripts and the time used for loading the records.
Records Supporting LRCFM by Localization Assistant SuiteApp
The following records support the LRCFM feature by Localization Assistant SuiteApp:
-
Assembly/Bill of Materials
-
Cash Sale
-
Check
-
Contact
-
Employee
-
Gift Certificate Item
-
Inventory Part
-
Invoice
-
Item Fulfillment
-
Kit Item
-
Lot Numbered Assembly/Bill of Materials
-
Lot Numbered Inventory Item
-
Non-inventory Part
-
Other Charge Item
-
Partner
-
Purchase Order
-
Sales Order
-
Serialized Assembly/Bill of Materials
-
Serialized Inventory Item
-
Service
-
Subsidiary
-
Vendor Bill
-
Vendor Credit
-
Vendor Payment
The Localization Assistant SuiteApp is mandatory for localization SuiteApps that use the record localization context in country-specific workflows. For more information about Record Localization Context, see Record Localization Context Overview.
Creating LRCFM Plug-in Implementation
You must create a plug-in implementation for the LRC field manager plug-in type for each localization country.
The following is a sample script of Mexico Localization that you can use as a reference in creating your own script file:
/**
* @NApiVersion 2.x
* @NScriptType plugintypeimpl
*/
define([], function() {
function addUIElementsForManagement(obj) {
return {
country: 'MX',
fields: [{
id:'custbody_lrc_test_mx_body_fld'
},
{
id:'custentity_lrc_test_mx_entity_field'
},
{
id:'custitem_lrc_test_mx_item_field'
},
{
id:'countryofmanufacture'
}
],
sublists: ['recmachcustrecord_lrc_test_link_mx_entity', 'recmachcustrecord_lrc_test_link_mx_item'],
sublistColumns: [{
id:'recmachcustrecord_lrc_test_link_mx_entity',
columnIds:['custrecord_lrc_test_sub_col_mx']
}],
}
}
return {
addUIElementsForManagement: addUIElementsForManagement
}
})
The parameters of this script are listed in the following table:
Parameter |
Type |
Description |
Remarks |
---|---|---|---|
country |
String |
This parameter refers to the code of the localization country for which the plug-in implementation is created. Example: MX, US, CA |
|
fields |
Array of Objects |
This parameter refers to the list of field Ids required to be hidden if the localization context does not match. |
|
sublists |
Array of Strings |
This parameter refers to an array having the list of sublist's Ids that belong to the selected localization country. |
|
sublistsColumns |
Array of Objects |
This parameter refers to an array of objects with the following parameters:
|
|
Id |
String |
This parameter refers to the Id of the sublist on which the sublist column is displayed. |
|
columnsIds |
Array of Strings |
This parameter refers to the column Ids for the given sublist. |
|
If there is no sublist mentioned in the script, then you must not delete the sublist. You must identify the sublist as an empty parameter. This rule also applies for fields and sublistscolums parameters.
To create LRC field manager plug-in implementation:
-
Go to Customization > Plug-ins > Plug-in Implementations > New.
-
Create a JavaScript file using the sample script.
-
Select the JavaScript file you created from the Script File field
and click Create Plug-in Implementation.
-
Select the LRC Field Manager Plug-in Type from the Select Plug-in Type record.
-
Type the information in the required fields on the Plug-in Implementation record.
-
Click Save.
Displaying the Fields Hidden by LRCFM
You can display the fields that are hidden by LRCFM by using the following sample client script.
The following sample client script is used by Mexico Localization SuiteApp for the custom field custitem_lrc_test_mx_item_fld applied to a Non-Inventory record. On any field change, you can display the hidden fields by deploying the following sample script.
/**
* @NApiVersion 2.x
* @NScriptType ClientScript
*/
define(['N/record'],
function(record) {
function localizationContextEnter( scriptContext ) {
var value = scriptContext.currentRecord.getValue({
fieldId:'custitem_lrc_test_mx_item_fld'
});
var fieldObj = scriptContext.currentRecord.getField({
fieldId :'custitem_lrc_test_mx_item_fld'
});
fieldObj.isDisplay = true;
}
function localizationContextExit(scriptContext) {
var value= scriptContext.currentRecord.getValue({
fieldId :'custitem_lrc_test_mx_item_fld'
});
var fieldObj = scriptContext.currentRecord.getField({
fieldId :'custitem_lrc_test_mx_item_fld'
});
fieldObj.isDisplay = false;
}
return {
localizationContextEnter:localizationContextEnter,
localizationContextExit:localizationContextExit
}
});
For more information on deploying a client script for a specific country, see Using the Context Filtering Tab
When you uninstall the Localization Assistant SuiteApp, the connection between the plug-in implementation and the Localization Assistant SuiteApp breaks.
Even if you reinstall the Localization Assistant SuiteApp, the plug-in implementation does not connect with the Localization SuiteApp automatically. You must manually create the plug-in implementations again to connect with the Localization SuiteApp. To do this, see Creating LRCFM Plug-in Implementation