Create Sales Order Line With Extensible Flexfield

When you want to create a sales order line with order line extensible flexfield, you need to get the metadata for the sales order line extensible flexfield.

You can use the Sales Orders for Order Hub resource to get the metadata for the sales order line extensible flexfield.

Let's discuss the scenario, where Richard Jones is an integration user with Order Entry Specialist role. Richard wants to create a sales order line with order header extensible flexfields using REST API. Richard can:

  1. Get the metadata for a sales order line extensible flexfield
  2. Use the sales order line extensible flexfield metadata to create a sales order line

Get Metadata for Sales Order Line Extensible Flexfield

In this scenario, Richard gets the metadata for a sales order line extensible flexfield.

Example URL

Use this resource URL format.

GET

curl -i -X GET \
-H "Authorization:Basic c2Ntb3BlcmF0aW9uczpXZWxjb21lMQ==" \
-H "REST-FRAMEWORK:4" \
-H "Rest-Framework-Version:4" \ 'https://servername/fscmRestApi/resources/version/salesOrdersForOrderHub/describe?polymorphicType=salesOrdersForOrderHub.lines.additionalInformation%3ADOO_FULFILL_LINES_ADD_INFO'

Example Response

Here's an example of the response body in JSON format.

{
	"title": "Extensible Flexfield Contexts, Grouped for Order Line",
	"attributes": [
	{
		"name": "Category",
		"type": "string",
		"updatable": true,
		"mandatory": false,
		"queryable": true,
		"allowChanges": "always",
		"precision": 240,
		"defaultValue": "DOO_FULFILL_LINES_ADD_INFO"
	}
	],
	"item": {
		"links": [
		...
		{
			"rel": "child",
			"href": "https://servername/fscmRestApi/resources/version/salesOrdersForOrderHub/{id}/child/lines/{id}/child/additionalInformation/{id}/child/FulfillLineEffBPackShipInstructionprivateVO",
			"name": "FulfillLineEffBPackShipInstructionprivateVO",
			"kind": "collection",
			"cardinality": {
				"value": "1 to 1",
				"sourceAttributes": "FulfillLineId",
				"destinationAttributes": "FulfillLineId"
			}
		}        ]
	},
	"links": [
	{
		"rel": "self",
		"href": "https://servername/fscmRestApi/resources/version/salesOrdersForOrderHub/describe?polymorphicType=salesOrdersForOrderHub.lines.additionalInformation%3ADOO_FULFILL_LINES_ADD_INFO",
		"name": "self",
		"kind": "describe"
	}
	],
	"children": {
		"FulfillLineEffBFulfillLineContext1privateVO": {
			...
		}
		"FulfillLineEffBPackShipInstructionprivateVO": {
			"attributes": [
			{
				"name": "ContextCode",
				"type": "string",
				"updatable": true,
				"mandatory": true,
				"queryable": true,
				"allowChanges": "always",
				"precision": 80,
				"defaultValue": "PackShipInstruction",
				"maxLength": "80",
				"properties": {
					"DISPLAYHINT": "Hide",
					"FND_ACFF_ApplicationID": "10008",
					"FND_ACFF_ApplicationShortName": "DOO",
					"FND_ACFF_FlexfieldCode": "DOO_FULFILL_LINES_ADD_INFO",
					"FND_ACFF_ModelID": "EFF_DOO_DOO_5FFULFILL_5FLINES_5FADD_5FINFO_DOO_5FFULFILL_5FLINES_5FADD_5FINFO_DOO_5FFULFILL_5FLINES_5FEFF_5FB",
					"FND_ACFF_VF": "c"
				}
			},
			{
				"name": "CreatedBy",
				"type": "string",
				"updatable": true,
				"mandatory": true,
				"queryable": true,
				"allowChanges": "inCreate",
				"precision": 64,
				"defaultValue": "-1",
				"maxLength": "64",
				"properties": {
					"DISPLAYHINT": "Hide"
				}
			},
			{
				"name": "CreationDate",
				"type": "datetime",
				"updatable": true,
				"mandatory": true,
				"queryable": true,
				"allowChanges": "inCreate",
				"properties": {
					"DISPLAYHINT": "Hide"
				}
			},
			{
				"name": "EffLineId",
				"type": "integer",
				"updatable": true,
				"mandatory": true,
				"queryable": true,
				"allowChanges": "always",
				"precision": 18,
				"hasDefaultValueExpression": true,
				"properties": {
					"DISPLAYHINT": "Hide",
					"fnd:GLOBALLY_UNIQUE": "true"
				}
			},
			{
				"name": "FulfillLineId",
				"type": "integer",
				"updatable": true,
				"mandatory": false,
				"queryable": true,
				"allowChanges": "always",
				"precision": 18,
				"properties": {
					"DISPLAYHINT": "Hide"
				}
			},
			{
				"name": "HeaderId",
				"type": "integer",
				"updatable": true,
				"mandatory": false,
				"queryable": true,
				"allowChanges": "inCreate",
				"precision": 18,
				"properties": {
					"DISPLAYHINT": "Hide"
				}
			},
			{
				"name": "LastUpdateDate",
				"type": "datetime",
				"updatable": true,
				"mandatory": true,
				"queryable": true,
				"allowChanges": "always",
				"properties": {
					"DISPLAYHINT": "Hide"
				}
			},
			{
				"name": "LastUpdateLogin",
				"type": "string",
				"updatable": true,
				"mandatory": false,
				"queryable": true,
				"allowChanges": "always",
				"precision": 32,
				"defaultValue": "-1",
				"maxLength": "32",
				"properties": {
					"DISPLAYHINT": "Hide"
				}
			},
			{
				"name": "LastUpdatedBy",
				"type": "string",
				"updatable": true,
				"mandatory": true,
				"queryable": true,
				"allowChanges": "always",
				"precision": 64,
				"defaultValue": "-1",
				"maxLength": "64",
				"properties": {
					"DISPLAYHINT": "Hide"
				}
			},
			{
				"name": "LineId",
				"type": "integer",
				"updatable": true,
				"mandatory": false,
				"queryable": true,
				"allowChanges": "inCreate",
				"precision": 18,
				"properties": {
					"DISPLAYHINT": "Hide"
				}
			},
			{
				"name": "ObjectVersionNumber",
				"type": "integer",
				"updatable": true,
				"mandatory": true,
				"queryable": true,
				"allowChanges": "always",
				"precision": 9,
				"properties": {
					"DISPLAYHINT": "Hide"
				}
			},
			{
				"name": "_PackingInstruction",
				"type": "string",
				"updatable": true,
				"mandatory": false,
				"queryable": true,
				"allowChanges": "always",
				"precision": 150,
				"title": "Packing Instruction",
				"includeInCompactView": true,
				"maxLength": "150",
				"properties": {
					"DISPLAYHEIGHT": "3",
					"DISPLAYWIDTH": "100",
					"FND_ACFF_EFF_CONTEXT_SEGMENT_CODE": "PackingInstruction",
					"FND_ACFF_EFF_INDEXED_FLAG": "N",
					"FND_ACFF_EFF_SEGMENT_ATTRIBUTE": "true",
					"FND_ACFF_FlexfieldResourceBundleResId": "rev.a10008.dDOO_FULFILL_LINES_ADD_INFO..d4p.PackShipInstruction.PackingInstruction",
					"FND_ACFF_JavaType": "java.lang.String",
					"FND_ACFF_MaximumLength": "150",
					"FND_ACFF_NLS_UNIT": "Packing Instruction",
					"FND_ACFF_PreferredDisplayType": "TEXT_AREA",
					"FND_ACFF_SegmentName": "PackingInstruction",
					"FND_ACFF_VF_ContextCode__PackShipInstruction": "c",
					"TOOLTIP": "Packing Instruction",
					"oj-controlType": "oj-text-area"
				}
			},
			{
				"name": "_ShippingInstruction",
				"type": "string",
				"updatable": true,
				"mandatory": false,
				"queryable": true,
				"allowChanges": "always",
				"precision": 150,
				"title": "Shipping Instruction",
				"includeInCompactView": true,
				"maxLength": "150",
				"properties": {
					"DISPLAYHEIGHT": "3",
					"DISPLAYWIDTH": "100",
					"FND_ACFF_EFF_CONTEXT_SEGMENT_CODE": "ShippingInstruction",
					"FND_ACFF_EFF_INDEXED_FLAG": "N",
					"FND_ACFF_EFF_SEGMENT_ATTRIBUTE": "true",
					"FND_ACFF_FlexfieldResourceBundleResId": "rev.a10008.dDOO_FULFILL_LINES_ADD_INFO..d4p.PackShipInstruction.ShippingInstruction",
					"FND_ACFF_JavaType": "java.lang.String",
					"FND_ACFF_MaximumLength": "150",
					"FND_ACFF_NLS_UNIT": "Shipping Instruction",
					"FND_ACFF_PreferredDisplayType": "TEXT_AREA",
					"FND_ACFF_SegmentName": "ShippingInstruction",
					"FND_ACFF_VF_ContextCode__PackShipInstruction": "c",
					"TOOLTIP": "Shipping Instruction",
					"oj-controlType": "oj-text-area"
				}
			},
			{
				"name": "_ShippingCost",
				"type": "integer",
				"updatable": true,
				"mandatory": false,
				"queryable": true,
				"allowChanges": "always",
				"precision": 15,
				"title": "Shipping Cost",
				"includeInCompactView": true,
				"properties": {
					"DISPLAYWIDTH": "100",
					"FND_ACFF_EFF_CONTEXT_SEGMENT_CODE": "ShippingCost",
					"FND_ACFF_EFF_INDEXED_FLAG": "N",
					"FND_ACFF_EFF_SEGMENT_ATTRIBUTE": "true",
					"FND_ACFF_EFF_SEGMENT_SCALE": "0",
					"FND_ACFF_FlexfieldResourceBundleResId": "rev.a10008.dDOO_FULFILL_LINES_ADD_INFO..d4p.PackShipInstruction.ShippingCost",
					"FND_ACFF_JavaType": "java.math.BigDecimal",
					"FND_ACFF_MaximumValue": "999999999999999",
					"FND_ACFF_MinimumValue": "0",
					"FND_ACFF_NLS_UNIT": "Shipping Cost",
					"FND_ACFF_Precision": "15",
					"FND_ACFF_PreferredDisplayType": "TEXT_BOX",
					"FND_ACFF_Scale": "0",
					"FND_ACFF_SegmentName": "ShippingCost",
					"FND_ACFF_VF_ContextCode__PackShipInstruction": "n 15 0",
					"TOOLTIP": "Shipping Cost",
					"oj-controlType": "oj-input-text"
				}
			},
			{
				"name": "_NeedbyDate",
				"type": "date",
				"updatable": true,
				"mandatory": false,
				"queryable": true,
				"allowChanges": "always",
				"title": "Need by Date",
				"controlType": "date",
				"includeInCompactView": true,
				"properties": {
					"DISPLAYWIDTH": "100",
					"FND_ACFF_EFF_CONTEXT_SEGMENT_CODE": "NeedbyDate",
					"FND_ACFF_EFF_INDEXED_FLAG": "N",
					"FND_ACFF_EFF_SEGMENT_ATTRIBUTE": "true",
					"FND_ACFF_FlexfieldResourceBundleResId": "rev.a10008.dDOO_FULFILL_LINES_ADD_INFO..d4p.PackShipInstruction.NeedbyDate",
					"FND_ACFF_JavaType": "java.sql.Date",
					"FND_ACFF_NLS_UNIT": "Need by Date",
					"FND_ACFF_PreferredDisplayType": "DATE_TIME",
					"FND_ACFF_SegmentName": "NeedbyDate",
					"FND_ACFF_VF_ContextCode__PackShipInstruction": "d",
					"TOOLTIP": "Need by Date",
					"oj-controlType": "oj-input-date-time"
				}
			},
			{
				"name": "_PickDate",
				"type": "datetime",
				"updatable": true,
				"mandatory": false,
				"queryable": true,
				"allowChanges": "always",
				"title": "Pick Date",
				"includeInCompactView": true,
				"properties": {
					"DISPLAYWIDTH": "100",
					"FND_ACFF_DATE_TIME_SENSITIVE": "UPTZ",
					"FND_ACFF_EFF_CONTEXT_SEGMENT_CODE": "PickDate",
					"FND_ACFF_EFF_INDEXED_FLAG": "N",
					"FND_ACFF_EFF_SEGMENT_ATTRIBUTE": "true",
					"FND_ACFF_FlexfieldResourceBundleResId": "rev.a10008.dDOO_FULFILL_LINES_ADD_INFO..d4p.PackShipInstruction.PickDate",
					"FND_ACFF_JavaType": "java.sql.Timestamp",
					"FND_ACFF_NLS_UNIT": "Pick Date",
					"FND_ACFF_PreferredDisplayType": "DATE_TIME",
					"FND_ACFF_SegmentName": "PickDate",
					"FND_ACFF_VF_ContextCode__PackShipInstruction": "dt",
					"TOOLTIP": "Pick Date",
					"oj-controlType": "oj-input-date-time"
				}
			}
			],
			"collection": {
				"links": [
				{
					"rel": "self",
					"href": "https://servername/fscmRestApi/resources/version/salesOrdersForOrderHub/{id}/child/lines/{id}/child/additionalInformation/{id}/child/FulfillLineEffBPackShipInstructionprivateVO",
					"name": "self",
					"kind": "collection"
				}
				],
				"actions": [
				{
					"name": "get",
					"method": "GET",
					"responseType": [
					"application/vnd.oracle.adf.resourcecollection+json",
					"application/json"
					]
				},
				{
					"name": "create",
					"method": "POST",
					"requestType": [
					"application/vnd.oracle.adf.resourceitem+json",
					"application/json"
					],
					"responseType": [
					"application/vnd.oracle.adf.resourceitem+json",
					"application/json"
					]
				},
				{
					"name": "upsert",
					"method": "POST",
					"header": "Upsert-Mode=true",
					"requestType": [
					"application/vnd.oracle.adf.resourceitem+json",
					"application/json"
					],
					"responseType": [
					"application/vnd.oracle.adf.resourceitem+json",
					"application/json"
					]
				}
				]
			},
			"item": {
				"links": [
				{
					"rel": "self",
					"href": "https://servername/fscmRestApi/resources/version/salesOrdersForOrderHub/{id}/child/lines/{id}/child/additionalInformation/{id}/child/FulfillLineEffBPackShipInstructionprivateVO/{id}",
					"name": "self",
					"kind": "item"
				},
				{
					"rel": "parent",
					"href": "https://servername/fscmRestApi/resources/version/salesOrdersForOrderHub/{id}/child/lines/{id}/child/additionalInformation/{id}",
					"name": "parent",
					"kind": "item"
				}
				],
				"actions": [
				{
					"name": "get",
					"method": "GET",
					"responseType": [
					"application/vnd.oracle.adf.resourceitem+json",
					"application/json"
					]
				},
				{
					"name": "update",
					"method": "PATCH",
					"requestType": [
					"application/vnd.oracle.adf.resourceitem+json",
					"application/json"
					],
					"responseType": [
					"application/vnd.oracle.adf.resourceitem+json",
					"application/json"
					]
				}
				]
			},
			"FulfillLineEffBShipment__InstructionsprivateVO": {
				...
			}
		}
	}
}

Create Sales Order Line Using Header Extensible Flexfield Metadata

In this scenario, Richard creates and submits a sales order line using the order line level extensible flexfield metadata that was extracted in the previous step. This figure provides the list of attributes to be used to create a sales order line using the order line level extensible flexfield metadata.

Llist of attributes to be used to create a sales order line using the order line level extensible flexfield metadata.

The salesOrdersForOrderHub, additionalInformation resource includes the Category attribute with the value DOO_FULFILL_LINES_ADD_INFO, which represents a sales order line level extensible flexfield. Richard can set the FulfillLineEffBPackShipInstructionprivateVO as the name of the contextVO and the value of ContextCode is PackShipInstruction from the previous step to set on the extensible flexfield. Richard can set the values for _PackingInstruction, _ShippingInstruction, and _ShippingCost attributes for each segment on the extensible flexfield.

Example URL

Use this resource URL format.

POST

curl -i -X POST \
-H "Authorization:Basic c2Ntb3BlcmF0aW9uczpXZWxjb21lMQ==" \
-H "Content-Type:application/json" \
-H "REST-FRAMEWORK:4" \
-d \
'request payload' \
'https://servername/fscmRestApi/resources/version/salesOrdersForOrderHub'

Example Request

Here's an example of the request body in JSON format.

{ 
		"SourceTransactionNumber":"R13_LineEff_01",
		"SourceTransactionSystem":"GPR",
		"SourceTransactionId":"R13_LineEff_01",
		"BusinessUnitName":"Vision Operations",
		"BuyingPartyName":"Computer Service and Rentals",
		"TransactionType":"Standard Orders",
		"RequestedShipDate":"2019-10-19T20:49:12+00:00",
		"RequestedFulfillmentOrganizationName":"Vision Operations",
		"PaymentTerms":"30 Net",
		"TransactionalCurrencyName":"US Dollar",
		"RequestingBusinessUnitName":"Vision Operations",
		"FreezePriceFlag":false,
		"FreezeShippingChargeFlag":false,
		"FreezeTaxFlag":false,
		"SubmittedFlag":true,
		"SourceTransactionRevisionNumber":1,
		"lines":[ 
		{ 
			"SourceTransactionLineId":"1",
			"SourceTransactionLineNumber":"1",
			"SourceTransactionScheduleId":"1",
			"SourceScheduleNumber":"1",
			"TransactionCategoryCode":"ORDER",
			"TransactionLineType":"Buy",
			"ProductNumber":"AS92888",
			"OrderedQuantity":5,
			"OrderedUOM":"Each",
			"additionalInformation":[{
				"Category":"DOO_FULFILL_LINES_ADD_INFO",		
				"FulfillLineEffBPackShipInstructionprivateVO":[{
					"ContextCode":"PackShipInstruction",
					"_PackingInstruction":"pack 1234",
					"_ShippingInstruction":"ship 1234",
					"_ShippingCost":20,
					"_NeedbyDate":"2018-04-04",
					"_PickDate":null
				}]
			}]
		}]
	}

Example Response

Here's an example of the response body in JSON format.

{
	"HeaderId" : 300100368941962,
	"OrderNumber" : "524103",
	"SourceTransactionNumber" : "R13_LineEff_01",
	"SourceTransactionSystem" : "GPR",
	"SourceTransactionId" : "R13_LineEff_01",
	"BusinessUnitId" : 204,
	"BusinessUnitName" : "Vision Operations",
	...
	"lines" : [ {
		"HeaderId" : 300100368941962,
		"LineId" : 300100368941964,
		"FulfillLineId" : 300100368941963,
		"SourceTransactionLineId" : "1",
		"SourceTransactionLineNumber" : "1",
		"SourceTransactionId" : "R13_LineEff_01",
		"SourceTransactionNumber" : "R13_LineEff_01",
		"SourceTransactionSystem" : "GPR",
		"RequestingBusinessUnitId" : 204,
		"RequestingBusinessUnitName" : null,
		"AccountingRuleCode" : null,
		"AccountingRule" : null,
		...
		"additionalInformation" : [ {
			"Category" : "DOO_FULFILL_LINES_ADD_INFO",
			"FulfillLineId" : 300100368941963,
			"HeaderId" : 300100368941962,
			"SourceTransactionLineIdentifier" : null,
			"SourceTransactionSystem" : null,
			"SourceTransactionScheduleIdentifier" : null,
			"FulfillLineEffBPackShipInstructionprivateVO" : [ {
				"ContextCode" : "PackShipInstruction",
				"CreatedBy" : "scmoperations",
				"CreationDate" : "2020-11-16T12:17:32.172+00:00",
				"EffLineId" : 300100368941965,
				"FulfillLineId" : 300100368941963,
				"HeaderId" : null,
				"LastUpdateDate" : "2020-11-16T12:17:35.155+00:00",
				"LastUpdateLogin" : "B2E2B7CE383A3027E0534005F00A69FB",
				"LastUpdatedBy" : "scmoperations",
				"LineId" : null,
				"ObjectVersionNumber" : 1,
				"_PackingInstruction" : "pack 1234",
				"_ShippingInstruction" : "ship 1234",
				"_ShippingCost" : 20,
				"_NeedbyDate" : "2018-04-04",
				"_PickDate" : null,
				"links" : [ {
					"rel" : "self",
					"href" : "https://servername/fscmRestApi/resources/version/salesOrdersForOrderHub/GPR%3AR13_LineEff_01/child/lines/00020000000EACED00057708000110F08FE3438B0000000EACED00057708000110F08FE3438C/child/additionalInformation/300100368941963/child/FulfillLineEffBPackShipInstructionprivateVO/300100368941965",
					"name" : "FulfillLineEffBPackShipInstructionprivateVO",
					"kind" : "item",
					"properties" : {
						"changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
					}
				}, {
					"rel" : "canonical",
					"href" : "https://servername/fscmRestApi/resources/version/salesOrdersForOrderHub/GPR%3AR13_LineEff_01/child/lines/00020000000EACED00057708000110F08FE3438B0000000EACED00057708000110F08FE3438C/child/additionalInformation/300100368941963/child/FulfillLineEffBPackShipInstructionprivateVO/300100368941965",
					"name" : "FulfillLineEffBPackShipInstructionprivateVO",
					"kind" : "item"
				}, 
				{
					"rel" : "child",
					"href" : "https://servername/fscmRestApi/resources/version/salesOrdersForOrderHub/GPR%3AR13_LineEff_01/child/lines/00020000000EACED00057708000110F08FE3438B0000000EACED00057708000110F08FE3438C/child/transactionItemAttributes",
					"name" : "transactionItemAttributes",
					"kind" : "collection"
				} ]
			} ],
			"links" : [ {
				"rel" : "self",
				"href" : "https://servername/fscmRestApi/resources/version/salesOrdersForOrderHub/GPR%3AR13_LineEff_01",
				"name" : "salesOrdersForOrderHub",
				"kind" : "item",
				"properties" : {
					"changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000278"
				}
			}, {
				"rel" : "canonical",
				"href" : "https://servername/fscmRestApi/resources/version/salesOrdersForOrderHub/GPR%3AR13_LineEff_01",
				"name" : "salesOrdersForOrderHub",
				"kind" : "item"
			}, 
			...
			]
		}
	}
}