2

I am trying to show attributeID and Values on the SmartPanel grid with additional features. I am able to achieve in showing the values but the values are of type text. I am not able to get the control types for values like in Attributes tab of IN202500 (CheckBox, Combo, etc.)

I have extended the CSAnswers DAC along with fields AttributeID and Value.

public PXSelectJoin<CSAnswers3,
LeftJoin<CSAnswers,On<CSAnswers.attributeID,
Equal<CSAnswers3.attributeID>>>> DetailsView;


[Serializable]
[PXPossibleRowsList(typeof(CSAttribute.description), 
typeof(CSAnswers3.attributeID), typeof(CSAnswers3.value))]
public class CSAnswers3 : CSAnswers
{
    [PXDBString(10, InputMask = "", IsKey = true, IsUnicode = true)]
    [PXDefault]
    [PXUIField(DisplayName = "Attribute", Enabled = false)]
    [CSAttributeSelector]
    public override string AttributeID { get; set; }
    public new abstract class attributeID : IBqlField, IBqlOperand { }

    [PXDBString(255, IsUnicode = true)]        
    [PXUIField(DisplayName = "Value")]
    [CSAttributeValueValidation(typeof(CSAnswers3.attributeID))]
    [PXPersonalDataFieldAttribute.Value]
    public override string Value { get; set; }    


}

<px:PXSmartPanel runat="server" ID="AttributeInfo" Key="detailsView" 
LoadOnDemand="True" Caption="AttributeInfo">
<px:PXGrid runat="server" ID="CstPXGrid2" AutoAdjustColumns="True" 
DataSourceID="ds" MatrixMode="True" SkinID="Attributes">
<Levels>
<px:PXGridLevel DataMember="detailsView">
<Columns>
<px:PXGridColumn DataField="AttributeID" Width="120" />
<px:PXGridColumn DataField="Value" Width="280" /></Columns> 
</px:PXGridLevel></Levels></px:PXGrid>
<px:PXPanel runat="server" ID="CstPanel3">
<px:PXButton runat="server" ID="CstButton4" DialogResult="OK" 
Text="Close" /></px:PXPanel></px:PXSmartPanel></asp:Content>

I am trying to get Values with Control type (CheckBox, Combo, etc.) on the grid as in the attributes Tab of Stock Item Screen.

Prathyusha
  • 155
  • 10

1 Answers1

0

There is a table CSAttribute in Acumatica database, and it has column ControlType. On sample of Sales demo database you can see that ControlType of attribute 'SALESGOALY' can be discovered over following SQL:

select * from CSAttribute where AttributeID = 'SALESGOALY'

and you can use following BQL for getting types:

 PXSelect<CSAttribute, Where<CSAttribute.attributeID, Equal<Required<CSAttribute.attributeID>>>>.Select(Base, "SALESGOALY");

And following fragment of Acumaitca source code gives exact answer on typing:

[PXDBInt]
[PXDefault(1)]
[PXUIField(DisplayName = "Control Type", Visibility = PXUIVisibility.SelectorVisible)]
[PXIntList(new int[] {1, 2, 6, 4, 5}, new string[] {"Text", "Combo", "Multi Select Combo", "Checkbox", "Datetime"})]
public virtual int? ControlType
{
  get
  {
    return this._ControlType;
  }
  set
  {
    this._ControlType = value;
  }
}

which says that type of 'SALESGOALY' which is 1, or it is text.

Yuriy Zaletskyy
  • 4,983
  • 5
  • 34
  • 54