【问题标题】:Convert SDT data to BC in Genexus在 Genexus 中将 SDT 数据转换为 BC
【发布时间】:2018-12-03 22:04:31
【问题描述】:

我用 Genexus 15 中的数据填充了 SDT,需要将其保存在事务中。 SDT 有一个包含标题信息和详细项目的两级结构。

我尝试使用此 DataProvider 但出现问题,因为我在尝试执行它时遇到外键违规错误:

规则:

parm(in: &NewInvoice); // SDT variable

来源:

DPInvoice 
{
    StampId = &NewInvoice.StampId
    InvoiceNumber = &NewInvoice.InvoiceNumber
    CustomerId = &NewInvoice.CustomerId
    Concept
    {
        ProductId = &NewInvoice.Concept.CurrentItem.ProductId
        ConceptQty = &NewInvoice.Concept.CurrentItem.ConceptQty
    }
}

Webpanel 中触发 DP 的事件:

&Invoice = DPInvoice(&NewInvoice)
&Invoice.Insert()
commit

This is the transaction structure

This is the SDT Structure

请帮帮我!

【问题讨论】:

    标签: dataprovider genexus bc


    【解决方案1】:

    你必须遍历&NewInvoice的第二层。

    在DataProvider中定义一个SDTInvoiceCopy1.ConceptItem类型的变量&NewInvoiceItem,并使用如下源码:

    DPInvoice 
    {
        StampId = &NewInvoice.StampId
        InvoiceNumber = &NewInvoice.InvoiceNumber
        CustomerId = &NewInvoice.CustomerId
        Concept Input &NewInvoiceItem in &NewInvoice.Concept
        {
            ProductId = &NewInvoiceItem.ProductId
            ConceptQty = &NewInvoiceItem.ConceptQty
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-12
      • 2017-06-02
      • 2018-07-10
      • 2021-11-30
      • 1970-01-01
      相关资源
      最近更新 更多