Skip to main content
Solved

Column Filters on customized Process screen

  • November 21, 2024
  • 4 replies
  • 76 views

dsimmerly
Pro I
Forum|alt.badge.img+1

Has anyone come across issue where a field has been added to the details tab of a process screen via customization and the column can not be filtered - as in added a column filters does not filters at all

We now have 3 process screen on 24R1 customers with this issue.  I know one is SO505000 but can be sure of the other 2.

 

Best answer by noorula77

Hi ​@dsimmerly have you try like below mentioned steps.

  • Configuration Requirements:
    • The field must have a proper PXSelector attribute with Search type
    • Include all fields you want visible in the lookup window
    • Define a View specifically for the lookup functionality

// 1. DAC Extension Configuration

public class SOShipmentExtension : PXCacheExtension<SOShipment>

{

    #region UsrCustomField

    [PXDBString(50)]

    [PXUIField(DisplayName = "Custom Field")]

    // Add PXSelector to enable proper lookup functionality

    [PXSelector(

        typeof(Search<SOShipmentExtension.usrCustomField>),

        typeof(SOShipmentExtension.usrCustomField),

        // Include other relevant fields you want to show in the lookup

        typeof(SOShipment.shipmentNbr),

        typeof(SOShipment.status)

    )]

    public virtual string UsrCustomField { get; set; }

    public abstract class usrCustomField : PX.Data.BQL.BqlString.Field<usrCustomField> { }

    #endregion

}

 

// 2. Graph Extension for handling the lookup

public class SOShipmentEntryExtension : PXGraphExtension<SOShipmentEntry>

{

    // Add a view specifically for the lookup

    public PXFilter<SOShipmentFilter> Filter;

   

    public PXSelectReadonly<SOShipment,

        Where<SOShipmentExtension.usrCustomField, Like<Current<SOShipmentFilter.usrCustomField>>>> LookupView;

 

    // Filter DAC for the lookup

    [Serializable]

    public class SOShipmentFilter : IBqlTable

    {

        #region UsrCustomField

        [PXDBString(50)]

        [PXUIField(DisplayName = "Custom Field")]

        public virtual string UsrCustomField { get; set; }

        public abstract class usrCustomField : PX.Data.BQL.BqlString.Field<usrCustomField> { }

        #endregion

    }

}

 

// 3. ASPX Configuration

/*

<px:PXGridColumn DataField="UsrCustomField" Width="100px" AllowFilter="True">

    <AutoCallBack Command="ViewDetails" Target="ds" />

</px:PXGridColumn>

*/

 

// 4. Lookup Configuration in the Process Screen (e.g., SO505000.aspx)

/*

<px:PXSelector ID="edUsrCustomField" runat="server"

    DataField="UsrCustomField"

    AutoRefresh="True"

    TextMode="Search"

    AllowEdit="True">

    <GridProperties>

        <Columns>

            <px:PXGridColumn DataField="UsrCustomField" Width="150px" />

            <px:PXGridColumn DataField="ShipmentNbr" Width="100px" />

            <px:PXGridColumn DataField="Status" Width="100px" />

        </Columns>

        <Layout ColumnsMenu="True" FilterBox="True" />

    </GridProperties>

</px:PXSelector>

*/

*/

View original
Did this topic help you find an answer to your question?

4 replies

Forum|alt.badge.img+1
  • Jr Varsity I
  • 62 replies
  • November 22, 2024

Hi ​@dsimmerly ,
In the field editor for this selector access layout properties and set the FilterByAllFields property to True. .


dsimmerly
Pro I
Forum|alt.badge.img+1
  • Author
  • Pro I
  • 117 replies
  • November 22, 2024

@noorula77 feedback for my dev team:  

This is for filtering on the Lookup field, I.e. when clicking on the Lookup, and then trying to filter on the popup screen.

We need the filter to work on a custom text field on process screen grid.


Forum|alt.badge.img+1
  • Jr Varsity I
  • 62 replies
  • Answer
  • November 25, 2024

Hi ​@dsimmerly have you try like below mentioned steps.

  • Configuration Requirements:
    • The field must have a proper PXSelector attribute with Search type
    • Include all fields you want visible in the lookup window
    • Define a View specifically for the lookup functionality

// 1. DAC Extension Configuration

public class SOShipmentExtension : PXCacheExtension<SOShipment>

{

    #region UsrCustomField

    [PXDBString(50)]

    [PXUIField(DisplayName = "Custom Field")]

    // Add PXSelector to enable proper lookup functionality

    [PXSelector(

        typeof(Search<SOShipmentExtension.usrCustomField>),

        typeof(SOShipmentExtension.usrCustomField),

        // Include other relevant fields you want to show in the lookup

        typeof(SOShipment.shipmentNbr),

        typeof(SOShipment.status)

    )]

    public virtual string UsrCustomField { get; set; }

    public abstract class usrCustomField : PX.Data.BQL.BqlString.Field<usrCustomField> { }

    #endregion

}

 

// 2. Graph Extension for handling the lookup

public class SOShipmentEntryExtension : PXGraphExtension<SOShipmentEntry>

{

    // Add a view specifically for the lookup

    public PXFilter<SOShipmentFilter> Filter;

   

    public PXSelectReadonly<SOShipment,

        Where<SOShipmentExtension.usrCustomField, Like<Current<SOShipmentFilter.usrCustomField>>>> LookupView;

 

    // Filter DAC for the lookup

    [Serializable]

    public class SOShipmentFilter : IBqlTable

    {

        #region UsrCustomField

        [PXDBString(50)]

        [PXUIField(DisplayName = "Custom Field")]

        public virtual string UsrCustomField { get; set; }

        public abstract class usrCustomField : PX.Data.BQL.BqlString.Field<usrCustomField> { }

        #endregion

    }

}

 

// 3. ASPX Configuration

/*

<px:PXGridColumn DataField="UsrCustomField" Width="100px" AllowFilter="True">

    <AutoCallBack Command="ViewDetails" Target="ds" />

</px:PXGridColumn>

*/

 

// 4. Lookup Configuration in the Process Screen (e.g., SO505000.aspx)

/*

<px:PXSelector ID="edUsrCustomField" runat="server"

    DataField="UsrCustomField"

    AutoRefresh="True"

    TextMode="Search"

    AllowEdit="True">

    <GridProperties>

        <Columns>

            <px:PXGridColumn DataField="UsrCustomField" Width="150px" />

            <px:PXGridColumn DataField="ShipmentNbr" Width="100px" />

            <px:PXGridColumn DataField="Status" Width="100px" />

        </Columns>

        <Layout ColumnsMenu="True" FilterBox="True" />

    </GridProperties>

</px:PXSelector>

*/

*/


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

Hi ​@dsimmerly,

If I understand your problem correctly, you need to filter the grid data using your custom field in addition to the existing filters.

Have you ensured that this custom field is added to the Header Filter Area in the screen, similar to how the "Customer" field is used in the SO505000 screen?

If you have added the custom field to the filter section and want it to work for filtering the grid data, similar to filtering by "Customer," you might need to override the ApplyAdditionalFilters method. This would allow you to include the custom field in the filtering logic.

Below is the method that can be overridden to achieve this. You would need to ensure that the custom field is incorporated properly for filtering.

Hope, it helps!


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