Question

I get null data when I update a record.

  • 22 December 2023
  • 10 replies
  • 134 views

The issue is that when changing a field, Acumatica pulls null values. Some fields retrieve values correctly, but others, such as BranchID, do not. At the same time, and perhaps related to my issue, the amount fields like January, February, etc., have commitChanges, and when I alter one of these fields, the others are set to 0.

 

This is my code:


using System;
using System.Runtime.CompilerServices;
using PX.Common;
using PX.CS;
using PX.Data;
using PX.Data.BQL;

using PX.Data.BQL.Fluent;
using PX.Data.Maintenance.GI;
using PX.Data.ReferentialIntegrity.Attributes;
using PX.Objects.AR;
using PX.Objects.CS;
using PX.Objects.GL;
using PX.Objects.IN;
using static PX.SM.RowNewFile;
using CSAttribute = PX.CS.CSAttribute;
using CSAttributeDetail = PX.CS.CSAttributeDetail;


namespace SalesReport
{
public class BudgetCustomer : PXGraph<BudgetCustomer>
{

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


public PXFilter<BudgetFilter> Filter;


public SelectFrom<PESRCustomer>
.Where<
PESRCustomer.branchID.IsEqual<BudgetFilter.branchID.FromCurrent>
.And<PESRCustomer.ledgerID.IsEqual<BudgetFilter.ledgerID.FromCurrent>>
.And<PESRCustomer.finYear.IsEqual<BudgetFilter.finYear.FromCurrent>>
>
.View Budget;

protected void PESRCustomer_CustomerID_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
PESRCustomer miRegistro = (PESRCustomer)e.Row;
UpdateName(4, miRegistro);
}
protected virtual void _(Events.FieldUpdated<PESRCustomer, PESRCustomer.customerClassID> e)
{
PESRCustomer miRegistro = e.Row;
UpdateName(3, miRegistro);
}
protected virtual void _(Events.FieldUpdated<PESRCustomer, PESRCustomer.busenissID> e)
{
PESRCustomer miRegistro = e.Row;
UpdateName(1, miRegistro);
}
protected virtual void _(Events.FieldUpdated<PESRCustomer, PESRCustomer.productClassID> e)
{
PESRCustomer miRegistro = e.Row;
UpdateName(2, miRegistro);
}

protected virtual void _(Events.RowSelected<PESRCustomer> e)
{
PESRCustomer miRegistro = e.Row;

UpdateName(1, miRegistro);
UpdateName(2, miRegistro);
UpdateName(3, miRegistro);
UpdateName(4, miRegistro);
}

protected void UpdateName(int Indices, PESRCustomer miRegistro)
{
switch (Indices)
{
case 1:
if (miRegistro != null)
{
CSAttributeDetail busniss =
SelectFrom<CSAttributeDetail>
.Where<CSAttributeDetail.attributeID.IsEqual<@P.AsString>
.And<CSAttributeDetail.valueID.IsEqual<@P.AsString>>
>.View.Select(this, "SRBUSINESS", miRegistro.BusenissID);

if (busniss != null)
{
miRegistro.BusenissName = busniss.Description;
}
}
break;
case 2:
if (miRegistro != null)
{
INItemClass itemclasses = SelectFrom<INItemClass>.Where<INItemClass.itemClassID.IsEqual<@P.AsInt>>.View.Select(this, miRegistro.ProductClassID);
if (itemclasses != null)
{
miRegistro.ProductClassName = itemclasses.Descr;
}
}

break;
case 3:
if (miRegistro != null)
{
CustomerClass customerclassDescripcion = SelectFrom<CustomerClass>.Where<CustomerClass.customerClassID.IsEqual<@P.AsString>>.View.Select(this, miRegistro.CustomerClassID);
if (customerclassDescripcion != null)
{
miRegistro.CustomerClassName = customerclassDescripcion.Descr;
}
}

break;
case 4:
if (miRegistro != null)
{
Customer customer = PXSelect<Customer, Where<Customer.bAccountID, Equal<Required<Customer.bAccountID>>>>.Select(this, miRegistro.CustomerID);
if (customer != null)
{
miRegistro.CustomerName = customer.AcctName;
}
}
break;

}
}
}
#region PESRCustomer
[Serializable]
[PXCacheName("PESRCustomer")]
public class PESRCustomer : IBqlTable
{


#region Constantes
public static class SRBUSINESSConstants
{
public const string SRBusiness = "SRBUSINESS";
}
public class srbusiness : PX.Data.BQL.BqlString.Constant<srbusiness>
{
public srbusiness() : base(SRBUSINESSConstants.SRBusiness) { }
}
#endregion


#region BranchID
[Branch(typeof(BudgetFilter.branchID))]
public virtual int? BranchID { get; set; }
public abstract class branchID : PX.Data.BQL.BqlInt.Field<branchID> { }
#endregion

#region LedgerID
[PXDBInt(IsKey = true)]
[PXDefault(typeof(BudgetFilter.ledgerID))]
[PXUIField(Enabled = false, Visible = false)]//, Visible = false, Visibility = PXUIVisibility.Invisible
[PXSelector(typeof(Ledger.ledgerID), SubstituteKey = typeof(Ledger.ledgerCD))]
public virtual int? LedgerID { get; set; }
public abstract class ledgerID : PX.Data.BQL.BqlInt.Field<ledgerID> { }
#endregion
#region FinYear
[PXDBString(4, IsKey = true, IsFixed = true, InputMask = "")]
[PXDefault(typeof(BudgetFilter.finYear))]
[PXUIField(DisplayName = "Fin Year", Visible = false)]
public virtual string FinYear { get; set; }
public abstract class finYear : PX.Data.BQL.BqlString.Field<finYear> { }
#endregion



#region BusenissID
[PXDBString(9, IsKey = true)]
[PXUIField(DisplayName = "Business")]
[PXSelector(typeof(Search5<CSAttributeDetail.valueID,
InnerJoin<CSAttribute, On<CSAttribute.attributeID, Equal<CSAttributeDetail.attributeID>>>,
Where<CSAttribute.attributeID, Equal<srbusiness>>,
Aggregate<GroupBy<CSAttributeDetail.valueID>>,
OrderBy<Asc<CSAttributeDetail.valueID>>
>),
typeof(CSAttributeDetail.valueID), typeof(CSAttributeDetail.description),
DescriptionField = typeof(CSAttributeDetail.description)

)]
public virtual string BusenissID { get; set; }
public abstract class busenissID : PX.Data.BQL.BqlString.Field<busenissID> { }
#endregion
#region BusenissName

[PXString(250)]
[PXUIField(DisplayName = "Buseniss Name", IsReadOnly = true)]

public virtual string BusenissName { get; set; }
public abstract class busenissName : PX.Data.BQL.BqlString.Field<busenissName> { }
#endregion
#region ProductClassID
[PXDBInt(IsKey = true)]
[PXUIField(DisplayName = "Item Class ID", Visibility = PXUIVisibility.SelectorVisible)]
[PXSelector(typeof(Search<INItemClass.itemClassID>),
SubstituteKey = typeof(INItemClass.itemClassCD),
DescriptionField = typeof(INItemClass.descr), ValidateValue = false)]
public virtual int? ProductClassID { get; set; }
public abstract class productClassID : PX.Data.BQL.BqlInt.Field<productClassID> { }
#endregion
#region ProductClassName
[PXString(250)]
[PXUIField(DisplayName = "Item Class Name", IsReadOnly = true)]

public virtual string ProductClassName { get; set; }
public abstract class productClassName : PX.Data.BQL.BqlString.Field<productClassName> { }
#endregion
#region CustomerClassID
[PXDBString(18, IsKey = true, IsUnicode = true)]
[PXSelector(typeof(Search<CustomerClass.customerClassID>),
typeof(CustomerClass.customerClassID),
SubstituteKey = typeof(CustomerClass.customerClassID),
DescriptionField = typeof(CustomerClass.descr))]
[PXUIField(DisplayName = "Customer Class ID", Visibility = PXUIVisibility.SelectorVisible)]
public virtual string CustomerClassID { get; set; }
public abstract class customerClassID : PX.Data.BQL.BqlString.Field<customerClassID> { }
#endregion
#region CustomerClassName
[PXString(250)]
[PXUIField(DisplayName = "Customer Class Name", IsReadOnly = true)]
public virtual string CustomerClassName { get; set; }
public abstract class customerClassName : PX.Data.BQL.BqlString.Field<customerClassName> { }
#endregion
#region CustomerID
[PXDBInt(IsKey = true)]
[PXSelector(typeof(Customer.bAccountID), typeof(Customer.acctCD), typeof(Customer.acctName),
SubstituteKey = typeof(Customer.acctCD),
DescriptionField = typeof(Customer.acctName))]
[PXUIField(DisplayName = "Customer ID")]
public virtual int? CustomerID { get; set; }
public abstract class customerID : PX.Data.BQL.BqlInt.Field<customerID> { }
#endregion
#region CustomerName
[PXString(250)]
[PXUIField(DisplayName = "Customer Name", IsReadOnly = true)]

public virtual string CustomerName { get; set; }
public abstract class customerName : PX.Data.BQL.BqlString.Field<customerName> { }
#endregion

#region Amount
[PXDBDecimal()]
[PXUIField(DisplayName = "Amount")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? Amount { get; set; }
public abstract class amount : PX.Data.BQL.BqlDecimal.Field<amount> { }
#endregion

#region AllocatedAmount
[PXDBDecimal()]
[PXUIField(DisplayName = "Allocated Amount", Enabled = false)]
[PXDefault(TypeCode.Decimal, "0.0")]

[PXFormula(typeof(Add<finPeriod01, Add<finPeriod02, Add<finPeriod03, Add<finPeriod04, Add<finPeriod05, Add<finPeriod06, Add<finPeriod07, Add<finPeriod08, Add<finPeriod09, Add<finPeriod10, Add<finPeriod11, Add<finPeriod12, finPeriod13>>>>>>>>>>>>))]
public virtual Decimal? AllocatedAmount { get; set; }
public abstract class allocatedAmount : PX.Data.BQL.BqlDecimal.Field<allocatedAmount> { }
#endregion
#region FinPeriod01
[PXDBDecimal()]
[PXUIField(DisplayName = "January")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod01 { get; set; }
public abstract class finPeriod01 : PX.Data.BQL.BqlDecimal.Field<finPeriod01> { }
#endregion

#region FinPeriod02
[PXDBDecimal()]
[PXUIField(DisplayName = "February")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod02 { get; set; }
public abstract class finPeriod02 : PX.Data.BQL.BqlDecimal.Field<finPeriod02> { }
#endregion

#region FinPeriod03
[PXDBDecimal()]
[PXUIField(DisplayName = "March")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod03 { get; set; }
public abstract class finPeriod03 : PX.Data.BQL.BqlDecimal.Field<finPeriod03> { }
#endregion

#region FinPeriod04
[PXDBDecimal()]
[PXUIField(DisplayName = "April")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod04 { get; set; }
public abstract class finPeriod04 : PX.Data.BQL.BqlDecimal.Field<finPeriod04> { }
#endregion

#region FinPeriod05
[PXDBDecimal()]
[PXUIField(DisplayName = "May")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod05 { get; set; }
public abstract class finPeriod05 : PX.Data.BQL.BqlDecimal.Field<finPeriod05> { }
#endregion

#region FinPeriod06
[PXDBDecimal()]
[PXUIField(DisplayName = "June")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod06 { get; set; }
public abstract class finPeriod06 : PX.Data.BQL.BqlDecimal.Field<finPeriod06> { }
#endregion

#region FinPeriod07
[PXDBDecimal()]
[PXUIField(DisplayName = "July")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod07 { get; set; }
public abstract class finPeriod07 : PX.Data.BQL.BqlDecimal.Field<finPeriod07> { }
#endregion

#region FinPeriod08
[PXDBDecimal()]
[PXUIField(DisplayName = "August")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod08 { get; set; }
public abstract class finPeriod08 : PX.Data.BQL.BqlDecimal.Field<finPeriod08> { }
#endregion

#region FinPeriod09
[PXDBDecimal()]
[PXUIField(DisplayName = "September")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod09 { get; set; }
public abstract class finPeriod09 : PX.Data.BQL.BqlDecimal.Field<finPeriod09> { }
#endregion

#region FinPeriod10
[PXDBDecimal()]
[PXUIField(DisplayName = "October")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod10 { get; set; }
public abstract class finPeriod10 : PX.Data.BQL.BqlDecimal.Field<finPeriod10> { }
#endregion

#region FinPeriod11
[PXDBDecimal()]
[PXUIField(DisplayName = "November")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod11 { get; set; }
public abstract class finPeriod11 : PX.Data.BQL.BqlDecimal.Field<finPeriod11> { }
#endregion

#region FinPeriod12
[PXDBDecimal()]
[PXUIField(DisplayName = "December")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod12 { get; set; }
public abstract class finPeriod12 : PX.Data.BQL.BqlDecimal.Field<finPeriod12> { }
#endregion

#region FinPeriod13
[PXDBDecimal()]
[PXUIField(DisplayName = "Fin Period13")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod13 { get; set; }
public abstract class finPeriod13 : PX.Data.BQL.BqlDecimal.Field<finPeriod13> { }
#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 CreatedDateTime
[PXDBCreatedDateTime()]
public virtual DateTime? CreatedDateTime { get; set; }
public abstract class createdDateTime : PX.Data.BQL.BqlDateTime.Field<createdDateTime> { }
#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 LastModifiedDateTime
[PXDBLastModifiedDateTime()]
public virtual DateTime? LastModifiedDateTime { get; set; }
public abstract class lastModifiedDateTime : PX.Data.BQL.BqlDateTime.Field<lastModifiedDateTime> { }
#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
}
#endregion
}

Build 21.214.0034 
Visual Studio 2022


You're welcome! Thank you for your attention.


10 replies

Userlevel 7
Badge +17

@rodolfobarrios52 On the record insertion, have you provided all these values? 

Also, I doubt how are you fetching the BudgetFilter DAC filter values in the custom screen.

Can you please confirm that Budget view is working fine properly?

 

 

 

 

@rodolfobarrios52 On the record insertion, have you provided all these values? 

Also, I doubt how are you fetching the BudgetFilter DAC filter values in the custom screen.

Can you please confirm that Budget view is working fine properly?

 

 

 

 

The records are inserted correctly; the issue arises when trying to save a modification we made in the grid. It is at this point that the values from the table are not obtained because they become null.

Not all values from my DAC are being inserted because they are not necessary in the table; some are references to names filled through methods. The values that are inserted are keys and amounts, as I had planned.

The Budget view is working correctly. This is a new screen that does not alter the original Budget screen.

Userlevel 7
Badge +17

@rodolfobarrios52  Your SAVE should be like below right?

public PXSave<PESRCustomer> Save;

Because of you mentioned BudgetFilter, hence is showing the NULL values. Please check

public PXSave<BudgetFilter> Save;

 

 

@rodolfobarrios52  Your SAVE should be like below right?

public PXSave<PESRCustomer> Save;

Because of you mentioned BudgetFilter, hence is showing the NULL values. Please check

public PXSave<BudgetFilter> Save;

 

 

Yes, I tried to do it that way, but it's a FormDetail. When I use PXSave with the PESRCustomer DAC, the Save button is not displayed on the screen.

Right now, this is how the screen looks:

and this is how it looks with the recommended modification.

 

Userlevel 7
Badge +17

@rodolfobarrios52  Understood. Since “BudgetFilter” is the Primary view hence it is not displayed.

Please keep the SAVE like as is public PXSave<BudgetFilter> Save;

I have modified code a bit, can you please try with this code and if it not working. Please share the customization code.

 

  public class BudgetCustomer : PXGraph<BudgetCustomer>
{
public PXCancel<BudgetFilter> Cancel;
public PXSave<BudgetFilter> Save;
public PXFilter<BudgetFilter> Filter;


public SelectFrom<PESRCustomer>
.Where<
PESRCustomer.branchID.IsEqual<BudgetFilter.branchID.FromCurrent>
.And<PESRCustomer.ledgerID.IsEqual<BudgetFilter.ledgerID.FromCurrent>>
.And<PESRCustomer.finYear.IsEqual<BudgetFilter.finYear.FromCurrent>>
>
.View Budget;

protected void PESRCustomer_CustomerID_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
PESRCustomer miRegistro = (PESRCustomer)e.Row;
if (miRegistro != null)
UpdateName(4, miRegistro);
}
protected virtual void _(Events.FieldUpdated<PESRCustomer, PESRCustomer.customerClassID> e)
{
PESRCustomer miRegistro = e.Row;
if (miRegistro != null)
UpdateName(3, miRegistro);

throw new PXRedirectRequiredException()
}
protected virtual void _(Events.FieldUpdated<PESRCustomer, PESRCustomer.busenissID> e)
{
PESRCustomer miRegistro = e.Row;
if (miRegistro != null)
UpdateName(1, miRegistro);
}
protected virtual void _(Events.FieldUpdated<PESRCustomer, PESRCustomer.productClassID> e)
{
PESRCustomer miRegistro = e.Row;
if (miRegistro != null)
UpdateName(2, miRegistro);
}

//protected virtual void _(Events.RowSelected<PESRCustomer> e)
//{
// PESRCustomer miRegistro = e.Row;

// UpdateName(1, miRegistro);
// UpdateName(2, miRegistro);
// UpdateName(3, miRegistro);
// UpdateName(4, miRegistro);
//}

protected void UpdateName(int Indices, PESRCustomer miRegistro)
{
switch (Indices)
{
case 1:
if (miRegistro != null)
{
CSAttributeDetail busniss =
SelectFrom<CSAttributeDetail>
.Where<CSAttributeDetail.attributeID.IsEqual<@P.AsString>
.And<CSAttributeDetail.valueID.IsEqual<@P.AsString>>
>.View.Select(this, "SRBUSINESS", miRegistro.BusenissID);

if (busniss != null)
{
miRegistro.BusenissName = busniss.Description;
}
}
break;
case 2:
if (miRegistro != null)
{
INItemClass itemclasses = SelectFrom<INItemClass>.Where<INItemClass.itemClassID.IsEqual<@P.AsInt>>.View.Select(this, miRegistro.ProductClassID);
if (itemclasses != null)
{
miRegistro.ProductClassName = itemclasses.Descr;
}
}

break;
case 3:
if (miRegistro != null)
{
CustomerClass customerclassDescripcion = SelectFrom<CustomerClass>.Where<CustomerClass.customerClassID.IsEqual<@P.AsString>>.View.Select(this, miRegistro.CustomerClassID);
if (customerclassDescripcion != null)
{
miRegistro.CustomerClassName = customerclassDescripcion.Descr;
}
}

break;
case 4:
if (miRegistro != null)
{
Customer customer = PXSelect<Customer, Where<Customer.bAccountID, Equal<Required<Customer.bAccountID>>>>.Select(this, miRegistro.CustomerID);
if (customer != null)
{
miRegistro.CustomerName = customer.AcctName;
}
}
break;

}
}
}

 

@rodolfobarrios52  Understood. Since “BudgetFilter” is the Primary view hence it is not displayed.

Please keep the SAVE like as is public PXSave<BudgetFilter> Save;

I have modified code a bit, can you please try with this code and if it not working. Please share the customization code.

 

 

I didn't get it to work. The customization code is in the question, but I'll resend it in case it didn't copy correctly. As for BudgetFilter, it hasn't been altered; it's only being used to provide a list for filters.


using System;
using System.Runtime.CompilerServices;
using PX.Common;
using PX.CS;
using PX.Data;
using PX.Data.BQL;

using PX.Data.BQL.Fluent;
using PX.Data.Maintenance.GI;
using PX.Data.ReferentialIntegrity.Attributes;
using PX.Objects.AR;
using PX.Objects.CR;
using PX.Objects.CS;
using PX.Objects.GL;
using PX.Objects.IN;
using static PX.SM.RowNewFile;
using CSAttribute = PX.CS.CSAttribute;
using CSAttributeDetail = PX.CS.CSAttributeDetail;


namespace SalesReport
{
public class BudgetCustomer : PXGraph<BudgetCustomer>
{

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


public PXFilter<BudgetFilter> Filter;

[PXImport(typeof(BudgetFilter))]
public SelectFrom<PESRCustomer>
.Where<
PESRCustomer.branchID.IsEqual<BudgetFilter.branchID.FromCurrent>
.And<PESRCustomer.ledgerID.IsEqual<BudgetFilter.ledgerID.FromCurrent>>
.And<PESRCustomer.finYear.IsEqual<BudgetFilter.finYear.FromCurrent>>
>
.View Budget;

protected void PESRCustomer_CustomerID_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
PESRCustomer miRegistro = (PESRCustomer)e.Row;
UpdateName(4, miRegistro);
}
protected virtual void _(Events.FieldUpdated<PESRCustomer, PESRCustomer.customerClassID> e)
{
PESRCustomer miRegistro = e.Row;
UpdateName(3, miRegistro);
}
protected virtual void _(Events.FieldUpdated<PESRCustomer, PESRCustomer.busenissID> e)
{
PESRCustomer miRegistro = e.Row;
UpdateName(1, miRegistro);
}
protected virtual void _(Events.FieldUpdated<PESRCustomer, PESRCustomer.productClassID> e)
{
PESRCustomer miRegistro = e.Row;
UpdateName(2, miRegistro);
}

protected virtual void _(Events.RowSelected<PESRCustomer> e)
{
PESRCustomer miRegistro = e.Row;

UpdateName(1, miRegistro);
UpdateName(2, miRegistro);
UpdateName(3, miRegistro);
UpdateName(4, miRegistro);
}

protected void UpdateName(int Indices, PESRCustomer miRegistro)
{
switch (Indices)
{
case 1:
if (miRegistro != null)
{
CSAttributeDetail busniss =
SelectFrom<CSAttributeDetail>
.Where<CSAttributeDetail.attributeID.IsEqual<@P.AsString>
.And<CSAttributeDetail.valueID.IsEqual<@P.AsString>>
>.View.Select(this, "SRBUSINESS", miRegistro.BusenissID);

if (busniss != null)
{
miRegistro.BusenissName = busniss.Description;
}
}
break;
case 2:
if (miRegistro != null)
{
INItemClass itemclasses = SelectFrom<INItemClass>.Where<INItemClass.itemClassID.IsEqual<@P.AsInt>>.View.Select(this, miRegistro.ProductClassID);
if (itemclasses != null)
{
miRegistro.ProductClassName = itemclasses.Descr;
}
}

break;
case 3:
if (miRegistro != null)
{
CustomerClass customerclassDescripcion = SelectFrom<CustomerClass>.Where<CustomerClass.customerClassID.IsEqual<@P.AsString>>.View.Select(this, miRegistro.CustomerClassID);
if (customerclassDescripcion != null)
{
miRegistro.CustomerClassName = customerclassDescripcion.Descr;
}
}

break;
case 4:
if (miRegistro != null)
{
Customer customer = PXSelect<Customer, Where<Customer.bAccountID, Equal<Required<Customer.bAccountID>>>>.Select(this, miRegistro.CustomerID);
if (customer != null)
{
miRegistro.CustomerName = customer.AcctName;
}
}
break;

}
}
}
#region PESRCustomer
[Serializable]
[PXCacheName("PESRCustomer")]
public class PESRCustomer : IBqlTable
{


#region Constantes
public static class SRBUSINESSConstants
{
public const string SRBusiness = "SRBUSINESS";
}
public class srbusiness : PX.Data.BQL.BqlString.Constant<srbusiness>
{
public srbusiness() : base(SRBUSINESSConstants.SRBusiness) { }
}
#endregion


#region BranchID
[Branch(typeof(BudgetFilter.branchID))]
//[Branch(Required = true)]
public virtual int? BranchID { get; set; }
public abstract class branchID : PX.Data.BQL.BqlInt.Field<branchID> { }
#endregion
//#region BranchID
//[Branch()]
//[PXUIField(DisplayName = "Branch ID")]
//public virtual int? BranchID { get; set; }
//public abstract class branchID : PX.Data.BQL.BqlInt.Field<branchID> { }
//#endregion
#region LedgerID
[PXDBInt(IsKey = true)]
[PXDefault(typeof(BudgetFilter.ledgerID))]
[PXUIField(Enabled = false, Visible = false)]//, Visible = false, Visibility = PXUIVisibility.Invisible
[PXSelector(typeof(Ledger.ledgerID), SubstituteKey = typeof(Ledger.ledgerCD))]
public virtual int? LedgerID { get; set; }
public abstract class ledgerID : PX.Data.BQL.BqlInt.Field<ledgerID> { }
#endregion
#region FinYear
[PXDBString(4, IsKey = true, IsFixed = true, InputMask = "")]
[PXDefault(typeof(BudgetFilter.finYear))]
[PXUIField(DisplayName = "Fin Year", Visible = false)]
public virtual string FinYear { get; set; }
public abstract class finYear : PX.Data.BQL.BqlString.Field<finYear> { }
#endregion



#region BusenissID
[PXDBString(9, IsKey = true)]
[PXUIField(DisplayName = "Business")]
[PXSelector(typeof(Search5<CSAttributeDetail.valueID,
InnerJoin<CSAttribute, On<CSAttribute.attributeID, Equal<CSAttributeDetail.attributeID>>>,
Where<CSAttribute.attributeID, Equal<srbusiness>>,
Aggregate<GroupBy<CSAttributeDetail.valueID>>,
OrderBy<Asc<CSAttributeDetail.valueID>>
>),
typeof(CSAttributeDetail.valueID), typeof(CSAttributeDetail.description),
DescriptionField = typeof(CSAttributeDetail.description)

)]
public virtual string BusenissID { get; set; }
public abstract class busenissID : PX.Data.BQL.BqlString.Field<busenissID> { }
#endregion
#region BusenissName

[PXString(250)]
[PXUIField(DisplayName = "Buseniss Name", IsReadOnly = true)]

public virtual string BusenissName { get; set; }
public abstract class busenissName : PX.Data.BQL.BqlString.Field<busenissName> { }
#endregion
#region ProductClassID
[PXDBInt(IsKey = true)]
[PXUIField(DisplayName = "Item Class ID", Visibility = PXUIVisibility.SelectorVisible)]
[PXSelector(typeof(Search<INItemClass.itemClassID>),
SubstituteKey = typeof(INItemClass.itemClassCD),
DescriptionField = typeof(INItemClass.descr), ValidateValue = false)]
public virtual int? ProductClassID { get; set; }
public abstract class productClassID : PX.Data.BQL.BqlInt.Field<productClassID> { }
#endregion
#region ProductClassName
[PXString(250)]
[PXUIField(DisplayName = "Item Class Name", IsReadOnly = true)]

public virtual string ProductClassName { get; set; }
public abstract class productClassName : PX.Data.BQL.BqlString.Field<productClassName> { }
#endregion
#region CustomerClassID
[PXDBString(18, IsKey = true, IsUnicode = true)]
[PXSelector(typeof(Search<CustomerClass.customerClassID>),
typeof(CustomerClass.customerClassID),
SubstituteKey = typeof(CustomerClass.customerClassID),
DescriptionField = typeof(CustomerClass.descr))]
[PXUIField(DisplayName = "Customer Class ID", Visibility = PXUIVisibility.SelectorVisible)]
public virtual string CustomerClassID { get; set; }
public abstract class customerClassID : PX.Data.BQL.BqlString.Field<customerClassID> { }
#endregion
#region CustomerClassName
[PXString(250)]
[PXUIField(DisplayName = "Customer Class Name", IsReadOnly = true)]
public virtual string CustomerClassName { get; set; }
public abstract class customerClassName : PX.Data.BQL.BqlString.Field<customerClassName> { }
#endregion
#region CustomerID
[PXDBInt(IsKey = true)]
[PXSelector(typeof(Customer.bAccountID), typeof(Customer.acctCD), typeof(Customer.acctName),
SubstituteKey = typeof(Customer.acctCD),
DescriptionField = typeof(Customer.acctName))]
[PXUIField(DisplayName = "Customer ID")]
public virtual int? CustomerID { get; set; }
public abstract class customerID : PX.Data.BQL.BqlInt.Field<customerID> { }
#endregion
#region CustomerName
[PXString(250)]
[PXUIField(DisplayName = "Customer Name", IsReadOnly = true)]

public virtual string CustomerName { get; set; }
public abstract class customerName : PX.Data.BQL.BqlString.Field<customerName> { }
#endregion

#region Amount
[PXDBDecimal()]
[PXUIField(DisplayName = "Amount")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? Amount { get; set; }
public abstract class amount : PX.Data.BQL.BqlDecimal.Field<amount> { }
#endregion

#region AllocatedAmount
[PXDBDecimal()]
[PXUIField(DisplayName = "Allocated Amount", Enabled = false)]
[PXDefault(TypeCode.Decimal, "0.0")]

[PXFormula(typeof(Add<finPeriod01, Add<finPeriod02, Add<finPeriod03, Add<finPeriod04, Add<finPeriod05, Add<finPeriod06, Add<finPeriod07, Add<finPeriod08, Add<finPeriod09, Add<finPeriod10, Add<finPeriod11, Add<finPeriod12, finPeriod13>>>>>>>>>>>>))]
public virtual Decimal? AllocatedAmount { get; set; }

protected Decimal? _AllocatedAmount;
public abstract class allocatedAmount : PX.Data.BQL.BqlDecimal.Field<allocatedAmount> { }
#endregion
#region FinPeriod01
[PXDBDecimal()]
[PXUIField(DisplayName = "January")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod01 { get; set; }
public abstract class finPeriod01 : PX.Data.BQL.BqlDecimal.Field<finPeriod01> { }
#endregion

#region FinPeriod02
[PXDBDecimal()]
[PXUIField(DisplayName = "February")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod02 { get; set; }
public abstract class finPeriod02 : PX.Data.BQL.BqlDecimal.Field<finPeriod02> { }
#endregion

#region FinPeriod03
[PXDBDecimal()]
[PXUIField(DisplayName = "March")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod03 { get; set; }
public abstract class finPeriod03 : PX.Data.BQL.BqlDecimal.Field<finPeriod03> { }
#endregion

#region FinPeriod04
[PXDBDecimal()]
[PXUIField(DisplayName = "April")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod04 { get; set; }
public abstract class finPeriod04 : PX.Data.BQL.BqlDecimal.Field<finPeriod04> { }
#endregion

#region FinPeriod05
[PXDBDecimal()]
[PXUIField(DisplayName = "May")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod05 { get; set; }
public abstract class finPeriod05 : PX.Data.BQL.BqlDecimal.Field<finPeriod05> { }
#endregion

#region FinPeriod06
[PXDBDecimal()]
[PXUIField(DisplayName = "June")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod06 { get; set; }
public abstract class finPeriod06 : PX.Data.BQL.BqlDecimal.Field<finPeriod06> { }
#endregion

#region FinPeriod07
[PXDBDecimal()]
[PXUIField(DisplayName = "July")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod07 { get; set; }
public abstract class finPeriod07 : PX.Data.BQL.BqlDecimal.Field<finPeriod07> { }
#endregion

#region FinPeriod08
[PXDBDecimal()]
[PXUIField(DisplayName = "August")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod08 { get; set; }
public abstract class finPeriod08 : PX.Data.BQL.BqlDecimal.Field<finPeriod08> { }
#endregion

#region FinPeriod09
[PXDBDecimal()]
[PXUIField(DisplayName = "September")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod09 { get; set; }
public abstract class finPeriod09 : PX.Data.BQL.BqlDecimal.Field<finPeriod09> { }
#endregion

#region FinPeriod10
[PXDBDecimal()]
[PXUIField(DisplayName = "October")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod10 { get; set; }
public abstract class finPeriod10 : PX.Data.BQL.BqlDecimal.Field<finPeriod10> { }
#endregion

#region FinPeriod11
[PXDBDecimal()]
[PXUIField(DisplayName = "November")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod11 { get; set; }
public abstract class finPeriod11 : PX.Data.BQL.BqlDecimal.Field<finPeriod11> { }
#endregion

#region FinPeriod12
[PXDBDecimal()]
[PXUIField(DisplayName = "December")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod12 { get; set; }
public abstract class finPeriod12 : PX.Data.BQL.BqlDecimal.Field<finPeriod12> { }
#endregion

#region FinPeriod13
[PXDBDecimal()]
[PXUIField(DisplayName = "Fin Period13")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? FinPeriod13 { get; set; }
public abstract class finPeriod13 : PX.Data.BQL.BqlDecimal.Field<finPeriod13> { }
#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 CreatedDateTime
[PXDBCreatedDateTime()]
public virtual DateTime? CreatedDateTime { get; set; }
public abstract class createdDateTime : PX.Data.BQL.BqlDateTime.Field<createdDateTime> { }
#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 LastModifiedDateTime
[PXDBLastModifiedDateTime()]
public virtual DateTime? LastModifiedDateTime { get; set; }
public abstract class lastModifiedDateTime : PX.Data.BQL.BqlDateTime.Field<lastModifiedDateTime> { }
#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
}
#endregion
}

 

Userlevel 7
Badge +17

@rodolfobarrios52 As this is a custom screen, we need .aspx files/screens to test this, hence requested for thr customization package.

@rodolfobarrios52 As this is a custom screen, we need .aspx files/screens to test this, hence requested for thr customization package.

<%@ Page Language="C#" MasterPageFile="~/MasterPages/FormDetail.master" AutoEventWireup="true" ValidateRequest="false" CodeFile="XT302000.aspx.cs" Inherits="Page_XT302000" Title="Untitled Page" %>
<%@ MasterType VirtualPath="~/MasterPages/FormDetail.master" %>

<asp:Content ID="cont1" ContentPlaceHolderID="phDS" Runat="Server">
<px:PXDataSource PageLoadBehavior="PopulateSavedValues" EnableAttributes="True" ID="ds" runat="server" Visible="True" Width="100%"
TypeName="SalesReport.BudgetCustomerMaint"
PrimaryView="Filter"
>
<CallbackCommands>

</CallbackCommands>
</px:PXDataSource>
</asp:Content>
<asp:Content ID="cont2" ContentPlaceHolderID="phF" Runat="Server">
<px:PXFormView ID="form" runat="server" DataSourceID="ds" DataMember="Filter" Width="100%" Height="100px" AllowAutoHide="false">
<Template>
<px:PXLayoutRule ID="PXLayoutRule1" runat="server" StartRow="True"></px:PXLayoutRule>
<px:PXSelector CommitChanges="True" runat="server" ID="CstPXSelector2" DataField="LedgerID" ></px:PXSelector>
<px:PXSelector CommitChanges="True" runat="server" ID="CstPXSelector1" DataField="FinYear" ></px:PXSelector></Template>
</px:PXFormView>
</asp:Content>
<asp:Content ID="cont3" ContentPlaceHolderID="phG" Runat="Server">
<px:PXGrid SyncPosition="True" ID="grid" runat="server" DataSourceID="ds" Width="100%" Height="150px" SkinID="Details" AllowAutoHide="false">
<Levels>
<px:PXGridLevel DataMember="Budget">
<Columns>
<px:PXGridColumn CommitChanges="True" DataField="BusenissID" Width="108" ></px:PXGridColumn>
<px:PXGridColumn DataField="BusenissName" Width="70" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="ProductClassID" Width="108" ></px:PXGridColumn>
<px:PXGridColumn DataField="ProductClassName" Width="70" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="CustomerClassID" Width="140" ></px:PXGridColumn>
<px:PXGridColumn DataField="CustomerClassName" Width="70" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="CustomerID" Width="70" ></px:PXGridColumn>
<px:PXGridColumn DataField="CustomerName" Width="280" ></px:PXGridColumn>
<px:PXGridColumn DataField="Amount" Width="100" ></px:PXGridColumn>
<px:PXGridColumn DataField="AllocatedAmount" Width="100" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="FinPeriod01" Width="100" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="FinPeriod02" Width="100" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="FinPeriod03" Width="100" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="FinPeriod04" Width="100" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="FinPeriod05" Width="100" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="FinPeriod06" Width="100" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="FinPeriod07" Width="100" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="FinPeriod08" Width="100" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="FinPeriod09" Width="100" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="FinPeriod10" Width="100" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="FinPeriod11" Width="100" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="FinPeriod12" Width="100" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="FinPeriod13" Width="100" ></px:PXGridColumn></Columns>
</px:PXGridLevel>
</Levels>
<AutoSize Container="Window" Enabled="True" MinHeight="150" ></AutoSize>
<ActionBar >
</ActionBar>

<Mode AllowUpload="True" /></px:PXGrid>
</asp:Content>

 

Userlevel 7
Badge +17

@rodolfobarrios52 We cannot work if you can share the individual code. Please share the customization project.

Userlevel 7
Badge

Hi @rodolfobarrios52 were you able to find a solution? Thank you!

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