【问题标题】:Retrieve information using Barcode EAN128使用条码 EAN128 检索信息
【发布时间】:2014-04-30 07:57:53
【问题描述】:

我需要使用条形码 EAN128 进行一些数据检索。

表单中必须有2个控件;第一个是itemId,第二个是nameAlias,都来自inventTable。我的问题是,当用户扫描itemId 时,它也必须在第二个控件中检索nameAlias。因此,我在表中创建了两种显示方法,用作数据源。

我将这些方法拖到我的表单设计中。

这是第一个控件的代码:

public display BarcodeString myB()
{
  Barcode barcode;
  InventTable inv;
  ;
  barcode = Barcode::construct(BarcodeType::EAN128);
  barcode.string(true, inv.ItemId);
  barcode.encode();

  return barcode.barcodeStr();
}

这是第二个控件的代码,它必须检索 nameAlias

Public display ItemNameAlias qty()
{
  return InventTable::find(this.myB()).NameAlias;
}

提前感谢您的帮助。

【问题讨论】:

  • 以后请不要截图你的代码。将其复制并粘贴到此处;这将使我们更容易使用它并帮助您解决问题。
  • 好的,我会预见到你的评论

标签: barcode axapta x++ dynamics-ax-2012


【解决方案1】:

您混淆了条码打印和条码数据输入。

打印时,您需要将您的商品 ID 处理为适合条形码字体的字符串。 这就是barcodeStr 方法的作用。

进入时您需要扫描仪。扫描仪会为您提供您的项目 ID,就像您自己输入一样。因此不需要对条形码进行进一步处理。扫描仪负责处理。

如果您的表中有ItemId 字段,则为该表创建一个显示方法:

display ItemNameAlias nameAlias()
{
    return InventTable::find(this.ItemId).NameAlias;
}

不要将方法复制到表单中,而是从表单as described here 中引用它。 在您的表单中,您将有两个控件,ItemId 绑定到您的字段,nameAlias 引用您的显示方法。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-12
    • 2021-09-08
    • 2021-12-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-07
    相关资源
    最近更新 更多