您好,Acumatica开发中的新手
所以我试图通过pxaction按钮单击来获取文本框的值
图像中外部链接的值就是我想要得到的
图片1:
图片2:
公共PXAction AddtoLazada;
[PXButton(CommitChanges = true)]
[PXUIField(DisplayName = "Add image to Lazada")]
protected virtual void addtoLazada()
{
UploadFileWithIDSelector getval = new UploadFileWithIDSelector();
var externalval = getval.ExternalLink.ToString();
}
但是我没有将对象引用设置为实例
答案 0 :(得分:0)
此处getval.ExternalLink
的值为空。您会收到此异常,因为您为ToString()
对象调用了null
public PXAction<UploadFileWithIDSelector> AddtoLazada;
[PXButton(CommitChanges = true)]
[PXUIField(DisplayName = "Add image to Lazada")]
public virtual IEnumerable addtoLazada(PXAdapter adapter)
{
if (this.Base.Files.Current != null)
{
var externalval = this.Base.Files.Current.ExternalLink;
}
return adapter.Get();
}