オーダー管理拡張での新しいメソッドの使用
オーダー管理拡張で新しいパブリック・メソッドを使用できます。 それらを明示的にコーディングする必要はなくなりました
次のような利点があります:
- 拡張機能をコーディングする際の柔軟性が高まります。
- 生産性が向上します。 実装の複雑さとコストを削減できます。
次の新しいメソッドを使用できます:
メソッド |
オブジェクト |
説明 |
setAttributeValues | 行 | 1行の1つ以上の属性の値を設定します。 |
isOpen |
オーダー・ヘッダー |
次のいずれかを返します:
|
isClosedOrCancelled |
オーダー・ヘッダー |
次のいずれかを返します:
|
isClosedOrCancelled |
オーダー明細 |
次のいずれかを返します:
|
isCancellationRequested |
オーダー明細 |
次のいずれかを返します:
|
isFulfilled |
オーダー明細 |
次のいずれかを返します:
|
isInvoiceInterfaced |
オーダー明細 |
次のいずれかを返します:
|
isUpdateAllowed |
オーダー明細 |
次のいずれかを返します:
|
isRowCreationAllowed |
行イテレータ |
次のいずれかを返します:
|
addExternalAssetDocumentReference |
オーダー明細 |
文書参照を作成します。 外部アセットをサブスクリプションに追加する場合に使用します。 |
addAmendSubscriptionDocumentReference |
オーダー明細 |
文書参照を作成します。 サブスクリプションを修正する場合に使用します。 |
addRenewSubscriptionDocumentReference |
オーダー明細 |
文書参照を作成します。 サブスクリプションを更新する場合に使用します。 |
例
- オーダー明細の属性の値を更新する必要があります。 isUpdateAllowedを使用して、属性を更新できるかどうかを判断できます。
- オーダー明細の支払条件を更新する必要があります。 isOpenおよびisInvoiceInterfacedを使用して、支払条件を更新できるかどうかを判断できます。
販売実績を作成する必要があるとします。 isrowCreationAllowedを使用して、親行が更新可能かどうかを確認できます:
def lines = header.getAttribute("Lines"); while( lines.hasNext() ) { def line = lines.next(); def salesCreditsIterator = line.getAttribute("SalesCredits"); if ( salesCreditsIterator.isRowCreationAllowed() ) { // Logic to create sales credit row and populate the data } }
setAttributeValuesを使用して、行オブジェクトの複数の属性の値を設定し、パフォーマンスを向上させます:
// default header attributes using setAttributeValues def orderNum = header.getAttribute("SourceTransactionNumber"); def headerData = ["PaymentTerm":"20 NET", "CustomerPONumber":orderNum]; header.setAttributeValues(headerData); // default header EFF attributes using setAttributeValues Date now = new Date(); def effData = ["compliancedatetime":now, "compliancereason":"This is a compliance reason."]; def effRow = header.getOrCreateContextRow("ComplianceDetails"); effRow.setAttributeValues(effData);
外部アセットをサブスクリプションに追加する必要があるとします。 addExternalAssetDocumentReferenceを使用して、そのサブスクリプションのドキュメント参照を作成できます:
def lines = header.getAttribute("Lines"); while( lines.hasNext() ) { def line = lines.next(); def contextRow = line.getContextRow("SubscriptionLineContext1"); if ( contextRow == null ) continue; def subscriptionContext = contextRow.getAttribute("SLCAttributeChar1"); if ( subscriptionContext == null) continue; def puid = contextRow.getAttribute("AttributeChar2"); def assetKey = contextRow.getAttribute("AttributeChar4"); if ( "Asset".equals(subscriptionContext) ) { def assetDR = line.addExternalAssetDocumentReference(assetKey, null, null, puid); } else if ( "Amend".equals(subscriptionContext) ) { def amendDR = line.addAmendSubscriptionDocumentReference(assetKey, null, null, puid); } else if ( "Renew".equals(subscriptionContext) ) { def renewDR = line.addRenewSubscriptionDocumentReference(assetKey, null, null, puid); } }
有効化のステップ
この機能を有効化するうえで必要な操作はありません。
主なリソース
アクセス要件
この権限を含む構成済ジョブ・ロールが割り当てられているユーザーは、この機能にアクセスできます。
- オーダー管理拡張の管理(FOM_MANAGE_ORDER_MANAGEMENT_EXTENTIONS)
この権限は、この更新の前から使用可能でした。