Question

How do I get a form I created to pull up existing records?


Userlevel 5
Badge +1

I have created a custom table and form to use to import invoice data from our old system. I set up a selector on the OrderNo field from the custom table which works for showing the list of all the imported orders.  How do I go about getting this to pull up the existing record when I select it from the selector?  I feel like I’m missing something but followed the instructions in the Training Guide to set this up as best I could.  I cannot use Visual Studio to design so had to do everything in the customization project.

One thing to note, I have successfully set up an import scenario and using the import scenario it does find and import/update existing records successfully.  However if I just open the screen, click the selector and choose the orderno from the selector the screen the screen just stays the same. It doesn’t jump to the record.  Do I need to create some sort of event handler for what to do once the field is updated or should it be working without?

Thanks for any advice you can give,

 

Phil


8 replies

Userlevel 7
Badge +5

As an aside, you can use the free version of Visual Studio to do your Acumatica development.

T220 should cover what you’re looking for. 

Does your Graph have a primary view setup?  You set up the PrimaryView value of the datasource property on your screen to match the primary view?

Userlevel 5
Badge +1

@ddunn Unfortunately, currently I’m using an M1 Mac and there is currently no way to get the development environment installed in parallels so visual studio is not an option yet. Additionally I can only ‘play’ with customizations when nobody else is in the system.

The graph is as follows:

using System;
using PX.Data;
using PX.Data.BQL.Fluent;

namespace PPCreateAIEverestData
{
public class AIEverestOrderDataForm : PXGraph<AIEverestOrderDataForm, CustAIEverestData>
{

public SelectFrom<CustAIEverestData>.View AIEverestDataInputForm;

public PXSave<CustAIEverestData> Save;
public PXCancel<CustAIEverestData> Cancel;


public PXFilter<MasterTable> MasterView;
public PXFilter<DetailsTable> DetailsView;

[Serializable]
public class MasterTable : IBqlTable
{

}

[Serializable]
public class DetailsTable : IBqlTable
{

}


}
}

Do I still need the references to masterView and detailsview and will removing them help?

Thanks,

 

Phil

 

Userlevel 7
Badge +5

You will eventually remove them but you want to keep them around for a few steps otherwise you can get stuck and have to redo your work.

Is this a header/detail situation?  Or is each of your invoices just a single row of data?

I ask because that impacts your screen design choices.

I think what you have looks correct so then you’re on to the creation of your screen.

Userlevel 7
Badge +5

Oh - and show the DAC code, too, just to make sure that the issue isn’t there.

Userlevel 5
Badge +1

@ddunn I really appreciate it.  It’s a single line for an invoice for this.  I was just mainly trying to get something together quickly to import the data from an Excel file.  I’ve managed to import 20,000 records successfully into the form I created.  The plan is to use GI’s and reports to link the data to the Customers in Acumatica to report on historical data so I hadn’t really planned on setting up forms to view the data.  I just wanted a quick and possibly dirty way of getting the data in ASAP.  The DAC code is below. It was autogenerated by Acumatica but I added the Selector myself. I may not have done things correctly.  I hadn’t planned on setting up master detail forms but we do have order line data I will need to import later and it might be helpful to be able to look at an order and see the lines in that way too.

 

using System;
using PX.Data;

namespace PPCreateAIEverestData
{
[Serializable]
[PXCacheName("CustAIEverestData")]
public class CustAIEverestData : IBqlTable
{
#region EverestDataID
[PXDBIdentity(IsKey = true)]
public virtual int? EverestDataID { get; set; }
public abstract class everestDataID : PX.Data.BQL.BqlInt.Field<everestDataID> { }
#endregion

#region CustCode
[PXDBString(20, IsFixed = true, InputMask = "")]
[PXUIField(DisplayName = "Cust Code")]
public virtual string CustCode { get; set; }
public abstract class custCode : PX.Data.BQL.BqlString.Field<custCode> { }
#endregion

#region CustName
[PXDBString(50, IsFixed = true, InputMask = "")]
[PXUIField(DisplayName = "Cust Name")]
public virtual string CustName { get; set; }
public abstract class custName : PX.Data.BQL.BqlString.Field<custName> { }
#endregion

#region EverestOrderDate
[PXDBDate()]
[PXUIField(DisplayName = "Everest Order Date")]
public virtual DateTime? EverestOrderDate { get; set; }
public abstract class everestOrderDate : PX.Data.BQL.BqlDateTime.Field<everestOrderDate> { }
#endregion

#region EverestOrderNo
[PXDBString(20, IsFixed = true, InputMask = "", IsKey = true)]
[PXDefault]
[PXUIField(DisplayName = "Everest Order No")]
[PXSelector(typeof(Search<CustAIEverestData.everestOrderNo>),
typeof(CustAIEverestData.everestOrderNo),
typeof(CustAIEverestData.custCode),
typeof(CustAIEverestData.custName))]
public virtual string EverestOrderNo { get; set; }
public abstract class everestOrderNo : PX.Data.BQL.BqlString.Field<everestOrderNo> { }
#endregion

#region EverestSalesRep
[PXDBString(10, IsFixed = true, InputMask = "")]
[PXUIField(DisplayName = "Everest Sales Rep")]
public virtual string EverestSalesRep { get; set; }
public abstract class everestSalesRep : PX.Data.BQL.BqlString.Field<everestSalesRep> { }
#endregion

#region EverestTerms
[PXDBString(20, IsFixed = true, InputMask = "")]
[PXUIField(DisplayName = "Everest Terms")]
public virtual string EverestTerms { get; set; }
public abstract class everestTerms : PX.Data.BQL.BqlString.Field<everestTerms> { }
#endregion

#region EverestTaxable
[PXDBDecimal()]
[PXUIField(DisplayName = "Everest Taxable")]
public virtual Decimal? EverestTaxable { get; set; }
public abstract class everestTaxable : PX.Data.BQL.BqlDecimal.Field<everestTaxable> { }
#endregion

#region EverestTaxAmount
[PXDBDecimal()]
[PXUIField(DisplayName = "Everest Tax Amount")]
public virtual Decimal? EverestTaxAmount { get; set; }
public abstract class everestTaxAmount : PX.Data.BQL.BqlDecimal.Field<everestTaxAmount> { }
#endregion

#region EverestInvoiceAmount
[PXDBDecimal()]
[PXUIField(DisplayName = "Everest Invoice Amount")]
public virtual Decimal? EverestInvoiceAmount { get; set; }
public abstract class everestInvoiceAmount : PX.Data.BQL.BqlDecimal.Field<everestInvoiceAmount> { }
#endregion

#region EverestFOB
[PXDBString(20, IsFixed = true, InputMask = "")]
[PXUIField(DisplayName = "Everest FOB")]
public virtual string EverestFOB { get; set; }
public abstract class everestFOB : PX.Data.BQL.BqlString.Field<everestFOB> { }
#endregion

#region EverestDeliveryMethod
[PXDBString(20, IsFixed = true, InputMask = "")]
[PXUIField(DisplayName = "Everest Delivery Method")]
public virtual string EverestDeliveryMethod { get; set; }
public abstract class everestDeliveryMethod : PX.Data.BQL.BqlString.Field<everestDeliveryMethod> { }
#endregion

#region EverestWeight
[PXDBDecimal()]
[PXUIField(DisplayName = "Everest Weight")]
public virtual Decimal? EverestWeight { get; set; }
public abstract class everestWeight : PX.Data.BQL.BqlDecimal.Field<everestWeight> { }
#endregion

#region EverestTracking
[PXDBString(50, IsFixed = true, InputMask = "")]
[PXUIField(DisplayName = "Everest Tracking")]
public virtual string EverestTracking { get; set; }
public abstract class everestTracking : PX.Data.BQL.BqlString.Field<everestTracking> { }
#endregion

#region CreatedDateTime
[PXDBCreatedDateTime()]
public virtual DateTime? CreatedDateTime { get; set; }
public abstract class createdDateTime : PX.Data.BQL.BqlDateTime.Field<createdDateTime> { }
#endregion

#region CreatedByID
[PXDBCreatedByID()]
public virtual Guid? CreatedByID { get; set; }
public abstract class createdByID : PX.Data.BQL.BqlGuid.Field<createdByID> { }
#endregion

#region CreatedByScreenID
[PXDBCreatedByScreenID()]
public virtual string CreatedByScreenID { get; set; }
public abstract class createdByScreenID : PX.Data.BQL.BqlString.Field<createdByScreenID> { }
#endregion

#region LastModifiedDateTime
[PXDBLastModifiedDateTime()]
public virtual DateTime? LastModifiedDateTime { get; set; }
public abstract class lastModifiedDateTime : PX.Data.BQL.BqlDateTime.Field<lastModifiedDateTime> { }
#endregion

#region LastModifiedByID
[PXDBLastModifiedByID()]
public virtual Guid? LastModifiedByID { get; set; }
public abstract class lastModifiedByID : PX.Data.BQL.BqlGuid.Field<lastModifiedByID> { }
#endregion

#region LastModifiedByScreenID
[PXDBLastModifiedByScreenID()]
public virtual string LastModifiedByScreenID { get; set; }
public abstract class lastModifiedByScreenID : PX.Data.BQL.BqlString.Field<lastModifiedByScreenID> { }
#endregion

#region Tstamp
[PXDBTimestamp()]
[PXUIField(DisplayName = "Tstamp")]
public virtual byte[] Tstamp { get; set; }
public abstract class tstamp : PX.Data.BQL.BqlByteArray.Field<tstamp> { }
#endregion

#region NoteID
[PXNote()]
public virtual Guid? NoteID { get; set; }
public abstract class noteID : PX.Data.BQL.BqlGuid.Field<noteID> { }
#endregion
}
}

 

 

 

Userlevel 5
Badge +1

For completeness here is the SQL to create the table:

IF Not Exists(select * from sys.tables where name = 'CustAIEverestData') 
CREATE TABLE [dbo].[CustAIEverestData](
[CompanyID] [int] NOT NULL,
[EverestDataID] [int] IDENTITY(1,1) NOT NULL,
[CustCode] [char] (20) NOT NULL,
[CustName] [char] (50),
[EverestOrderDate] [datetime] NOT NULL,
[EverestOrderNo] [char] (20) UNIQUE,
[EverestSalesRep] [char] (10) NOT NULL,
[EverestTerms] [char] (20) NOT NULL,
[EverestTaxable] [decimal] NOT NULL,
[EverestTaxAmount] [decimal] NOT NULL,
[EverestInvoiceAmount] [decimal] NOT NULL,
[EverestFOB] [char] (20),
[EverestDeliveryMethod] [char] (20),
[EverestWeight] [decimal] NOT NULL,
[EverestTracking] [char] (50),
[CreatedDateTime] [datetime] NOT NULL,
[CreatedByID] [uniqueidentifier] NOT NULL,
[CreatedByScreenID] [char](8) NOT NULL,
[LastModifiedDateTime] [datetime] NOT NULL,
[LastModifiedByID] [uniqueidentifier] NOT NULL,
[LastModifiedByScreenID] [char](8) NOT NULL,
[tstamp] [timestamp] NOT NULL,
[NoteID] [uniqueidentifier] NOT NULL,
CONSTRAINT [PK_CustAIEverestData] PRIMARY KEY CLUSTERED
(
[CompanyID] ASC,
[EverestDataID] 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

ALTER TABLE [dbo].[CustAIEverestData] ADD CONSTRAINT [DF_CustAIEverestData_CompanyID] DEFAULT ((0)) FOR [CompanyID]
GO

It’s quite possible I haven’t defined it correctly as I’m going by looking at the example and cobbling together something similar using the fields we need to import.

Userlevel 7
Badge

Hi @ppowell - were your previous posts the solution for your issue? Thank you!

Userlevel 5
Badge +1

Hi @Chris Hackett, the previous posts were in answer to ddunn.  I haven’t managed to resolve the issue but this became a lower priority as I really only wanted to use the form to pull in records and make sure duplicate records didn’t go in twice in the first place.  As the import scenario does that I need to revisit this later if I can’t work out how after following the training guides.  I previously didn’t have access to Visual Studio which hampered my following the guides but just got a suitable windows machine so have a separate development environment for further testing.

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