Question

Adding a new column to a grid

  • 15 April 2021
  • 5 replies
  • 47 views

Good day

I please need some help in adding a new column to the Employee Time page.
The field would show the customers name next to the product that it is linked to, the project displays on the grid by default.
At the moment I cannot seem to add an additional column to the grid, I added it via a customization and the field does show in the customization project but when previewing the page the column is not in the grid
Please assist me with this


5 replies

Userlevel 6
Badge +3

Hi, @LeeRoy57 You want to add the field in the Employee Time Activities screen(EP307000)?
Can you please us know, what field you want in the grid?
 

Hi Naveen

Thank you for your reply

I would like to add the field to the Employee Time Card page
 

If you search for a Project on the grid the field that I would like to add is in the possible projects list
 

I would please like some help to display this field in the grid also next to the project column

Userlevel 6
Badge +3

Hi, @LeeRoy57,

Understood. you would like to add a new field in the Project Selector field.  The below article will help you a lot to add the field in the selector grid.

https://www.info-sourcing.com/how-to-add-fields-to-acumatica-selector-lookup-no-coding/

 

This customerID field is located on PMProject DAC. The grid only takes fields from Summary view.

You will need to modify it to include that field in order to add it there.

Userlevel 6
Badge +3

Hi, @LeeRoy57  Sorry it was my bad, I thought other way round.

You want to add a new field i.e. Customer after the project. Please find the sample code and attached screenshot for your reference.

 

Hope this helps!!

 public class EPTimeCardSummaryWithInfoExt : PXCacheExtension<EPTimeCardSummaryWithInfo>
{

[CustomerActive(
typeof(Search<BAccountR.bAccountID, Where<True, Equal<True>>>),
Visibility = PXUIVisibility.SelectorVisible,
DescriptionField = typeof(Customer.acctName),
Filterable = true)]
[PXUIField(DisplayName = "Customer ID")]
public int? UsrCustomerID { get; set; }
public abstract class usrCustomerID : PX.Data.BQL.BqlInt.Field<usrCustomerID> { }

}


public class TimeCardMaintExt : PXGraphExtension<TimeCardMaint>
{

protected virtual void EPTimeCardSummaryWithInfo_ProjectID_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e, PXFieldUpdated InvokeBaseHandler)
{
InvokeBaseHandler?.Invoke(sender, e);
EPTimeCardSummaryWithInfo row = (EPTimeCardSummaryWithInfo)e.Row;
if (row != null)
{
PMProject objPMProject = PXSelect<PMProject, Where<PMProject.contractID, Equal<Required<PMProject.contractID>>>>.Select(Base, row.ProjectID);
if (objPMProject != null)
{
row.GetExtension<EPTimeCardSummaryWithInfoExt>().UsrCustomerID = objPMProject.CustomerID;
}
}
}
}

 

 

 

 

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 — 2020  Acumatica, Inc. All rights reserved