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.

Important:

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 about 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:

Records Supporting LRCFM by Localization Assistant SuiteApp

LRCFM feature supports the following records:

LRCFM feature does not support the following records:

Note:

The Localization Assistant SuiteApp is required 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(['N/format','N/record'], function(format,record) {

  function addUIElementsForManagement(obj) {
          return {
                  country: 'MX',
                  fields: [{
                              id:'custbody_mx_trans_body_fld',                                
                              type: format.Type.TEXT,//or "checkbox"
                              clearingValue: 'defaultstring',
                              showOnlyIn:[
                                record.Type.PURCHASE_ORDER                               
                              ],
                              isMandatory:false
                            },
                            { 
                              id:'custentity_mx_entity_fld',
                              type: format.Type.TEXT,
                              clearingValue: 'defaultString',
                              showOnlyIn:[
                                 record.Type.CUSTOMER,
                                 record.Type.EMPLOYEE
                              ],
                              isMandatory:true
                            },
                            {
                              id:'custitem_lrc_test_mx_item_field'
                            }

                         ]
                  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

Required

country

String

This parameter refers to the code of the localization country for which the plug-in implementation is created.

Example: MX, US, CA

Yes

fields

Array of Objects

This parameter refers to an array of objects with the following parameters:

  • id – Internal Id of the field. This is a required field.

  • type – Type of field.

  • clearingValue – If the context does not match, this parameter value is replaced after clearing the field value.

  • showOnlyIn – This parameter displays the fields only in mentioned records if the localization context matches.

    Default value – All the records supported by LRCFM. For more information about the supported records, see Records Supporting LRCFM by Localization Assistant SuiteApp

  • isMandatory – This parameter validates and saves the record when the context matches. By default the Mandatory box on all custom field records must be cleared.

    Default value – False

No

sublists

Array of Strings

This parameter refers to an array having the list of sublist's Ids that belong to the selected localization country.

No

sublistsColumns

Array of Objects

This parameter refers to an array of objects with the following parameters:

  • Id

  • ColumnsIDs

No

Id

String

This parameter refers to the Id of the sublist on which the sublist column is displayed.

Yes

columnsIds

Array of Strings

This parameter refers to the column Ids for the given sublist.

Yes

Note:

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:

  1. Go to Customization > Plug-ins > Plug-in Implementations > New.

  2. Create a JavaScript file using the sample script.

  3. Select the JavaScript file you created from the Script File field

    and click Create Plug-in Implementation.

  4. Select the LRC Field Manager Plug-in Type from the Select Plug-in Type record.

  5. Type the information in the required fields on the Plug-in Implementation record.

  6. Click Save.

General Notices