Acumatica Smart Panel not showing Empty Data message when opening - acumatica

I have a smart panel to show a popup on grid column click. This smart panel popup has one grid. This grid is opened without error and display data. But in-case if view doesn't have any data grid empty data message is not displaying. User has to click on grid toolbar refresh button.
<asp:Content ID="cont1" ContentPlaceHolderID="phDS" runat="Server">
<px:PXDataSource ID="ds" runat="server" Visible="True" TypeName="GraphName" PrimaryView="MyOrders" PageLoadBehavior="GoLastRecord" AttributesFound="False" EnableAttributes="False" SuspendUnloading="False">
<CallbackCommands>
<px:PXDSCallbackCommand Name="GotoSteps" Visible="False" DependOnGrid="PXGrid2" />
</CallbackCommands>
</px:PXDataSource>
</asp:Content>
<px:PXTab ID="tab" runat="server" Width="100%" Height="100%">
<Items>
<px:PXTabItem Text="Test Results">
<Template>
<px:PXGrid ID="PXGrid2" runat="server" OnRowDataBound="grid2_RowDataBound" DataSourceID="ds" Width="100%" Height="100%" SkinID="DetailsInTab" SyncPosition="True" TabIndex="2600">
<EmptyMsg ComboAddMessage="No records found.
Try to change filter or modify parameters above to see records here."
NamedComboMessage="No records found as '{0}'.
Try to change filter or modify parameters above to see records here."
NamedComboAddMessage="No records found as '{0}'.
Try to change filter or modify parameters above to see records here."
FilteredMessage="No records found.
Try to change filter to see records here."
FilteredAddMessage="No records found.
Try to change filter to see records here."
NamedFilteredMessage="No records found as '{0}'.
Try to change filter to see records here."
NamedFilteredAddMessage="No records found as '{0}'.
Try to change filter to see records here."
AnonFilteredMessage="No records found.
Try to change filter to see records here."
AnonFilteredAddMessage="No records found.
Try to change filter to see records here."></EmptyMsg>
<Levels>
<px:PXGridLevel DataKeyNames="OrderId" DataMember="MyOrders">
<Columns>
<px:PXGridColumn DataField="Steps" Width="180px" LinkCommand="GotoSteps" CommitChanges="true">
</px:PXGridColumn>
</Columns>
</px:PXGridLevel>
</Levels>
<AutoSize Enabled="True" />
<AutoCallBack />
<ActionBar>
<CustomItems>
<px:PXToolBarButton Text="Add Sample" Key="cmdSample" CommandName="AddSample" CommandSourceID="ds" DependOnGrid="PXGrid2">
<AutoCallBack>
<Behavior CommitChanges="True" PostData="Page"></Behavior>
</AutoCallBack>
</px:PXToolBarButton>
</CustomItems>
</ActionBar>
</px:PXGrid>
</Template>
<AutoCallBack Target="PXGrid2" Command="Refresh">
<Behavior RepaintControlsIDs="PXGrid2" />
</AutoCallBack>
</px:PXTabItem>
</Items>
<AutoSize Enabled="True" ></AutoSize>
</px:PXTab>
<asp:Content ID="cont2" ContentPlaceHolderID="phF" runat="Server">
<px:PXSmartPanel ID="pnlTestSteps" runat="server" Height="400px" Width="1100px" Caption="Test Steps" CaptionVisible="true" AutoReload="true" LoadOnDemand="true" Key="TestSteps" Style="position: static"
AutoCallBack-Target="StepsGrid" AutoCallBack-Command="Refresh" DesignView="Content">
<px:PXGrid ID="StepsGrid" runat="server" DataSourceID="ds" SkinID="Inquire" Height="90%"
Width="100%" AutoAdjustColumns="true" >
<EmptyMsg ComboAddMessage="No records found.
Try to change filter or modify parameters above to see records here."
NamedComboMessage="No records found as '{0}'.
Try to change filter or modify parameters above to see records here."
NamedComboAddMessage="No records found as '{0}'.
Try to change filter or modify parameters above to see records here."
FilteredMessage="No records found.
Try to change filter to see records here."
FilteredAddMessage="No records found.
Try to change filter to see records here."
NamedFilteredMessage="No records found as '{0}'.
Try to change filter to see records here."
NamedFilteredAddMessage="No records found as '{0}'.
Try to change filter to see records here."
AnonFilteredMessage="No records found.
Try to change filter to see records here."
AnonFilteredAddMessage="No records found.
Try to change filter to see records here."></EmptyMsg>
<Levels>
<px:PXGridLevel DataMember="TestSteps" Visible="true">
<Columns>
<px:PXGridColumn DataField="Name">
</px:PXGridColumn>
<px:PXGridColumn DataField="Description">
</px:PXGridColumn>
</Columns>
</px:PXGridLevel>
</Levels>
</px:PXGrid>
<px:PXPanel ID="PXPanel7" runat="server" SkinID="Buttons">
<px:PXButton ID="PXButton9" runat="server" DialogResult="OK" Text="OK"></px:PXButton>
</px:PXPanel>
</px:PXSmartPanel>
</asp:Content>
C# Graph Code
public PXAction<GraphClass> GoToSteps;
[PXButton(Tooltip = "Open Popup" )]
[PXUIField(DisplayName = "Steps")]
public virtual void gotoSteps() {
TestSteps.AskExt(true);
return;
}
Images

Related

How to show Grid with detail form in Master detail form in acumatica?

I have master child relationship form.
In child form, I have a Grid, I want my own "Insert" functionality so i just disabled "AddNew" Grid action button and Add new Custom button,
Now what i want
In custom Add button, I am calling child.Insert() method to add row,
Now i can see added row in Grid,
I want to update added row using Detail form, not using Grid row so i added a Formview, below of Grid
In formview i want to show inserted row detail, it is showing the current added row.
On selection of Grid row, I want to show detail in detail Grid
If user edit the detail then i wanted to show all edit detail in the Grid,
so similarly user can add/edit multiple rows using detail form, How may i achieve this?
After adding a row, If i want to add another row then on click add button getting unsaved data error, How may i achieve above functionality?
<px:PXFormView ID="rootCauseanaDataTab" runat="server" Width="100%" DataMember="MyData"
DataSourceID="ds" SkinID="Transparent">
<Template>
<px:PXLayoutRule runat="server" StartRow="true" StartColumn="True" LabelsWidth="SM" ControlSize="XM"></px:PXLayoutRule>
<px:PXButton ID="pxAddNew" runat="server" CommandName="AddNewData" CommandSourceID="ds" Text="Add Rootcause"></px:PXButton>
<px:PXLayoutRule runat="server" StartRow="true" StartColumn="True" LabelsWidth="SM" ControlSize="XM"></px:PXLayoutRule>
<px:PXSelector ID="edRootId" runat="server" AlreadyLocalized="False" DataField="CauseId" AutoRefresh="true">
</px:PXSelector>
<px:PXRichTextEdit ID="edRootCauseDesc" runat="server" AlreadyLocalized="False" DataField="Description">
</px:PXRichTextEdit>
</Template>
</px:PXFormView>
<px:PXGrid ID="PXGridNCTranRootCauseanaData" RepaintColumns="true" runat="server" Caption="Root Cause anaData" DataSourceID="ds" Height="150px" Width="100%" SkinID="Details" SyncPosition="true">
<ActionBar>
<Actions>
<AddNew Enabled="false" />
</Actions>
</ActionBar>
<Levels>
<px:PXGridLevel DataKeyNames="CauseId" DataMember="MyData">
<RowTemplate>
<px:PXLayoutRule runat="server" ControlSize="XM" LabelsWidth="M" StartColumn="True" />
<px:PXSelector ID="gdRootcauseId" runat="server" AllowEdit="true" AlreadyLocalized="False" DataField="RootCauseId" AutoRefresh="true">
</px:PXSelector>
<px:PXSelector ID="gdanaDataPerformedBy" AllowEdit="true" runat="server" AlreadyLocalized="False" DataField="anaDataPerformedBy" AutoRefresh="true">
</px:PXSelector>
</RowTemplate>
<Columns>
<px:PXGridColumn DataField="CauseId" TextAlign="Left" Width="135px" />
<px:PXGridColumn DataField="Description" Width="80px" />
</Columns>
</px:PXGridLevel>
</Levels>
<AutoCallBack Target="tree" Command="Refresh" ActiveBehavior="True">
<Behavior RepaintControlsIDs="rootCauseanaDataTab"></Behavior>
</AutoCallBack>
</px:PXGrid>
Regarding your issue that the form is not being refreshed I noticed that your Target is set as Tree, can you try changing that to rootCauseanaDataTab as well? And also try adding BlockPage="True" CommitChanges="True"
Sample Code:
<AutoCallBack Target="rootCauseanaDataTab" Command="Refresh" ActiveBehavior="True">
<Behavior RepaintControlsIDs="rootCauseanaDataTab" BlockPage="True" CommitChanges="True"></Behavior>
</AutoCallBack>

Custom Inquiry Screen Tab Disappears when Committing Changes

I have a custom inquiry screen. You select a customer and a date, and it will display information on different records for the customer. Two tabs are custom tables, one tab is contracts (Leases), and the other tab is all items that are certain non-stock items (deposits) that are paid and refunded.
When I select a customer, the "Leases" tab disappears. When I launch the inquiry from an action on a screen, the data shows. But changing any information on the screen causes the tab to close. All tabs are setup the same. Here is the grid in question:
<px:PXTabItem Text="Leases">
<Template>
<px:PXGrid ID="gridCustomerLeases" runat="server" DataSourceID="ds" Width="100%" Height="150px" SkinID="Details" AllowAutoHide="False" TabIndex="700">
<Levels>
<px:PXGridLevel DataMember="CustomerLeases">
<RowTemplate>
<px:PXNumberEdit ID="edCLTQty" runat="server" AlreadyLocalized="False" DataField="ContractDetail__Qty"></px:PXNumberEdit>
<px:PXSegmentMask ID="edCLTUsrCYLeaseInventoryID" runat="server" DataField="InventoryItem__UsrCYLeaseInventoryID" AllowEdit="true"></px:PXSegmentMask>
<px:PXSegmentMask ID="edCLTInventoryItem__InventoryCD" runat="server" DataField="InventoryItem__InventoryCD" AllowEdit="true"></px:PXSegmentMask>
</RowTemplate>
<Columns>
<px:PXGridColumn DataField="InventoryItem__InventoryCD"></px:PXGridColumn>
<px:PXGridColumn DataField="InventoryItem__UsrCYLeaseInventoryID"></px:PXGridColumn>
<px:PXGridColumn DataField="ContractDetail__Qty" TextAlign="Right" Width="100px"></px:PXGridColumn>
<px:PXGridColumn DataField="Contract__ActivationDate" TextAlign="Right" Width="150px"></px:PXGridColumn>
<px:PXGridColumn DataField="Contract__ExpireDate" TextAlign="Right" Width="150px"></px:PXGridColumn>
</Columns>
</px:PXGridLevel>
</Levels>
<AutoSize Container="Window" Enabled="True" MinHeight="150" />
</px:PXGrid>
</Template>
</px:PXTabItem>
Here is the view that is attached to the grid
public SelectFrom<ContractDetail>
.InnerJoin<Contract>.On<ContractDetail.contractID.IsEqual<Contract.contractID>>
.InnerJoin<ContractItem>.On<ContractItem.contractItemID.IsEqual<ContractDetail.contractItemID>>
.InnerJoin<InventoryItem>.On<InventoryItemExt.usrCYLeaseContractItemID.IsEqual<ContractItem.contractItemID>>
.Where<Brackets<
Contract.terminationDate.IsNull
.Or<Contract.terminationDate.IsGreaterEqual<CustomerCylinderInqFilter.fromDate.FromCurrent>>
>
.And<Contract.customerID.IsEqual<CustomerCylinderInqFilter.customerID.FromCurrent>
.And<Contract.activationDate.IsLessEqual<CustomerCylinderInqFilter.fromDate.FromCurrent>>>>
.View.ReadOnly
CustomerLeases;
Other grids use similar fields and the same filtered fields but show correctly.
You must have the primary view associated with the view on the grid without specifying the DAC in the grid. Because ContractDetail is the primary DAC on the view, ContractDetail__ must be removed. Updating the lines
<px:PXNumberEdit ID="edCLTQty" runat="server" AlreadyLocalized="False" DataField="ContractDetail__Qty"></px:PXNumberEdit>
<px:PXGridColumn DataField="Qty" TextAlign="Right" Width="100px"></px:PXGridColumn>
to
<px:PXNumberEdit ID="edCLTQty" runat="server" AlreadyLocalized="False" DataField="ContractDetail__Qty"></px:PXNumberEdit>
<px:PXGridColumn DataField="Qty" TextAlign="Right" Width="100px"></px:PXGridColumn>
worked.
You may run into this when copying a grid and changing the primary DAC on the view and not removing the DAC prefix on the DataField properties.

PXSelector allowEdit

How do you make the allowEdit choice on selector fields on the grid available in the layout editor?
It seems that allowEdit choice on selector fields only works on forms but not on grids.
AllowEdit can be used in a grid under the RowTemplate of the grid. Example below shows a grid with an OrderNbr field (sample from Sales Order Page SO301000):
<px:PXGridLevel DataMember="posupply">
<Columns>
<px:PXGridColumn DataField="OrderNbr" Width="80px" />
</Columns>
<RowTemplate>
<px:PXSelector ID="edOrderNbr" runat="server" DataField="OrderNbr" AllowEdit="True" />
</RowTemplate>
</px:PXGridLevel>

How to get Split container inside the new custom tab in Existing Sales order screen

Am trying to bring Two grids in one tab in Acumatica base sales order screen
Like below show
Ex:In custom PAX tab with "Passengers" grid and "Flights" grid by using Split container
enter image description here
Can anyone suggest me.
You need to add a PXSplitContainer with the split bar set to Vertical orientation.
ASPX Code:
<px:PXTabItem>
<Template>
<px:PXSplitContainer runat="server" Orientation="Vertical" SplitterPosition="640" ID="gridContainer" Height="100%" Width="100%" BorderWidth="14px" BorderStyle="Solid" BorderColor="Transparent" AllowResize="True">
<AutoSize Enabled="True" Container="Parent" />
<Template1>
<px:PXGrid runat="server" ID="gridLeft" Height="100%" SkinID="Details" Caption="Left Grid Caption" CaptionVisible="True" Width="640px" SyncPosition="True" Style='height:100%;width:100%;'>
<Levels>
<px:PXGridLevel DataMember="LeftDataView">
<Columns>
<px:PXGridColumn DataField="columnX" />
<px:PXGridColumn DataField="columnY" />
<px:PXGridColumn DataField="columnZ" />
</Columns>
</px:PXGridLevel>
</Levels>
</px:PXGrid>
</Template1>
<Template2>
<px:PXGrid runat="server" ID="gridRight" Height="100%" SkinID="Inquire" Caption="Right Grid Caption" CaptionVisible="True" Width="100%" SyncPosition="True" Style='width:100%;height:100%;'>
<Levels>
<px:PXGridLevel DataMember="RightDataView">
<Columns>
<px:PXGridColumn DataField="columnX" />
<px:PXGridColumn DataField="columnY" />
<px:PXGridColumn DataField="columnZ" />
</Columns>
</px:PXGridLevel>
</Levels>
</px:PXGrid>
</Template2>
</px:PXSplitContainer>
</Template>
</px:PXTabItem>
It is easier to make these kind of modifications using EDIT ASPX feature.
Additional information on adding Split Containers can be found here:
https://asiablog.acumatica.com/2018/05/split-container-in-browser.html

Acumatica Filtering PXSelector witth quick search

I have a custom dac and pxselector like this :
With quick search (red bordered search) I want to filter with every properties. For example with Waybill Type, Transportation Type, Status etc. But quick search works only for Reference Nbr.
Of course you can filter from columns but in business requirements I need to filter from quick search.
You can use FastFilterFields property of the GridProperties element to achieve that. You need to add all the fields you need for the search function in FastFilterFields:
<px:PXSelector ID="SelectorID" runat="server" DataField="SelectorField">
<GridProperties FastFilterFields="ReferenceNbr, WaybillType, TransportationType, Status, WaybillNumber, WaybillState" />
</px:PXSelector>
If the selector is in a grid instead of a form, use RowTemplate:
<px:PXGrid ID="gridID" runat="server" DataSourceID="ds">
<Levels>
<px:PXGridLevel DataMember="GridDataView">
<RowTemplate>
<px:PXSelector ID="edSelectorID" runat="server" DataField="SelectorField">
<GridProperties FastFilterFields="ReferenceNbr, WaybillType, TransportationType, Status, WaybillNumber, WaybillState" />
</px:PXSelector>
</RowTemplate>
<Columns>
<px:PXGridColumn DataField="SelectorField" />
</Columns>
</px:PXGridLevel>
</Levels>
</px:PXGrid>

Resources