Basically the following record doesn’t allow me to navigate, even though I have the same setup on another screen and it works, maybe its something I’m missing with Many2many and parent child setup, when I pick a record nothing happens and the field resets to the value of the current record
I was basically going for a Many2many relationship between my custom dac and the Contact dac, and having in a FormGrid screen
namespace Telemarketing
{
[PXPrimaryGraph(typeof(TeleMarketerListMaint))]
[PXCacheName(Messages.TeleMarketerList)]
public class TeleMarketerList : PXBqlTable, IBqlTable
{
#region ListID
public abstract class listID : PX.Data.BQL.BqlString.Field<listID> { }
[PXDBString(15, IsKey = true, IsUnicode = true, InputMask = ">CCCCCCCCCCCCCCC")]
[PXDefault()]
[PXUIField(DisplayName = "List ID", Visibility = PXUIVisibility.SelectorVisible, Required = true)]
[PXSelector(typeof(Search<TeleMarketerList.listID>),
typeof(TeleMarketerList.listID),
typeof(TeleMarketerList.description),
DescriptionField = typeof(TeleMarketerList.description),
Filterable = true)]
[AutoNumber(
typeof(Search<CRSetup_Extension.usrTeleMarketerListNumberingID>),
typeof(AccessInfo.businessDate)
)]
public virtual string ListID { get; set; }
#endregion
}namespace Telemarketing
{
[PXCacheName("Telemarketer List Contact")]
public class TeleMarketerListContact : PXBqlTable, IBqlTable
{
#region ListID (Foreign Key to TeleMarketerList)
public abstract class listID : PX.Data.BQL.BqlString.Field<listID> { }
[PXDBString(15, IsKey = true, IsUnicode = true)]
[PXUIField(DisplayName = "List ID")]
[PXDBDefault(typeof(TeleMarketerList.listID))]
[PXParent(typeof(Select<TeleMarketerList, Where<TeleMarketerList.listID, Equal<Current<TeleMarketerListContact.listID>>>>))]
public virtual string ListID { get; set; }
#endregion
#region ContactID (Foreign Key to Contact)
public abstract class contactID : PX.Data.BQL.BqlInt.Field<contactID> { }
[PXDBInt(IsKey = true)]
[PXUIField(DisplayName = "Contact")]
[PXSelector(typeof(Search<Contact.contactID>),
typeof(Contact.displayName),
typeof(Contact.eMail),
typeof(Contact.phone1),
DescriptionField = typeof(Contact.displayName),
SubstituteKey = typeof(Contact.displayName))]
public virtual int? ContactID { get; set; }
#endregion
}
}<%@ Page Language="C#" MasterPageFile="~/MasterPages/FormDetail.master" AutoEventWireup="true" ValidateRequest="false" CodeFile="XT201000.aspx.cs" Inherits="Page_XT201000" Title="Untitled Page" %>
<%@ MasterType VirtualPath="~/MasterPages/FormDetail.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phDS" Runat="Server">
<px:PXDataSource ID="ds" runat="server" Visible="True" Width="100%"
PrimaryView="Document" TypeName="Telemarketing.TeleMarketerListMaint">
<CallbackCommands>
<px:PXDSCallbackCommand Name="Insert" PostData="Self" />
<px:PXDSCallbackCommand CommitChanges="True" Name="Save" />
<px:PXDSCallbackCommand Name="First" PostData="Self" StartNewGroup="True" />
<px:PXDSCallbackCommand Name="Last" PostData="Self" />
<px:PXDSCallbackCommand Name="AddContacts" Visible="False" />
<px:PXDSCallbackCommand Name="RemoveContact" Visible="False" />
</CallbackCommands>
</px:PXDataSource>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="phF" Runat="Server">
<px:PXFormView ID="form" runat="server" DataSourceID="ds" Width="100%"
DataMember="Document">
<Template>
<px:PXSelector CommitChanges="True" runat="server"
ID="edListID" DataField="ListID"
AutoRefresh="True">
<GridProperties>
<Layout ColumnsMenu="False" />
</GridProperties>
</px:PXSelector>
<px:PXCheckBox ID="chkIsActive" runat="server" DataField="IsActive" />
<px:PXLayoutRule runat="server" StartRow="True" LabelsWidth="M" ControlSize="XXL" />
<px:PXTextEdit ID="edDescription" runat="server" DataField="Description" />
</Template>
</px:PXFormView>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="phG" Runat="Server">
<px:PXTab ID="tab" runat="server" Width="100%" Height="150px" DataSourceID="ds" DataMember="Document">
<Items>
<px:PXTabItem Text="Contacts">
<Template>
<px:PXGrid ID="gridContacts" runat="server" DataSourceID="ds" Width="100%"
Height="400px" SkinID="Details" TabIndex="300" AllowInsert="False">
<Levels>
<px:PXGridLevel DataMember="Contacts" >
<Columns>
<px:PXGridColumn DataField="ContactDisplayName" Width="200px" />
<px:PXGridColumn DataField="ContactEmail" Width="200px" />
<px:PXGridColumn DataField="ContactPhone" Width="120px" />
<px:PXGridColumn DataField="DateAdded" Width="90px" />
<px:PXGridColumn DataField="IsActive" Type="CheckBox" Width="60px" />
</Columns>
</px:PXGridLevel>
</Levels>
<ActionBar>
<CustomItems>
<px:PXToolBarButton Key="AddContacts" Text="Add Contacts">
<AutoCallBack Command="AddContacts" Target="ds" />
</px:PXToolBarButton>
<px:PXToolBarButton Key="RemoveContact" Text="Remove">
<AutoCallBack Command="RemoveContact" Target="ds" />
</px:PXToolBarButton>
</CustomItems>
</ActionBar>
<AutoSize Container="Parent" Enabled="True" MinHeight="400" />
</px:PXGrid>
</Template>
</px:PXTabItem>
</Items>
<AutoSize Container="Window" Enabled="True" MinHeight="150" />
</px:PXTab>
<!-- Smart Panel for Adding Contacts -->
<px:PXSmartPanel ID="pnlAddContacts" runat="server" Caption="Add Contacts"
CaptionVisible="true" DesignView="Hidden" LoadOnDemand="true"
Key="AvailableContacts" AutoCallBack-Enabled="true" AutoCallBack-Target="gridAvailableContacts"
AutoCallBack-Command="Refresh" CallBackMode-CommitChanges="True"
CallBackMode-PostData="Page" AcceptButtonID="btnAddContactsOK"
CancelButtonID="btnAddContactsCancel">
<px:PXGrid ID="gridAvailableContacts" runat="server" DataSourceID="ds"
Width="100%" Height="400px" SkinID="Inquire" TabIndex="500">
<Levels>
<px:PXGridLevel DataMember="AvailableContacts">
<Columns>
<px:PXGridColumn AllowCheckAll="True" DataField="Selected"
TextAlign="Center" Type="CheckBox" Width="40px" />
<px:PXGridColumn DataField="DisplayName" Width="200px" />
<px:PXGridColumn DataField="EMail" Width="200px" />
<px:PXGridColumn DataField="Phone1" Width="120px" />
<px:PXGridColumn DataField="BAccountID" Width="100px" />
</Columns>
</px:PXGridLevel>
</Levels>
<AutoSize Container="Parent" Enabled="True" MinHeight="400" />
</px:PXGrid>
<px:PXPanel ID="pnlAddContactsButtons" runat="server" SkinID="Buttons">
<px:PXButton ID="btnAddContactsOK" runat="server" DialogResult="OK" Text="Add Selected" />
<px:PXButton ID="btnAddContactsCancel" runat="server" DialogResult="Cancel" Text="Cancel" />
</px:PXPanel>
</px:PXSmartPanel>
</asp:Content>