Skip to main content
Answer

How to convert colums to rows (pivot) and put the result in selector

  • July 18, 2021
  • 2 replies
  • 91 views

Hello Goodnight. I have the following problem. I have a “table A” with the columns: Vendor_1, Vendor_2, Vendor_3 and Vendor_4. I need to display these columns in a selector as if they were rows.

In sql I solved the problem using "union all" but when I am investigating I see that acumatica does not have (or at least I have not found examples) this option.

 

  • Aditional: I have work in a customization project.


Can you help me please. Thanks!

 

Best answer by eddiedaco

Thanks for your answer @Hughes Beausejour . I resolve it creating a view in sql server, then create a dac with this view.

2 replies

Hughes Beausejour
Acumatica Employee
Forum|alt.badge.img+2
  • Acumatica Developer Support Team
  • July 18, 2021

Create alias DAC for each vendor to reference more than one vendor per query.

Example:

[PXHidden]
public partial class VendorR : Vendor
{
    #region BAccountID
    public new abstract class bAccountID : PX.Data.BQL.BqlInt.Field<bAccountID> { }
    #endregion
}

Then join each vendor in the same query.


  • Author
  • Varsity I
  • Answer
  • July 21, 2021

Thanks for your answer @Hughes Beausejour . I resolve it creating a view in sql server, then create a dac with this view.