I'm trying to use the INLotSerialNbrAttribute on my custom screen. I get below error message. I think it must have something to do with some screens using the split function. For my screen I just want to allow a single Serial Number per line similar to the adjustment screen. Do I need to add something on my graph to handle this or should I create my own selector?
Here's the definition of my DAC field
#region LotSerialNbr
[PXUIField(DisplayName = "Lot Serial Nbr")]
[INLotSerialNbr(typeof(AHSVendorCoreDetails.inventoryID),
typeof(AHSVendorCoreDetails.subItemID), typeof(AHSVendorCoreDetails.locationID),
PersistingCheck = PXPersistingCheck.Nothing)]
public virtual string LotSerialNbr { get; set; }
public abstract class lotSerialNbr : PX.Data.BQL.BqlString.Field<lotSerialNbr> { }
#endregion
[PXArgumentException: IN Error: The specified type
AHSVendorCore.AHSVendorCoreDetails must implement the
PX.Objects.IN.ILSMaster interface. Parameter name: itemType]
PX.Data.PXCacheCollection.get_Item(Type key) +1547
PX.Data.PXGraph.GetStateExt(String viewName, Object data, String
fieldName) +383 PX.Web.UI.PXGrid.bk() +345 PX.Web.UI.PXGrid.d()
+64 PX.Web.UI.PXGrid.InitColumnsLayout() +262 PX.Web.UI.PXGrid.CreateChildControls(IEnumerable dataSource, Boolean
dataBinding) +498
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()
+230 System.Web.UI.Control.EnsureChildControls() +130 System.Web.UI.Control.PreRenderRecursiveInternal() +66
System.Web.UI.Control.PreRenderRecursiveInternal() +297
System.Web.UI.Control.PreRenderRecursiveInternal() +297
System.Web.UI.Control.PreRenderRecursiveInternal() +297
System.Web.UI.Control.PreRenderRecursiveInternal() +297
System.Web.UI.Control.PreRenderRecursiveInternal() +297
System.Web.UI.Control.PreRenderRecursiveInternal() +297
System.Web.UI.Control.PreRenderRecursiveInternal() +297
System.Web.UI.Control.PreRenderRecursiveInternal() +297
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+7479
Edit
Here's the definition of the grid columns.
<px:PXGridColumn DataField="LineNbr" Width="70" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="InventoryID" Width="70" ></px:PXGridColumn>
<px:PXGridColumn DataField="TranDesc" Width="280" ></px:PXGridColumn>
<px:PXGridColumn DataField="UOM" Width="72" ></px:PXGridColumn>
<px:PXGridColumn DataField="ReturnQty" Width="100" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="SiteID" Width="140" ></px:PXGridColumn>
<px:PXGridColumn DataField="LocationID" Width="70" ></px:PXGridColumn>
<px:PXGridColumn DataField="LotSerialNbr" Width="220" /></Columns></px:PXGridLevel></Levels></px:PXGrid></Template></px:PXTabItem></Items>
Edit 2
Here's the updated version with the row template showing the lot serial field is a selector. I'm still getting the same issue.
<px:PXGrid SyncPosition="True" runat="server" ID="CstPXGrid2" Height="473px" SkinID="Details" Width="100%" DataSourceID="">
<Levels>
<px:PXGridLevel DataMember="Details" >
<Columns>
<px:PXGridColumn DataField="LineNbr" Width="70" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="InventoryID" Width="70" ></px:PXGridColumn>
<px:PXGridColumn DataField="TranDesc" Width="280" ></px:PXGridColumn>
<px:PXGridColumn DataField="UOM" Width="72" ></px:PXGridColumn>
<px:PXGridColumn DataField="ReturnQty" Width="100" ></px:PXGridColumn>
<px:PXGridColumn CommitChanges="True" DataField="SiteID" Width="140" ></px:PXGridColumn>
<px:PXGridColumn DataField="LocationID" Width="70" ></px:PXGridColumn>
<px:PXGridColumn DataField="LotSerialNbr" Width="220" ></px:PXGridColumn></Columns>
<RowTemplate>
<px:PXSelector runat="server" ID="CstPXSelector12" DataField="LotSerialNbr" ></px:PXSelector>
<px:PXNumberEdit runat="server" ID="CstPXNumberEdit13" DataField="LineNbr" />
<px:PXSegmentMask runat="server" ID="CstPXSegmentMask14" DataField="InventoryID" />
<px:PXTextEdit runat="server" ID="CstPXTextEdit15" DataField="TranDesc" />
<px:PXSelector runat="server" ID="CstPXSelector16" DataField="UOM" />
<px:PXNumberEdit runat="server" ID="CstPXNumberEdit17" DataField="ReturnQty" />
<px:PXSegmentMask runat="server" ID="CstPXSegmentMask18" DataField="SiteID" />
<px:PXSegmentMask runat="server" ID="CstPXSegmentMask19" DataField="LocationID" /></RowTemplate></px:PXGridLevel></Levels></px:PXGrid>
I think you just need to make sure your DAC implements the ILSMaster interface and related fields. If not fully needed just make all required fields Non db fields (Ex: PXInt vs PXDBInt) with unbound defaults to provide some default information. For example InvtMult helps determine if receipt or issue transaction and you can have it default to -1, 0, or 1 depending on your requirements.
Ex:
public class AHSVendorCoreDetails : PX.Data.IBqlTable, ILSMaster
{
// Include all required fields from ILSMaster (can be bound or unbound fields)
}
Related
I'm trying to extend the AccountByPeriodEnq business logic, yet i'm facing the following problem :
I can't seem to fire the GLTranR_RowUpdated or GLTranR_Selected_FieldUpdated events. (Unless I click the refresh button, then the events are fired)
Here's my code :
#region EventHandler
protected void GLTranR_Selected_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e, PXFieldUpdated del)
{
del?.Invoke(cache, e);
var row = (GLTranR)e.Row;
}
protected void GLTranR_RowUpdated(PXCache cache, PXRowUpdatedEventArgs e)
{
var row = (GLTranR)e.Row;
}
#endregion
When I put a breakpoint on any of those methods, it never actually break.
It seems the original event is never fired as well (Located in AccountByPeriodEnq.cs graph) since I never see the Reclassify button being disabled.
protected virtual void GLTranR_Selected_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
{
reclassify.SetEnabled(GetSelectedTrans().Any());
}
I have checked in the aspx and the commitchanges=true is set for the "Selected" field.
Here's the aspx :
<%# Page Language="C#" MasterPageFile="~/MasterPages/FormDetail.master" AutoEventWireup="true"
ValidateRequest="false" CodeFile="GL404000.aspx.cs" Inherits="Page_GL404000"
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%" TypeName="PX.Objects.GL.AccountByPeriodEnq"
PrimaryView="Filter" PageLoadBehavior="PopulateSavedValues">
<CallbackCommands>
<px:PXDSCallbackCommand CommitChanges="True" Name="previousperiod" HideText="True"/>
<px:PXDSCallbackCommand CommitChanges="True" Name="nextperiod" HideText="True"/>
<px:PXDSCallbackCommand DependOnGrid="grid" Name="Reclassify" CommitChanges="True"/>
<px:PXDSCallbackCommand DependOnGrid="grid" Name="ReclassifyAll"/>
<px:PXDSCallbackCommand DependOnGrid="grid" Name="ReclassificationHistory" StateColumn="IncludedInReclassHistory"/>
</CallbackCommands>
</px:PXDataSource>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="phF" runat="Server">
<px:PXFormView ID="form" runat="server" Width="100%"
Caption="Selection" DataMember="Filter" DefaultControlID="edFinPeriodID" DataSourceID="ds" TabIndex="100">
<Template>
<px:PXLayoutRule runat="server" StartColumn="True" LabelsWidth="SM" ControlSize="M" ></px:PXLayoutRule>
<px:PXSelector CommitChanges="True" ID="edOrganizationID" runat="server" DataField="OrganizationID"></px:PXSelector>
<px:PXSegmentMask CommitChanges="True" ID="edBranchID" runat="server" DataField="BranchID" Autorefresh="true"></px:PXSegmentMask>
<px:PXSelector CommitChanges="True" ID="edLedgerID" runat="server" DataField="LedgerID" Autorefresh="true"></px:PXSelector>
<px:PXSelector CommitChanges="True" ID="edStartPeriodID" runat="server" DataField="StartPeriodID"></px:PXSelector>
<px:PXSelector CommitChanges="True" ID="edEndPeriodID" runat="server" DataField="EndPeriodID" Autorefresh="True"></px:PXSelector>
<px:PXSegmentMask CommitChanges="True" ID="edAccountID" runat="server" DataField="AccountID"></px:PXSegmentMask>
<px:PXSegmentMask CommitChanges="True" ID="edSubID" runat="server" DataField="SubID" SelectMode="Segment" ></px:PXSegmentMask>
<px:PXLayoutRule runat="server" StartColumn="True" LabelsWidth="SM" ControlSize="S" ></px:PXLayoutRule>
<px:PXDateTimeEdit CommitChanges="True" ID="edStartDateUI" runat="server" DataField="StartDateUI" ></px:PXDateTimeEdit>
<px:PXDateTimeEdit CommitChanges="True" ID="edPeriodStartDate" runat="server" DataField="PeriodStartDateUI" ></px:PXDateTimeEdit>
<px:PXDateTimeEdit CommitChanges="True" ID="edEndDateUI" runat="server" DataField="EndDateUI" ></px:PXDateTimeEdit>
<px:PXDateTimeEdit CommitChanges="True" ID="edPeriodEndDateUI" runat="server" DataField="PeriodEndDateUI" ></px:PXDateTimeEdit>
<px:PXNumberEdit runat="server" ID="CstPXNumberEdit1" DataField="UsrCreditTotal" CommitChanges="True" />
<px:PXNumberEdit runat="server" ID="CstPXNumberEdit2" DataField="UsrDebitTotal" CommitChanges="True" />
<px:PXNumberEdit runat="server" ID="CstPXNumberEdit14" DataField="UsrSolde" CommitChanges="True" />
<px:PXLayoutRule runat="server" StartColumn="True" SuppressLabel="True" ></px:PXLayoutRule>
<px:PXCheckBox CommitChanges="True" ID="chkShowSummary" runat="server" DataField="ShowSummary" ></px:PXCheckBox>
<px:PXCheckBox CommitChanges="True" ID="chkIncludeUnposted" runat="server" DataField="IncludeUnposted" ></px:PXCheckBox>
<px:PXCheckBox CommitChanges="True" ID="chkIncludeUnreleased" runat="server" DataField="IncludeUnreleased" ></px:PXCheckBox>
<px:PXCheckBox CommitChanges="True" ID="chkIncludeReclassified" runat="server" DataField="IncludeReclassified" ></px:PXCheckBox>
<px:PXCheckBox CommitChanges="True" ID="chkShowCuryDetail" runat="server" DataField="ShowCuryDetail" ></px:PXCheckBox>
<px:PXLayoutRule runat="server" StartColumn="True">
</px:PXLayoutRule>
<px:PXNumberEdit ID="edBegBal" runat="server" DataField="BegBal">
</px:PXNumberEdit>
<px:PXNumberEdit ID="edTurnOver" runat="server" DataField="TurnOver">
</px:PXNumberEdit>
<px:PXNumberEdit ID="edEndBal" runat="server" DataField="EndBal">
</px:PXNumberEdit>
<px:PXGroupBox runat="server" ID="groupAffichage" Caption="Afficher" CommitChanges="True" DataField="UsrAffichage" RenderSimple="True" RenderStyle="RoundBorder">
<ContentLayout Layout="Stack" />
<Template>
<px:PXRadioButton runat="server" ID="CstRadioButton15" Text="Tous" Value="0" Checked="False" GroupName="groupAffichage" />
<px:PXRadioButton runat="server" ID="CstRadioButton16" Value="1" Text="Lettres" GroupName="groupAffichage" Checked="False" />
<px:PXRadioButton runat="server" ID="CstRadioButton17" GroupName="groupAffichage" Value="2" Text="Non lettres" Checked="True" /></Template></px:PXGroupBox></Template>
</px:PXFormView></asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="phG" runat="Server">
<px:PXGrid ID="grid" runat="server" Height="150px"
Width="100%" AllowPaging="True" AdjustPageSize="Auto" Caption="Summary By Period" SyncPosition ="True" FastFilterFields="TranDesc,RefNbr,"
BatchUpdate="True" AllowSearch="True" SkinID="PrimaryInquire" RestrictFields="True" DataSourceID="ds" TabIndex="100" PreserveSortsAndFilters="False">
<CallbackCommands>
<Refresh RepaintControlsIDs="form"/>
</CallbackCommands>
<AutoSize Container="Window" Enabled="True" />
<Mode AllowAddNew="False" AllowDelete="False" />
<Levels>
<px:PXGridLevel DataMember="GLTranEnq">
<Columns>
<px:PXGridColumn DataField="Selected" TextAlign="Center" Type="CheckBox" Width="30px" AllowCheckAll="True" AllowShowHide="Server" CommitChanges="True"></px:PXGridColumn>
<px:PXGridColumn DataField="Module" Width="100px" ></px:PXGridColumn>
<px:PXGridColumn DataField="BatchNbr" Width="100px" LinkCommand="ViewBatch" ></px:PXGridColumn>
<px:PXGridColumn DataField="TranDate" Width="100px" ></px:PXGridColumn>
<px:PXGridColumn DataField="FinPeriodID" Width="100px" ></px:PXGridColumn>
<px:PXGridColumn DataField="TranDesc" Width="224px" ></px:PXGridColumn>
<px:PXGridColumn DataField="RefNbr" Width="100px" LinkCommand="ViewDocument" ></px:PXGridColumn>
<px:PXGridColumn DataField="LineNbr" TextAlign="Right" Width="100px" ></px:PXGridColumn>
<px:PXGridColumn DataField="BranchID" Width="100px" ></px:PXGridColumn>
<px:PXGridColumn DataField="AccountID" Width="108px" ></px:PXGridColumn>
<px:PXGridColumn DataField="SubID" Width="198px" ></px:PXGridColumn>
<px:PXGridColumn DataField="SignBegBalance" TextAlign="Right" Width="100px" ></px:PXGridColumn>
<px:PXGridColumn DataField="DebitAmt" TextAlign="Right" Width="100px" ></px:PXGridColumn>
<px:PXGridColumn DataField="CreditAmt" TextAlign="Right" Width="100px" ></px:PXGridColumn>
<px:PXGridColumn DataField="SignEndBalance" TextAlign="Right" MatrixMode="True" Width="100px" ></px:PXGridColumn>
<px:PXGridColumn DataField="CuryID" AllowShowHide="Server" ></px:PXGridColumn>
<px:PXGridColumn DataField="SignCuryBegBalance" TextAlign="Right" Width="100px" AllowShowHide="Server" ></px:PXGridColumn>
<px:PXGridColumn DataField="CuryDebitAmt" TextAlign="Right" Width="100px" AllowShowHide="Server" ></px:PXGridColumn>
<px:PXGridColumn DataField="CuryCreditAmt" TextAlign="Right" Width="100px" AllowShowHide="Server" ></px:PXGridColumn>
<px:PXGridColumn DataField="SignCuryEndBalance" TextAlign="Right" Width="100px" AllowShowHide="Server" ></px:PXGridColumn>
<px:PXGridColumn DataField="InventoryID" Width="120px" ></px:PXGridColumn>
<px:PXGridColumn DataField="ReferenceID" Width="120px" ></px:PXGridColumn>
<px:PXGridColumn DataField="ReferenceID_BaccountR_AcctName" Width="200px" ></px:PXGridColumn>
<px:PXGridColumn DataField="ReclassBatchNbr" TextAlign="Right" Width="120px" AllowShowHide="Server" LinkCommand="ViewReclassBatch" ></px:PXGridColumn>
<px:PXGridColumn DataField="IncludedInReclassHistory" AllowShowHide="False" Visible="false" SyncVisible="false" ></px:PXGridColumn>
<px:PXGridColumn DataField="UsrLettrageNbr" Width="70" CommitChanges="True" /></Columns>
</px:PXGridLevel>
</Levels>
<AutoSize Container="Window" Enabled="True" MinHeight="400" />
<ActionBar DefaultAction="DoubleClick" />
</px:PXGrid>
</asp:Content>
What am I missing ? I spent a few hours on it already and I've ran out of ideas.
Edit:
My end goal is to calculate the sum of the credit and debit for the selected lines on filter view. If you have any workaround to update these values everytime I select a new line, i'll take it.
Maybe with some javascript and a callback command ?
I opened a support ticket on this matter on the acumatica partner center.
Edit 2 :
So, I created my own custom selector :
#region UsrletSel
[PXBool]
[PXUIField(DisplayName = "Lettrer")]
public virtual bool? UsrletSel { get; set; }
public abstract class usrletSel : IBqlField { }
#endregion
Then I hid the base selector in aspx, and to keep the original logic I bound the new selector to the base one :
protected void GLTranR_UsrletSel_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
if (e.Row == null) return;
var row = (GLTranR)e.Row;
if(row.GetExtension<GLTranExt>().UsrletSel == true)
{
row.Selected = true;
}
else
{
row.Selected = false;
}
}
I set the property CommitChanges=True in aspx for my new field, but i'm still unable to fire any event on this screen.
do you have any idea ?
Edit 3 :
So I totaly randomly got my checkbox (but also the original selected checkbox) to trigger events. You have to double click on the checkbox. (Which doesnt make any sens.) But I can't really tell my customer "start by double clicking if you want your total to calculates".
At 20s
http://recordit.co/1fzW3eDIO9
Regards,
The final answer was the property "BatchUpdate" was set to "true" on the Grid, which prevents the changes to be commited to the server.
Once you set it to false it works fine :
To my knowledge there's no way to do it.
This is the same issue here:
Checkbox control in a grid is not triggering fieldupdated event
The Selected field appears to have special hardcoded logic tied to it. When you read the Selected value in the BLC graph it doesn't provide the current value displayed on screen. Also the field doesn't fire events like the other fields.
I found only two way to get around this:
Use a field with a different name, if the field name is Selected it won't behave like other fields.
Try to implement all your logic using only DAC Field Attributes. This is very hard to achieve.
I don't have a complete solution for #2 but if all you need is a total this code would be a good start:
// Selected count
[PXUnboundFormula(typeof(Switch<Case<Where<DAC.selected, Equal<True>>, int1>, int0>),
typeof(SumCalc<FilterDAC.selectedCount>))]
protected void DAC_Selected_CacheAttached(PXCache sender)
{
}
[PXProcessButton]
[PXUIField(DisplayName = "Select All")]
protected virtual void selectAll()
{
foreach (DAC doc in Dataview.Select())
{
if (doc.Selected != true)
{
doc.Selected = true;
Dataview.Cache.SetStatus(doc, PXEntryStatus.Updated);
}
}
FilterDAC copy = PXCache<FilterDAC>.CreateCopy(FilterDAC.Current);
PXFormulaAttribute.CalcAggregate<DAC.selected>(Dataview.Cache, copy);
Filter.Update(copy);
}
We have a new page where we are looking to use the CS Attributes similarly to how they are used in the Item Class and Non Stock item pages
Item Class: Attribute definition.
Non Stock item page: Attribute implementation.
NOTE: I simplified the page to narrow down any potentially needed attributes in the ASPX.
Based on this, my Attribute definition page has the following elements:
Graph:
#region Datamembers
public PXSelect<MDEquipmentType> EquipmentType;
[PXViewName("Attributes")]
public CSAttributeGroupList<MDEquipmentType, MDEquipment> Mapping;
#endregion
ASPX:
<px:PXTabItem Text="Attributes">
<Template>
<px:PXGrid ID="grid" runat="server" DataSourceID="ds" Height="150px" Style="z-index: 100;
border: 0px;" Width="100%" ActionsPosition="Top" SkinID="Details" MatrixMode="True">
<Levels>
<px:PXGridLevel DataMember="Mapping">
<RowTemplate>
<px:PXSelector CommitChanges="True" ID="edAttributeID" runat="server" DataField="AttributeID" AllowEdit="True" FilterByAllFields="True" />
</RowTemplate>
<Columns>
<px:PXGridColumn DataField="IsActive" AllowNull="False" TextAlign="Center" Type="CheckBox" />
<px:PXGridColumn DataField="AttributeID" Width="81px" AutoCallBack="true" LinkCommand="CRAttribute_ViewDetails" />
<px:PXGridColumn AllowNull="False" DataField="Description" Width="351px" />
<px:PXGridColumn DataField="SortOrder" TextAlign="Right" Width="81px" SortDirection="Ascending" />
<px:PXGridColumn AllowNull="False" DataField="Required" TextAlign="Center" Type="CheckBox" />
<px:PXGridColumn AllowNull="True" DataField="CSAttribute__IsInternal" TextAlign="Center" Type="CheckBox" />
<px:PXGridColumn AllowNull="False" DataField="ControlType" Type="DropDownList" Width="81px" />
<px:PXGridColumn AllowNull="True" DataField="DefaultValue" Width="100px" RenderEditorText="False" />
</Columns>
</px:PXGridLevel>
</Levels>
<AutoSize Enabled="True" MinHeight="150" />
</px:PXGrid>
</Template>
</px:PXTabItem>
Result:
So far so good, all records are persisted in the DB correctly in the table CSAttributeGroup
Now, the problem comes when I try to apply the attributes in the data entry page.
This is the page:
When the Equipment Type is set, the attribute grid does not populate.
Graph definition:
public class MDEquipmentEntry : PXGraph<MDEquipmentEntry, MDEquipment>
{
#region Datamembers
public PXSelect<MDEquipment> Equipment;
public CRAttributeList<MDEquipment> Answers;
ASPX:
<px:PXTabItem Text="Attributes">
<Template>
<px:PXGrid ID="PXGridAnswers" runat="server" Caption="Attributes" DataSourceID="ds" SkinID="Inquire" Width="100%" Height="200px" MatrixMode="True">
<Levels>
<px:PXGridLevel DataMember="Answers">
<Columns>
<px:PXGridColumn DataField="AttributeID" />
<px:PXGridColumn DataField="isRequired" TextAlign="Center" Type="CheckBox" Width="80px"/>
<px:PXGridColumn DataField="Value" Width="300px" AllowShowHide="False" AllowSort="False" />
</Columns>
<Layout FormViewHeight="" />
</px:PXGridLevel>
</Levels>
<AutoSize Enabled="True" MinHeight="200" />
<ActionBar>
<Actions>
<Search Enabled="False" />
</Actions>
</ActionBar>
<Mode AllowAddNew="False" AllowColMoving="False" AllowDelete="False" />
</px:PXGrid>
</Template>
</px:PXTabItem>
In the Nonstock item page the attribute is loaded immediately after inserting the Item Class. So I made sure that the commitChanges attribute was added to my page. Also looked for a FieldUpdated event that could be triggering the insertion but that does not appear to be needed.
What could be missing from my code?
The implementation of CRAttributeList depends on a class ID field being defined somewhere in your class. Upon initialization, CRAttributeList will look for a field in your MDEquipment DAC decorated with the CRAttributesField attribute.
For the InventoryItem DAC, here's how it is defined:
[CRAttributesField(typeof(InventoryItem.itemClassID))]
public virtual string[] Attributes { get; set; }
If system is unable to determine the current class ID, your attributes grid will not be populated with anything.
I'm trying to add an hyperlink from a field in a grid in a processing screen pointing to a custom object I made but it seems it doesnt do anything.
When I try to debug and set breakpoints it seems it doesnt even execute the code in my function.
I tried following this : How to create a hyperlink user field
And I tried to follow the example 3.4 in T200 (which is basically the same)
Here's my code :
public PXAction<ARRegister> ViewLettering;
[PXButton]
protected virtual void viewLettering()
{
ARRegister row = LinesPendingLettering.Current;
LELettering letPiece = PXSelect<LELettering,
Where<LELettering.letteringCD,
Equal<Required<LELettering.letteringCD>>>>
.Select(this, row.GetExtension<ARRegisterLeExt>().LettrageCD);
// Create instance of destination graph
LetteringAR graph = PXGraph.CreateInstance<LetteringAR>();
graph.Piece.Current = letPiece;
if (graph.Piece.Current != null)
{
throw new PXRedirectRequiredException(graph, true, Constantes.letteringPiece);
}
else
{
throw new PXException(Constantes.errNotFound);
}
}
#endregion
And the code of my page :
<%# Page Language="C#" MasterPageFile="~/MasterPages/FormDetail.master" AutoEventWireup="true" ValidateRequest="false" CodeFile="LE202001.aspx.cs" Inherits="Page_LE202001" Title="Untitled Page" %>
<%# MasterType VirtualPath="~/MasterPages/FormDetail.master" %>
<asp:Content ID="cont1" ContentPlaceHolderID="phDS" Runat="Server">
<px:PXDataSource ID="ds" runat="server" Visible="True" Width="100%"
TypeName="LE.ProcessAR"
PrimaryView="Filter"
>
<CallbackCommands>
<px:PXDSCallbackCommand Name="ViewLettering" Visible="False" DependOnGrid="grid" /></CallbackCommands>
</px:PXDataSource>
</asp:Content>
<asp:Content ID="cont2" ContentPlaceHolderID="phF" Runat="Server">
<px:PXFormView ID="form" runat="server" DataSourceID="ds" DataMember="Filter" Width="100%" Height="100px" AllowAutoHide="false">
<Template>
<px:PXLayoutRule StartColumn="True" ID="PXLayoutRule1" runat="server" StartRow="False"></px:PXLayoutRule>
<px:PXSelector CommitChanges="True" runat="server" ID="CstPXSelector2" DataField="BranchID" ></px:PXSelector>
<px:PXSelector AutoRefresh="True" CommitChanges="True" runat="server" ID="CstPXSelector1" DataField="AccountID" ></px:PXSelector>
<px:PXLayoutRule runat="server" ID="CstPXLayoutRule5" StartColumn="True" ></px:PXLayoutRule>
<px:PXNumberEdit runat="server" ID="CstPXNumberEdit3" DataField="TotalCredit" ></px:PXNumberEdit>
<px:PXNumberEdit runat="server" ID="CstPXNumberEdit4" DataField="TotalDebit" ></px:PXNumberEdit>
<px:PXLayoutRule runat="server" ID="CstPXLayoutRule6" StartColumn="True" />
<px:PXCheckBox CommitChanges="True" runat="server" ID="CstPXCheckBox7" DataField="ShowAll" ></px:PXCheckBox></Template>
</px:PXFormView>
</asp:Content>
<asp:Content ID="cont3" ContentPlaceHolderID="phG" Runat="Server">
<px:PXGrid SyncPosition="True" AutoAdjustColumns="True" ID="grid" runat="server" DataSourceID="ds" Width="100%" Height="150px" SkinID="Details" AllowAutoHide="false">
<Levels>
<px:PXGridLevel DataMember="LinesPendingLettering">
<Columns>
<px:PXGridColumn Type="CheckBox" AllowFilter="True" AllowCheckAll="True" CommitChanges="True" DataField="Selected" Width="30" ></px:PXGridColumn>
<px:PXGridColumn DataField="DocType" Width="70" ></px:PXGridColumn>
<px:PXGridColumn DataField="RefNbr" Width="70" ></px:PXGridColumn>
<px:PXGridColumn DataField="DocDesc" Width="200" ></px:PXGridColumn>
<px:PXGridColumn DataField="CuryOrigDocAmt" Width="100" ></px:PXGridColumn>
<px:PXGridColumn DataField="CuryID" Width="70" ></px:PXGridColumn>
<px:PXGridColumn LinkCommand="ViewLettering" DataField="LettrageCD" Width="70" ></px:PXGridColumn></Columns>
</px:PXGridLevel>
</Levels>
<AutoSize Container="Window" Enabled="True" MinHeight="150" ></AutoSize>
<ActionBar >
</ActionBar>
</px:PXGrid>
</asp:Content>
The generic type parameter of PXAction has to be the same DAC as the primary view DAC.
The primary view attribute is set on PXDataSource element in the ASPX page:
<px:PXDataSource ID="ds" runat="server" PrimaryView="Filter">
In your graph or graph extension you can locate the primary view DAC:
public PXFilter<DAC> Filter;
Make sure the PXAction declaration is on the same DAC:
public PXAction<DAC> Action;
Adding an observation I had to this older thread, hoping it may help someone:
If you have everything setup as recommended but it is still not working, look carefully at your use of OrderBy in the View's delegate, specifically whether you defined an OrderBy<> directly on its PXSelectBase or used an OrderByNew<> later in
the delegate logic. Using OrderBy<> worked well, but using OrderByNew<> affected the functionality. Details:
The View:
[PXFilterable()]
public PXSelectOrderBy<DAC, OrderBy<Asc<DAC.field1>>> Records;
The Delegate:
protected virtual IEnumerable records()
{
PXSelectBase<DAC> cmd = new PXSelectJoinOrderBy<DAC,
InnerJoin<OtherDAC, On<DAC.field1, Equal<OtherDAC.field1>>>,
OrderBy<Desc<DAC.field1,
Desc<DAC.field2>>>>(this);
...
some filtering logic
...
// defining OrderByNew affected DependOnGrid/LinkCommand functionality
// cmd.OrderByNew<OrderBy<Desc<DAC.field1,
// Desc<DAC.field2>>>>();
foreach(DAC rec in cmd.Select())
yield return rec;
}
I am using 2018R1, Build 18.112.0019.
I am have problem with Grid in Checks and Payments screen. When I click on "Add row" button a new row appears in the grid, but not in cache. Events such as APAdjust_RowInserting, APAdjust_RowInserted are not triggered.
Maybe somebody know why this happens?
To trigger a callback to the server as soon as a new row is inserted in a grid, you need to add the tag <Mode InitNewRow="true" />.
Here's an example:
<px:PXGrid ID="grid" runat="server" Height="150px" Width="100%" Caption="Temporary Credit Limit History"
SkinID="Details">
<Levels>
<px:PXGridLevel DataMember="ARTempCreditLimitRecord">
<Columns>
<px:PXGridColumn DataField="CustomerID" TextAlign="Right" Visible="False" />
<px:PXGridColumn DataField="StartDate" Width="90px" AutoCallBack="True" />
<px:PXGridColumn DataField="EndDate" Width="90px" AutoCallBack="True" />
<px:PXGridColumn DataField="TempCreditLimit" TextAlign="Right" Width="100px" />
<px:PXGridColumn DataField="LineID" TextAlign="Right" Visible="False" />
</Columns>
</px:PXGridLevel>
</Levels>
<Mode InitNewRow="True" />
<AutoSize Container="Window" Enabled="True" MinHeight="150" />
</px:PXGrid>
I am trying to add a tab to the AR Customer screen, AR303000. The tab has a grid that will display all of the items that the customer has purchased using the following query:
public PXSelectJoin<ARTran,
InnerJoin<InventoryItem, On<ARTran.inventoryID,
Equal<InventoryItem.inventoryID>>>,
Where<ARTran.customerID, Equal<Current<BAccount.bAccountID>>>> CustomerItemSales;
I have added the appropriate columns to the grid and it does display the correct records.
The issue that I am having is that not all of the selected columns are being displayed. Specifically the Transaction Date and Transaction Type fields. The fields to appear in the customization screen when I "View ASPX".
Here is the ASPX from the Customization -> Inspect Element -> Actions -> View ASPX Source menu item:
<px:PXTabItem Text="Item Sales" RepaintOnDemand="True">
<Template>
<px:PXGrid runat="server" ID="CstPXGrid1" AutoAdjustColumns="True" Width="100%" AllowPaging="True" AdjustPageSize="Auto">
<Levels>
<px:PXGridLevel DataMember="CustomerItemSales">
<Columns>
<px:PXGridColumn DataField="InventoryItem__InventoryCD" Width="70" LinkCommand="InventoryItem_ViewDetails" />
<px:PXGridColumn DataField="InventoryID_description" Width="200" />
<px:PXGridColumn DataField="TranDate" TextAlign="Center" />
<px:PXGridColumn DataField="TranType" Width="70" TextAlign="Center" DisplayMode="Text" />
<px:PXGridColumn DataField="BranchID" Width="120" TextAlign="Center" />
<px:PXGridColumn DataField="RefNbr" TextAlign="Center" />
<px:PXGridColumn DataField="UOM" Width="70" TextAlign="Center" />
<px:PXGridColumn DataField="Qty" Width="100" />
<px:PXGridColumn DataField="CuryTranAmt" Width="100" />
</Columns>
</px:PXGridLevel>
</Levels>
<AutoSize Enabled="True" MinWidth="200" Container="Parent" />
<Mode AllowAddNew="False" AllowDelete="False" AllowUpdate="False" />
</px:PXGrid>
</Template>
</px:PXTabItem>
What could be causing the problem and how would I debug this? I know the fields are in the data object because I have an event handler for RowSelected where I have set a breakpoint in VS and looked at the data.
Not sure what was going on, but I exported the project, deleted it and then imported it and it started working.