Solved

Saving data to a custom form

  • 14 December 2020
  • 2 replies
  • 315 views

Userlevel 2

I was able to create a custom Table + Custom Form
But when i try to save the record nothing Happen

 

CREATE TABLE [dbo].[ZparamAttributs](

    [CompanyID] [int] NOT NULL,

    [TexteLibre1] [nvarchar](35) NOT NULL,

PRIMARY KEY CLUSTERED 

(

    [CompanyID] ASC

)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

) ON [PRIMARY]

GO

//*************************************************************************************************

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

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

<asp:Content ID="cont1" ContentPlaceHolderID="phDS" Runat="Server">

    <px:PXDataSource ID="ds" runat="server" Visible="True" Width="100%"

        TypeName="PlanComptable.ParamAttributs"

        PrimaryView="MasterView"

        >

        <CallbackCommands>

        </CallbackCommands>

    </px:PXDataSource>

</asp:Content>

<asp:Content ID="cont2" ContentPlaceHolderID="phF" Runat="Server">

    <px:PXFormView ID="form" runat="server" DataSourceID="ds" DataMember="MasterView" Width="100%" AllowAutoHide="false">

        <Template>

            <px:PXLayoutRule ID="PXLayoutRule1" runat="server" StartRow="True"></px:PXLayoutRule>

            <px:PXTextEdit runat="server" ID="CstPXTextEdit1" DataField="TexteLibre1" /></Template>

        <AutoSize Container="Window" Enabled="True" MinHeight="200" ></AutoSize>

    </px:PXFormView>

</asp:Content>

//**************************************************************************

using System;

using PX.Data;



namespace PlanComptable

{

  public class ParamAttributs : PXGraph<ParamAttributs>

  {



    public PXSave<ZparamAttributs> Save;

    public PXCancel<ZparamAttributs> Cancel;





    public PXFilter<ZparamAttributs> MasterView;

 

    [Serializable]

  [PXCacheName("ZparamAttributs")]

  public class ZparamAttributs : IBqlTable

  {

    #region TexteLibre1

    [PXDBString(35, IsUnicode = true, InputMask = "")]

    [PXUIField(DisplayName = "Texte Libre1 Display Name")]

    public virtual string TexteLibre1 { get; set; }

    public abstract class texteLibre1 : PX.Data.BQL.BqlString.Field<texteLibre1> { }

    #endregion

  }





  }

}

icon

Best answer by Naveen Boga 14 December 2020, 13:23

View original

2 replies

Userlevel 2

Hi @SadokHanini ,


You have created a view with PXFilter, hence it is NOT saving to the database.

Please create a view PXSelect command like below and verify once.

 

 public PXSelect<ZparamAttributs> MasterView;

 

Best Regards,

Naveen B

Thanks, It’s working now U save my day as always ;) 

Userlevel 7
Badge +17

Hi @SadokHanini ,


You have created a view with PXFilter, hence it is NOT saving to the database.

Please create a view PXSelect command like below and verify once.

 

 public PXSelect<ZparamAttributs> MasterView;

 

Best Regards,

Naveen B

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved