网格中的Acumatia excel上传按钮

时间:2017-12-11 08:28:41

标签: excel acumatica

当我点击Excel上传时,会出现“公共设置”对话框 - >列对话框出现 - >当我点击最后确定时,它显示我"操作已经完成" ,但没有行导入。 Excel文件正确,它正确检测映射。

网格:Allow upload = true

图表:

    public class KALCADisposalEntry : PXGraph<KALCADisposalEntry, KALCADisposal>
{

public PXSelect<KALCADisposal> LCADisposals;

[PXImport(typeof(KALCADisposal))]
    public PXSelectJoin<KALCADisposalDetail,
        LeftJoin<KAAsset, On<KAAsset.assetID, Equal<KALCADisposalDetail.assetID>>,
            LeftJoin<KAAssetLocationHistory, On<KAAsset.assetID, Equal<KAAssetLocationHistory.assetID>,
                 And<KAAsset.locationRevID, Equal<KAAssetLocationHistory.revisionID>>>>>,
        Where<KALCADisposalDetail.lCADisposalID, Equal<Current<KALCADisposal.lCADisposalID>>>> LCADisposalDetails;

KALCADisposal是主图表视图。

KALCADisposalDetail DAC:

namespace KA
{
    using System;
    using PX.Data;
    using PX.Objects.GL;
    using DAC;
    using DAC.Shared;

    [System.SerializableAttribute()]
    public class KALCADisposalDetail : PX.Data.IBqlTable
    {
        #region LCADisposalID
        public abstract class lCADisposalID : PX.Data.IBqlField
        {
        }
        protected int? _LCADisposalID;
        [PXDBInt()]
        [PXDBDefault(typeof(KALCADisposal.lCADisposalID))]
        [PXParent(typeof(Select<KALCADisposal,
                                 Where<KALCADisposal.lCADisposalID, Equal<Current<KALCADisposalDetail.lCADisposalID>>>>))]
        public virtual int? LCADisposalID
        {
            get
            {
                return this._LCADisposalID;
            }
            set
            {
                this._LCADisposalID = value;
            }
        }
        #endregion
        #region LCADisposalDetailID
        public abstract class lCADisposalDetailID : PX.Data.IBqlField
        {
        }
        protected int? _LCADisposalDetailID;
        [PXDBIdentity()]
        //[PXUIField(Enabled = false)]
        public virtual int? LCADisposalDetailID
        {
            get
            {
                return this._LCADisposalDetailID;
            }
            set
            {
                this._LCADisposalDetailID = value;
            }
        }
        #endregion

        #region AssetID
        public abstract class assetID : PX.Data.IBqlField
        {
        }
        protected int? _AssetID;
        [PXDBInt(IsKey = true)]
        [PXUIField(DisplayName = "Asset ID")]
        [KAAssetSelector(typeof(Search<KAAsset.assetID,
            Where<KAAsset.status, NotEqual<KAAssetStatus.hold>,
               And<KAAsset.status, NotEqual<KAAssetStatus.open>,
                   And<KAAsset.status, NotEqual<KAAssetStatus.disposed>>>>>))]
        public virtual int? AssetID
        {
            get
            {
                return this._AssetID;
            }
            set
            {
                this._AssetID = value;
            }
        }
        #endregion
        #region tstamp
        public abstract class Tstamp : PX.Data.IBqlField
        {
        }
        protected byte[] _tstamp;
        [PXDBTimestamp()]
        public virtual byte[] tstamp
        {
            get
            {
                return this._tstamp;
            }
            set
            {
                this._tstamp = value;
            }
        }
        #endregion
        #region CreatedByID
        public abstract class createdByID : PX.Data.IBqlField
        {
        }
        protected Guid? _CreatedByID;
        [PXDBCreatedByID()]
        public virtual Guid? CreatedByID
        {
            get
            {
                return this._CreatedByID;
            }
            set
            {
                this._CreatedByID = value;
            }
        }
        #endregion
        #region CreatedByScreenID
        public abstract class createdByScreenID : PX.Data.IBqlField
        {
        }
        protected string _CreatedByScreenID;
        [PXDBCreatedByScreenID()]
        public virtual string CreatedByScreenID
        {
            get
            {
                return this._CreatedByScreenID;
            }
            set
            {
                this._CreatedByScreenID = value;
            }
        }
        #endregion
        #region CreatedDateTime
        public abstract class createdDateTime : PX.Data.IBqlField
        {
        }
        protected DateTime? _CreatedDateTime;
        [PXDBCreatedDateTime()]
        public virtual DateTime? CreatedDateTime
        {
            get
            {
                return this._CreatedDateTime;
            }
            set
            {
                this._CreatedDateTime = value;
            }
        }
        #endregion
        #region LastModifiedByID
        public abstract class lastModifiedByID : PX.Data.IBqlField
        {
        }
        protected Guid? _LastModifiedByID;
        [PXDBLastModifiedByID()]
        public virtual Guid? LastModifiedByID
        {
            get
            {
                return this._LastModifiedByID;
            }
            set
            {
                this._LastModifiedByID = value;
            }
        }
        #endregion
        #region LastModifiedByScreenID
        public abstract class lastModifiedByScreenID : PX.Data.IBqlField
        {
        }
        protected string _LastModifiedByScreenID;
        [PXDBLastModifiedByScreenID()]
        public virtual string LastModifiedByScreenID
        {
            get
            {
                return this._LastModifiedByScreenID;
            }
            set
            {
                this._LastModifiedByScreenID = value;
            }
        }
        #endregion
        #region LastModifiedDateTime
        public abstract class lastModifiedDateTime : PX.Data.IBqlField
        {
        }
        protected DateTime? _LastModifiedDateTime;
        [PXDBLastModifiedDateTime()]
        public virtual DateTime? LastModifiedDateTime
        {
            get
            {
                return this._LastModifiedDateTime;
            }
            set
            {
                this._LastModifiedDateTime = value;
            }
        }
        #endregion
        #region NoteID
        public abstract class noteID : PX.Data.IBqlField
        {
        }
        protected Guid? _NoteID;
        [PXNote()]
        public virtual Guid? NoteID
        {
            get
            {
                return this._NoteID;
            }
            set
            {
                this._NoteID = value;
            }
        }
        #endregion 
    }
}

KAAssetSelector:

 public class KAAssetSelectorAttribute : PXSelectorAttribute
{
    public KAAssetSelectorAttribute() :
        base(typeof(Search<KAAsset.assetID>))
    {
        SubstituteKey = typeof(KAAsset.assetCD);
    }

    public KAAssetSelectorAttribute(Type search) : base(search)
    {
        SubstituteKey = typeof(KAAsset.assetCD);
    }
}

aspx:

<%@ Page Language="C#" MasterPageFile="~/MasterPages/FormTab.master" AutoEventWireup="true"
    ValidateRequest="false" CodeFile="KA303000.aspx.cs" Inherits="Page_KA301000" Title="Untitled Page" %>

<%@ MasterType VirtualPath="~/MasterPages/FormTab.master" %>

<asp:Content ID="cont1" ContentPlaceHolderID="phDS" runat="Server">
    <px:PXDataSource ID="ds" runat="server" Visible="True" Width="100%" TypeName="KA.KALCADisposalEntry" PrimaryView="LCADisposals">
    </px:PXDataSource>
</asp:Content>
<asp:Content ID="cont2" ContentPlaceHolderID="phF" runat="Server">
    <px:PXFormView ID="form" runat="server" DataSourceID="ds" Style="z-index: 100" Width="100%" DataMember="LCADisposals" TabIndex="5100">
        <Template>
            <px:PXLayoutRule ID="PXLayoutRule1" runat="server" StartColumn="True" LabelsWidth="S" ControlSize="S" />
            <px:PXSelector ID="edLCADisposalCD" runat="server" DataField="LCADisposalCD">
            </px:PXSelector>
            <px:PXDropDown ID="edStatus" runat="server" DataField="Status">
            </px:PXDropDown>
            <px:PXCheckBox ID="edHold" Size="S" runat="server" AlreadyLocalized="False" DataField="Hold" Text="Hold" CommitChanges="true">
            </px:PXCheckBox>
            <px:PXLayoutRule runat="server" ControlSize="S" LabelsWidth="S" StartColumn="True">
            </px:PXLayoutRule>
            <px:PXTextEdit ID="edDisposalReason" runat="server" AlreadyLocalized="False" DataField="DisposalReason" DefaultLocale="" Size="L">
            </px:PXTextEdit>
        </Template>
    </px:PXFormView>
</asp:Content>
<asp:Content ID="cont3" ContentPlaceHolderID="phG" runat="Server">
    <px:PXTab ID="tab" runat="server" Width="100%" Height="150px" DataSourceID="ds" DataMember="LCADisposalDetails">
        <Items>
            <px:PXTabItem Text="Details">
                <Template>
                    <px:PXGrid ID="PXGrid1" AdjustPageSize="Auto" runat="server" DataSourceID="ds" TabIndex="-14036" Width="100%" Height="300px" SyncPosition="True" SkinID="DetailsInTab" KeepPosition="True" TemporaryFilterCaption="Filter Applied">              
                        <Levels>
                            <px:PXGridLevel DataKeyNames="LCADisposalDetailID" DataMember="LCADisposalDetails">
                                <RowTemplate>
                                    <px:PXSelector ID="edAssetID" runat="server" DataField="AssetID" CommitChanges="True" AutoRefresh="True" AllowEdit="true">
                                    </px:PXSelector>
                                    <px:PXTextEdit ID="edKAAsset__Description" runat="server" AlreadyLocalized="False" DataField="KAAsset__Description" DefaultLocale="">
                                    </px:PXTextEdit>
                                    <px:PXDropDown ID="edKAAsset__Status" runat="server" DataField="KAAsset__Status">
                                    </px:PXDropDown>
                                    <px:PXDropDown ID="edKAAsset__Condition" runat="server" DataField="KAAsset__Condition">
                                    </px:PXDropDown>
                                    <px:PXSelector ID="edKAAsset__UOM" runat="server" DataField="KAAsset__UOM">
                                    </px:PXSelector>
                                    <px:PXNumberEdit ID="edKAAsset__Cost" runat="server" AlreadyLocalized="False" DataField="KAAsset__Cost" DefaultLocale="">
                                    </px:PXNumberEdit>
                                    <px:PXSelector ID="edKAAssetLocationHistory__BuildingID" runat="server" DataField="KAAssetLocationHistory__BuildingID">
                                    </px:PXSelector>
                                    <px:PXTextEdit ID="edKAAssetLocationHistory__Floor" runat="server" AlreadyLocalized="False" DataField="KAAssetLocationHistory__Floor" DefaultLocale="">
                                    </px:PXTextEdit>
                                    <px:PXTextEdit ID="edKAAssetLocationHistory__Room" runat="server" AlreadyLocalized="False" DataField="KAAssetLocationHistory__Room" DefaultLocale="">
                                    </px:PXTextEdit>
                                    <px:PXSelector ID="edKAAssetLocationHistory__EmployeeID" runat="server" DataField="KAAssetLocationHistory__EmployeeID">
                                    </px:PXSelector>
                                    <px:PXSelector ID="edKAAssetLocationHistory__Department" runat="server" DataField="KAAssetLocationHistory__Department">
                                    </px:PXSelector>
                                    <px:PXSegmentMask ID="edKAAssetLocationHistory__SiteID" runat="server" DataField="KAAssetLocationHistory__SiteID">
                                    </px:PXSegmentMask>
                                </RowTemplate>
                                <Columns>           
                                    <px:PXGridColumn DataField="AssetID" CommitChanges="True">
                                    </px:PXGridColumn>
                                    <px:PXGridColumn DataField="KAAsset__Description" Width="200px">
                                    </px:PXGridColumn>
                                    <px:PXGridColumn DataField="KAAsset__Cost" TextAlign="Right" Width="100px">
                                    </px:PXGridColumn>
                                    <px:PXGridColumn DataField="KAAsset__UOM">
                                    </px:PXGridColumn>
                                      <px:PXGridColumn DataField="KAAssetLocationHistory__BranchID">
                                    </px:PXGridColumn>
                                    <px:PXGridColumn DataField="KAAssetLocationHistory__BuildingID">
                                    </px:PXGridColumn>
                                    <px:PXGridColumn DataField="KAAssetLocationHistory__Floor">
                                    </px:PXGridColumn>
                                    <px:PXGridColumn DataField="KAAssetLocationHistory__Room">
                                    </px:PXGridColumn>
                                    <px:PXGridColumn DataField="KAAssetLocationHistory__EmployeeID" Width="120px">
                                    </px:PXGridColumn>
                                    <px:PXGridColumn DataField="KAAssetLocationHistory__Department">
                                    </px:PXGridColumn>
                                    <px:PXGridColumn DataField="KAAssetLocationHistory__SiteID" Width="120px">
                                    </px:PXGridColumn>
                                    <px:PXGridColumn DataField="KAAsset__Status">
                                    </px:PXGridColumn>
                                    <px:PXGridColumn DataField="KAAsset__Condition">
                                    </px:PXGridColumn>

                                </Columns>

                            </px:PXGridLevel>
                        </Levels>
                        <Mode AllowUpload="True" />
                    </px:PXGrid>
                </Template>
            </px:PXTabItem>
        </Items>
        <AutoSize Container="Window" Enabled="True" MinHeight="150" />
    </px:PXTab>
</asp:Content>

正如您所见<Mode AllowUpload="True" />标记内的<px:PXGrid>

上传excel后的页面屏幕:

enter image description here

正如您所看到的那样,它在网格上显示了分页左箭头,但没有导入任何行。

我错过了什么?

1 个答案:

答案 0 :(得分:1)

从AssetID中删除选择器(KAAssetSelector)后,问题已修复。

我认为这是一个错误