Skip to main content
Question

smart panel selector not working

  • April 9, 2026
  • 4 replies
  • 36 views

Forum|alt.badge.img

I am having issues with a selector field on a smartpanel. It has the right values when i click the eyeglass, but when i select one, it comes up and then disappears. any ideas on what i did wrong?

           #region Customer
[PXInt(IsKey = true)]
[PXUIField(DisplayName = "Customer")]
[PXMergeAttributes(Method = MergeMethod.Merge)]


[PXSelector(typeof(Search5<BillOfLadingLine.customerID, LeftJoin<BAccount, On<BillOfLadingLine.customerID, Equal<BAccount.bAccountID>>>
, Where<BillOfLadingLine.truckNbr, Equal<BillOfLadingLine.truckNbr.FromCurrent>>, Aggregate<GroupBy<BillOfLadingLine.customerID>>>)
// , typeof(BAccount.acctCD)
//, typeof(BAccount.acctName)
// ,SubstituteKey = typeof(BAccount.acctName)
)]
public virtual int? Customer { get; set; }
public abstract class customer : PX.Data.BQL.BqlInt.Field<customer> { }
#endregion







<px:PXSmartPanel LoadOnDemand="True" Height="400px" Width="400px" runat="server" ID="pnDelivery" Key="DeliveryDacView" AutoReload="True" AutoRepaint="True" ShowAfterLoad="True" AutoCallBack-Target="fmDelivery">
<px:PXFormView Width="100%" ID="fmDelivery" runat="server" skinid="Transparent" Datamember="DeliveryDacView" dataSourceID="ds">
<Template>
<px:PXLayoutRule ColumnWidth="XM" LabelsWidth="S" runat="server" ID="CstPXLayoutRule34" StartColumn="True" ></px:PXLayoutRule>
<px:PXSelector SyncStateWithCommand="" DisplayMode="Value" CommitChanges="True" runat="server" ID="CstPXSelector36" DataField="Customer" ></px:PXSelector>
<px:PXTextEdit CommitChanges="True" runat="server" ID="CstPXTextEdit38" DataField="Recipient" ></px:PXTextEdit>
<px:PXTextEdit CommitChanges="True" runat="server" ID="CstPXTextEdit35" DataField="Comment" ></px:PXTextEdit>
<px:PXTextEdit CommitChanges="True" runat="server" ID="CstPXTextEdit37" DataField="Email" ></px:PXTextEdit></Template>
</px:PXFormView>
<px:PXPanel SkinID="Buttons" runat="server" ID="pnDeliverybtn" >
<px:PXButton DialogResult="OK" Text="Save" runat="server" ID="btnDeliveryOK" ></px:PXButton>
<px:PXButton DialogResult="Cancel" Text="Cancel" runat="server" ID="btnDeliveryCancel" ></px:PXButton></px:PXPanel></px:PXSmartPanel></asp:Content>

 

4 replies

Forum|alt.badge.img+2
  • Jr Varsity I
  • April 9, 2026

@justen0351 It is hard to know without seeing the full code.

Is this a field from your main DAC that you are showing in a panel? If so, I don’t think you would need to use PXMergeAttributes because you should be able to use the same attributes as the base field. If this is a filter DAC, then I don’t think you should need PXMergeAttributes because this should be a new DAC with a new version of that field. Also if it is a filter DAC I am not sure IsKey is needed.

If you are still having issues, it might be helpful to share the full version of the DAC/DAC extension or filter DAC you are using.


Forum|alt.badge.img
  • Author
  • Semi-Pro I
  • April 10, 2026

@Josiah Lisle it is currently not coming from the main dac. i have a form/grid screen with a popup. The popup is designed where you can select a singel “Customer” from the main screen and the smartpanel will populate the line items for each that have the same customer.  I tried without merge attributes and without having one be the key and it still didnt work. below is the smartpanel code and the full dac for it.

 #region Smartpanel for deliveries
public PXFilter<DeliveryDAC> DeliveryDacView;

// public SelectFrom<DeliveryDAC>.View DeliveryDacView;
public SelectFrom<BillOfLadingLine>.Where<BillOfLadingLine.truckNbr.IsEqual<BillOfLadingLine.truckNbr.FromCurrent>.And<BillOfLadingLine.customerID.IsEqual<DeliveryDAC.customer>>>.View MyLines;

public PXAction<BillOfLading> AddDelivery;
[PXUIField(DisplayName = "Add Delivery", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
//[PXUIEnabled(typeof(Where<BillOfLading.status.IsNotEqual<canceled>>))]
[PXButton(CommitChanges = true)]


protected virtual IEnumerable addDelivery(PXAdapter adapter)
{

if (DeliveryDacView.AskExt(true) == WebDialogResult.OK)
{
//if (MyLines == null)
// return adapter.Get();


var filter = DeliveryDacView.Current;
if (filter == null)
return adapter.Get();



foreach (BillOfLadingLine line in MyLines.Select())
{
line.CustomerID = filter.Customer;
line.Recipient = filter.Recipient;
line.Comment = filter.Comment;
line.Email = filter.Email;
line.DeliveryTime = DateTime.Now;

MyLines.Update(line);


}

}

return adapter.Get();

}


public class DeliveryDAC : PXBqlTable, IBqlTable
{




#region Customer
[PXInt(IsKey = true)]
[PXUIField(DisplayName = "Customer")]
[PXMergeAttributes(Method = MergeMethod.Merge)]


[PXSelector(typeof(Search5<BillOfLadingLine.customerID, LeftJoin<BAccount, On<BillOfLadingLine.customerID, Equal<BAccount.bAccountID>>>
, Where<BillOfLadingLine.truckNbr, Equal<BillOfLadingLine.truckNbr.FromCurrent>>, Aggregate<GroupBy<BillOfLadingLine.customerID>>>)
// , typeof(BAccount.acctCD)
//, typeof(BAccount.acctName)
// ,SubstituteKey = typeof(BAccount.acctName)
)]
public virtual int? Customer { get; set; }
public abstract class customer : PX.Data.BQL.BqlInt.Field<customer> { }
#endregion


#region Recipient
[PXString(255)]
[PXUIField(DisplayName = "Recipient")]
public virtual string Recipient { get; set; }
public abstract class recipient : PX.Data.BQL.BqlString.Field<recipient> { }
#endregion

#region Email
[PXString(255, IsUnicode = true)]
[PXUIField(DisplayName = "Email")]
public virtual string Email { get; set; }
public abstract class email : PX.Data.BQL.BqlString.Field<email> { }
#endregion


#region Comment
[PXString(255, IsUnicode =true)]
[PXUIField(DisplayName = "Comment")]
public virtual string Comment { get; set; }
public abstract class comment : PX.Data.BQL.BqlString.Field <comment> { }
#endregion





}
#endregion

 


Forum|alt.badge.img+2
  • Jr Varsity I
  • April 10, 2026

I am not totally clear on exactly what you are trying to do, but 2 things I see that stick out:

1) You are referring to your BillOfLadingLine multiple times in the same query, for example: Where<BillOfLadingLine.truckNbr, Equal<BillOfLadingLine.truckNbr.FromCurrent»

I believe if you are wanting syntax like this, you would need to create an alias of your table to use in the query, so the system knows to differentiate the two. Otherwise you are joining the table to itself which wouldn’t make sense. For example, something like

public class BillOfLadingLineMyCopy : BillOfLadingLine { }
//and the attribute using this alias would be:
[PXSelector(typeof(Search5<BillOfLadingLineMyCopy.customerID, LeftJoin<BAccount, On<BillOfLadingLineMyCopy.customerID, Equal<BAccount.bAccountID>>>
       , Where<BillOfLadingLineMyCopy.truckNbr, Equal<BillOfLadingLine.truckNbr.FromCurrent>>, Aggregate<GroupBy<BillOfLadingLineMyCopy.customerID>>>)
    // , typeof(BAccount.acctCD)
    //, typeof(BAccount.acctName)
    // ,SubstituteKey = typeof(BAccount.acctName)
    )]

This is assuming your general idea is correct and you are wanting to look at another view that uses the same table that is already being used on the screen.

2) The other thing I would suggest you to try is simplify your selector, to confirm whether the issue is with the selector or elsewhere. For example, instead of the Search5 query, just do a simple search of all BAccount.baccountID to see if the simple version works as expected, or if something else is going on. Also the mergeattribute should not be needed.


Forum|alt.badge.img+2
  • Jr Varsity III
  • April 10, 2026

@justen0351 Hi,
    Could please remove this line [PXInt(IsKey = true)] and test. Hope will work.