Skip to main content
Solved

Saving data to a custom form

  • 14 December 2020
  • 2 replies
  • 328 views

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] Dint] NOT NULL,

     TexteLibre1] rnvarchar](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;

 

    
  XPXCacheName("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

  }





  }

}

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


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 ;) 


Reply