Solved

Custom Attributes on Service Contract (FS305700)

  • 24 June 2023
  • 4 replies
  • 96 views

Userlevel 1

Hi Leaders,

need your help in this by adding in the contract attributes a line that would display the total of all highlighted in yellow below 

and the total need to display below,

kindly please help me for any detailed  solution on this 

 

Thank you

icon

Best answer by Naveen Boga 24 June 2023, 19:14

View original

4 replies

Userlevel 7
Badge +17

Hi @Mounishg It requires a customization.

In your code you came loop through the all the attributes ( which are required) for specific Service Contract and get the total sum value.

 

Userlevel 6
Badge +4

I agree with Naveen.

Attributes values are stored in the CSAnswers table as individual records, and not as fields of a single record. If you insist on using attributes, you will have to loop through them in code and set the value of the “totals” Attribute you define.  The biggest concern that I have with this approach is that attributes, by nature, are highly configurable BY CLASS.  You need to determine which attributes need to be included in summing and code which attribute will be used to store the sum.  Every layer of complexity to make this more robust adds overhead to the system and complexity in managing.  It is doable, but it takes a lot of solid planning.

I have to wonder if the use of attributes is because it is easy to add the fields to track values.  If these attributes that you need to sum really aren’t “class specific” as attributes are designed, I wonder if it might be easier to add these fields to your DAC as a DAC extension and then use a PXFormula to sum them up and store into a totals fields.  This would make the custom fields available to all service contracts regardless of class, and the summing can be automatic with PXFormula.

I find adding fields and summing them with PXFormula to be far easier and reliable than cycling through a list of other records (CSAnswers in this case).  If you insist on leaving as attributes, you might build a list of all attributes that might need to be summed and set a “totals” attribute that will always hold the value.  Then you could select all attributes in your list and associated to the record, so the ones that don’t apply would be excluded by default.  Then you can easily store the sum into your predefined “Total” attribute.  My recommendation is to rule out the possibility of adding as fields in a DAC extension before you continue the attributes route as the coding seems quite a bit easier to me to stick with summing fields of a DAC extension rather than managing a list of summable attributes and storing into another attribute, which also must be added to every class that needs to show the total. 

Userlevel 1

Thank you 

your inputs helped me @Naveen Boga  @Brian Stevens 

Userlevel 7
Badge +17

@Mounishg  I’m glad you solved the problem :) and thanks for sharing the update.

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