typescript - 这里的某个地方是一个递归调用,我似乎找不到它。我必须使用 Typescript 和 Lodash 而不是 SuiteScript
问题描述
有人能找到这里发生的递归吗?我很抱歉,我是堆栈溢出的新手,所以如果我的问题描述性不够,请告诉我。
namespace X {
/**
* return an instance of the correct record type
*/
export function getTx(ctx: { currentRecord: record.ClientCurrentRecord }) {
switch (ctx.currentRecord.type) {
case record.Type.PURCHASE_ORDER:
return new PurchaseOrder(ctx.currentRecord)
case record.Type.TRANSFER_ORDER:
return new TransferOrder(ctx.currentRecord)
case record.Type.SALES_ORDER:
return new SalesOrder(ctx.currentRecord)
default:
throw new Error('unknown transaction type')
}
}
export function sublistChanged(ctx: EntryPoints.Client.sublistChangedContext) {
if (ctx.sublistId === 'item') {
const rec = X.getTx(ctx)
rec.custbody_totalitemweightorder = _.sumBy(rec.item, (line: POItemSublist | TOItemSublist | SOItemSublist) => line.quantity * line.custcol_atlas_item_weight!)
}
}
解决方案
推荐阅读
- google-apps-script - Apps 脚本(Google 表格):copyTo 功能(粘贴值)不起作用
- cordova - IBM Mobile First - 注册应用程序时的范围元素映射
- hyperledger-fabric - Hyperledger Fabric/Composer:多组织网络的架构
- jquery - 不使用 jquery 中的 foreach 循环在 Select2 中加载数据
- android - Android Firebase 存储
- python - 插入许多任意值的 Python Pandas 数据框
- c# - 在 C# 中启动 SYSPREP
- vba - Excel 2010 VBA 嵌入式图表容器的性质
- python - 最小的窗口包含数组中的所有元素
- python - 索引位置未知时切片与索引之间的区别