gpt4 book ai didi

reporting-services - x++ 从 recid 获取资源名称

转载 作者:行者123 更新时间:2023-12-04 07:59:23 26 4
gpt4 key购买 nike

我已经对项目事务报告 (projlisttransproj) 进行了大量自定义,并且我正在显示资源 ID。我想改为显示此资源的名称(请参阅插入方法)。我对 x++ 开发相当陌生,所以步骤by step 将不胜感激。我查看了 projtrans 类并在下面找到了,但没有发现任何涉及名称的内容...谢谢!

/// <summary>
/// Retrieves the ID of the employee that is associated with this transaction depending on the
/// transaction type that is returned by the <c>ProjTrans.transType</c> method.
/// </summary>
/// <returns>
/// The <c>RecID</c> value of the employee that is associated with this transaction.
/// </returns>
/// <remarks>
/// For hour, cost, and revenue transactions, the employee ID will be returned. For all other
/// transactions, 0 will be returned.
/// </remarks>
public ResourceRecId projIdentResource()
{
ResourceRecId resourceRecId;

switch(this.transType())
{
case ProjTransType::Hour:
case ProjTransType::Cost:
case ProjTransType::Revenue:
resourceRecId = this.resource();
break;
default:
resourceRecId = 0;
}

return resourceRecId;
}

enter image description here

public void insertProjTransList()
{
tmpProjTransListExtension.clear();
tmpProjTransListExtension.VoucherInvoice = projTrans.voucherInvoice();
tmpProjTransListExtension.VoucherJournal = projTrans.voucherOriginal();
tmpProjTransListExtension.LinePropertyId = projTrans.linePropertyId();
tmpProjTransListExtension.ActivityNumber = projTrans.activityNumber();
tmpProjTransListExtension.CategoryId = projTrans.categoryId();
tmpProjTransListExtension.CostPrice = projTrans.costPrice();
tmpProjTransListExtension.CurrencyId = projTrans.currencyIdSales();
tmpProjTransListExtension.DefaultDimension = projTrans.defaultDimension();
tmpProjTransListExtension.SalesAmount = projTrans.transTurnoverMST();
tmpProjTransListExtension.CostAmount = projTrans.transCostMST();
tmpProjTransListExtension.ProjIdOrig = projTrans.projId();
tmpProjTransListExtension.ProjId = firstProjId;
tmpProjTransListExtension.Qty = projTrans.qty();
tmpProjTransListExtension.SalesPrice = projTrans.salesPrice();
tmpProjTransListExtension.TransDate = projTrans.transDate();
tmpProjTransListExtension.Txt = projTrans.txt();
tmpProjTransListExtension.TransType = projTrans.transType();
tmpProjTransListExtension.ProjId = firstProjId;
TmpProjTransListExtension.ProjName = firstProjName;
tmpProjTransListExtension.Type = ProjCategory::find(projTrans.categoryId()).CategoryType;
TmpProjTransListExtension.Resource = ProjTrans.resource(); //Want Name of resource not ID
tmpProjTransListExtension.insert();
}

最佳答案

您可以使用HcmWorker::find(ProjTrans.resource()).name() 获取 worker 姓名.

关于reporting-services - x++ 从 recid 获取资源名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43681681/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com