AUGForums.com

An Acumatica User Group

  • Forums
  • Podcast
  • Blog
  • Rolodex
  • Login
  • Start Here
  • Courses
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

  • Overview
  • Member List
  • All-Stars
  • Stats
  • Recent Posts
  • Help
Forums
AUG Forums
Everything Else
Acumatica User-Defi...
 
Notifications
Clear all

Acumatica User-Defined Fields (UDF) vs. Attributes  

    Last Post
RSS

Tim Rodman
Posts: 2471
 Tim Rodman     ★★ All-Star ★★
January 3, 2020 2:49 am
(@timrodman)
Over 200 Posts
Joined: 5 years ago

Here are some notes about User-Defined Fields (UDF) vs. Attributes.

I created an Opportunity where the same Test Attribute was used as both a UDF and an Attribute:

image

 

Neither one gets picked up by the Universal Search:

image

 

When it comes to adding the fields to a Generic Inquiry or Report, it’s basically the same thing:

  • My UDF could be found at CROpportunity.AttributeA01.
  • My Attribute could be found at CROpportunity.A01_Attributes.

 

I added both the UDF and Attribute to my Generic Inquiry, then ran a trace on the Generic Inquiry and noted the following SQL code that got generated:

  • UDF: ((SELECT [CROpportunityKvExt].[FieldName] as '@type', COALESCE(CONVERT(VARCHAR(30), ValueNumeric), CONVERT(VARCHAR(23), ValueDate, 121), ValueString, ValueText, N'') as '*' FROM [CROpportunityKvExt] [CROpportunityKvExt] WHERE ( [CROpportunityKvExt].[CompanyID] = 3) AND ( [CROpportunityKvExt].[CompanyID] = 3) AND [CROpportunityKvExt].[RecordID] = [CROpportunity].[NoteID] FOR XML PATH('v')) ) AS [CROpportunity_AttributeA01],
  • Attribute: ((SELECT [AttributeID] as '@type', [value] as '*' FROM [CSAnswers] [CSAnswers] WHERE ( [CSAnswers].[CompanyID] = 3) AND ( [CSAnswers].[CompanyID] = 3) AND ( [CSAnswers].[RefNoteID] = [CROpportunity].[NoteID]) FOR XML PATH('v')) ) AS [CROpportunity_Attributes],

 

You can see in the SQL code above that the UDF gets physically stored in the CROpportunityKvExt table while the Attribute gets stored in the CSAnswers table.

The CROpportunityKvExt table only stores fields related to Opportunities. The CSAnswers table stores fields related to anything that can track an Attribute (Opportunities, Items, etc.). Based on this, I would suspect that it takes a little longer to retrieve an Attribute from CSAnswers than a UDF from CROpportunityKvExt since there is more data in CSAnswers to sift through.

Also, I’m not an expert in SQL, but I would expect the FOR XML PATH statement to return a comma delimited list of fields that would then need to be parsed. This is another reason why I would suspect that it takes a little longer to retrieve an Attribute from CSAnswers than a UDF from CROpportunityKvExt.

Otherwise, it seems to me that User-Defined Fields (UDF) and Attributes are pretty similar. Most of the screens that I’ve noticed only allow you to choose one or the other. The Opportunities (CR304000) screen is kind of unique in that it allows you to use both User-Defined Fields and Attributes.

  All forum topics
  Previous Topic
Next Topic  
  Forum Statistics
11 Forums
1,644 Topics
7,648 Posts
7 Online
1,102 Members

Latest Post: Using « start with » unstead of « contrains » Our newest member: mcweave Recent Posts Unread Posts

Forum Icons: Forum contains no unread posts Forum contains unread posts

Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright © 2021 · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

‹›×

    ‹›×