Skip to main content
Question

Adding Customer Name to TimeCard

  • February 28, 2025
  • 2 replies
  • 34 views

On the Employee Time Cards page (EP305000) I’m trying to add the Customer’s Name associated with the project on the Summary tab. I created an unbound field and I tried to use the PXUnboundDefault attribute to populate the name, then added the field to the page. So I have an EPTimeCardSummary extension created with this field:

        [PXString]
        [PXUIField(DisplayName = "Customer Name")]
        [PXUnboundDefault(typeof(Search2<BAccount.acctName,
              InnerJoin<PMProject, On<BAccount.bAccountID, Equal<PMProject.customerID>>>,
              Where<PMProject.contractID, Equal<Current<EPTimeCardSummary.projectID>>>>))]
        public virtual string UsrCustomerName { get; set; }
        public abstract class usrCustomerName : PX.Data.BQL.BqlString.Field<usrCustomerName> { }

But when I add it to the page and publish the customization, I get this strange error message after choosing a timecard. The message includes the reference number for the timecard which I don’t understand why it would.
 

 

I could easily just create the unbound field and populate it when the graph loads so it’s not like I don’t have other options, but I’m not sure why it wouldn’t work and just trying to understand why. Anyone have any thoughts?

The DAC used on the page’s summary is actually a projection of EPTimeCardSummary called EPTimeCardSummaryWithInfo, so I just extended the EPTimeCardSummary. Is the fact that this is a projection causing issues?

2 replies

Nilkanth Dipak
Semi-Pro I
Forum|alt.badge.img+10

Hi ​@mmarklow44,

Yes, the fact that EPTimeCardSummaryWithInfo is a projection can definitely cause issues here. Projections in Acumatica often join multiple tables and don’t always support standard field extensions or attributes like PXUnboundDefault smoothly, especially when it comes to fields that rely on Current<> context values, like your projectID.

The error you’re seeing likely happens because the system struggles to resolve the Current<EPTimeCardSummary.projectID> context within a projection, especially when it’s used with PXUnboundDefault.

Hope, it helps!


Forum|alt.badge.img+8
  • Captain II
  • 366 replies
  • March 3, 2025

Hi ​@mmarklow44 

 

I believe you have to add the field to the base DAC too and use BqlField = “” which will track the value from the base DAC.

 

Although with a unbound field, you may have to set this field within the graph with a CacheAttached.

 

Aleks


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings