Global Inventory Relationship
The internal ID for this record is globalinventoryrelationship
.
The Global Inventory Relationship record is available only when the following features are enabled:
-
Multi-Location Inventory
-
Advanced Inventory Management
-
Intercompany Cross-Subsidiary Fulfillment
Use the Intercompany Cross-Subsidiary Fulfillment feature in your NetSuite OneWorld account to fulfill orders and receive returns across multiple subsidiaries. Use of this feature means that orders are not limited to being fulfilled from locations within the originating sales subsidiary. Instead, you can fulfill a single sales order from locations in multiple subsidiaries.
For help working with this record in the UI, see Intercompany Cross-Subsidiary Fulfillment, Advanced Inventory Management, and Multi-Location Inventory.
See the SuiteScript Records Browser for all internal IDs associated with this record. See Supported Operations for additional details about scriptable elements for this record.
For information about using the SuiteScript Records Browser, see Working with the SuiteScript Records Browser in the NetSuite Help Center.
Supported Script Types
The Global Inventory Relationship record is scriptable in both client and server SuiteScript.
Supported Operations
The Global Inventory Relationship record can be created, read, edited, deleted, and searched using SuiteScript. It cannot be copied.
Usage Notes
The following elements of the Global Inventory Relationship record have limitations on scripting:
-
Only searching is supported for scripts on the System Notes sublist.
-
The originatingsubsidiary field is required and can no longer be updated after it has been created.
-
The inventorysubsidiary is required and can no longer be updated after it has been created.
-
The allowcrosssubfulfillment field is disabled and hidden by default but can be exposed on a Global Inventory Relationship form that has been customized.
-
The allowcrosssubcustomerreturn is disabled and hidden by default but can be exposed on a Global Inventory Relationship form that has been customized.
Fields
The following fields are scriptable for this record:
-
originatingsubsidiary (type: select, label: Originating Subsidiary)
-
inventorysubsidiary (type: select, label: InventorySubsidiary)
-
allowcrosssubfulfillment (type: checkbox, label: Allow Cross-Subsidiary Fulfillment)
-
allowcrosssubcustomerreturn (type: checkbox, label: Allow Cross-Subsidiary Customer Return)
-
alllocationsfulfillment (type: checkbox, label: All Fulfillment Locations)
-
alllocationscustomerreturn (type: checkbox, label: All Customer Return Locations)
-
externalid (type: text), isinactive (type: checkbox, label: Inactive)
Subtabs
The following subtabs are scriptable for this record:
-
invtlocfulfillment (Fulfillment)
-
invtloccustreturn (Customer Return)
Sublists
The following sublists are scriptable for this record:
-
fulfillment (Location under Fulfillment tab)
-
customerreturn (Location under Customer Return tab)
Additional Notes
-
A Global Inventory Relationship (GIR) record's originatingsubsidiary field cannot be set with the same value as its inventorysubsidiary.field.
-
A GIR record's originatingsubsidiary and inventorysubsidiary combination should be unique. Global Inventory Relationship records cannot be duplicated.
-
A GIR record cannot have the allowcrosssubfulfillment box and allowcrosssubcustomerreturn box cleared at the same time. At least one should be checked. Both can be checked if applicable.
-
A GIR record cannot be deleted when a sales order or return authorization has been created using the relationship record.
-
A GIR record's allowcrosssubfulfillment box can be updated only when one of the following are true:
-
No sales order uses the GIR record, or
-
All sales orders using the GIR record have been fully fulfilled and closed.
-
-
A GIR record's allowcrosssubcustomerreturn box can be updated only when of the following are true:
-
No return authorization uses the GIR record, or
-
All return authorizations using the GIR record have been fully received and closed.
-
-
You cannot clear the allowcrosssubfulfillment box when one or more locations are on the fulfillment sublist.
-
You cannot clear the allowcrosssubcustomerreturn box when one or more locations are on the customerreturn sublist.
-
You cannot remove a location from the fulfillment sublist when there is an existing cross-subsidiary sales order, that is not fully fulfilled and closed, that uses the corresponding GIR with the given location.
-
You cannot remove a location from the customerreturn sublist when there is an existing cross-subsidiary return authorization, that is not fully fulfilled and closed, that uses the corresponding GIR with the given location.
Code Sample
The following samples illustrate how to create a Global Inventory Relationship (GIR) record. This code creates two GIR records with the following parameters:
-
id1 is a relationship between US Subsidiary as the originating subsidiary and the AU subsidiary as the inventory subsidiary. It uses default values.
-
id2 is a relationship between the AU subsidiary as the originating subsidiary and US subsidiary as the inventory subsidiary. It sets specific values such as enabling the Inactive field.
var US_SUBSIDIARY = 3;
var AU_SUBSIDIARY = 1;
var girRec = record.create({
type: record.Type.GLOBAL_INVENTORY_RELATIONSHIP,
});
girRec.setValue({
fieldId: 'originatingsubsidiary',
value: US_SUBSIDIARY
});
girRec.setValue({
fieldId: 'inventorysubsidiary',
value: AU_SUBSIDIARY
});
var id1 = girRec.save();
var girRec2 = record.create({
type: record.Type.GLOBAL_INVENTORY_RELATIONSHIP,
});
girRec2.setValue({
fieldId: 'originatingsubsidiary',
value: AU_SUBSIDIARY
});
girRec2.setValue({
fieldId: 'inventorysubsidiary',
value: US_SUBSIDIARY
});
girRec2.setValue({
fieldId: 'externalid',
value: 'AU_US_GIR'
});
girRec2.setValue({
fieldId: 'isinactive',
value: true
});
girRec2.setValue({
fieldId: 'allocationsfulfillment',
value: true
});
girRec2.setValue({
fieldId: 'allocationscustomerreturn',
value: false
});
var id2 = girRec2.save();
The following sample shows how to create a simple search that returns GIR records that are set as Inactive.
var mySearch = search.create({
type: record.Type.GLOBAL_INVENTORY_RELATIONSHIP,
filters: [{
name: 'isinactive',
operator: search.Operator.IS,
values: true
}]
});