【问题标题】:Acumatica Generic inquiry default to last weekAcumatica 通用查询默认为上周
【发布时间】:2017-11-02 19:15:47
【问题描述】:

我如何默认通用查询默认显示上周数据。

我希望 GI 在我进行 View Inquiry 时显示上周的数据,但也可以稍后从参数中更改日期。

【问题讨论】:

    标签: customization acumatica


    【解决方案1】:

    对于 GI 参数默认值,您可以使用 @WeekStart-1@WeekEnd-1,如屏幕截图所示...

    如果今天是 11/3/17,则结果将返回 10/22 的开始和 10/28 的结束 p>

    如果使用日期字段作为参数“Schema Field”并检查“From Schema”,您可以看到可能的日期函数,如下所示...

    对于我在示例中使用的通用查询,下面是 XML。将内容保存在 XML 文件中,如果您想测试它,可以作为 GI 上传。

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <data-set>
      <relations format-version="3" relations-version="20170805" main-table="GIDesign">
        <link from="GIFilter (DesignID)" to="GIDesign (DesignID)" />
        <link from="GIGroupBy (DesignID)" to="GIDesign (DesignID)" />
        <link from="GIMassAction (DesignID)" to="GIDesign (DesignID)" />
        <link from="GIMassUpdateField (DesignID)" to="GIDesign (DesignID)" />
        <link from="GINavigationScreen (DesignID)" to="GIDesign (DesignID)" />
        <link from="GINavigationParameter (DesignID, ScreenID)" to="GINavigationScreen (DesignID, ScreenID)" />
        <link from="GIOn (DesignID, RelationNbr)" to="GIRelation (DesignID, LineNbr)" />
        <link from="GIRecordDefault (DesignID)" to="GIDesign (DesignID)" />
        <link from="GIRelation (DesignID, ParentTable)" to="GITable (DesignID, Alias)" />
        <link from="GIRelation (DesignID, ChildTable)" to="GITable (DesignID, Alias)" />
        <link from="GIResult (DesignID)" to="GIDesign (DesignID)" />
        <link from="GIResult (ObjectName, DesignID)" to="GITable (Alias, DesignID)" />
        <link from="GISort (DesignID)" to="GIDesign (DesignID)" />
        <link from="GITable (DesignID)" to="GIDesign (DesignID)" />
        <link from="GIWhere (DesignID)" to="GIDesign (DesignID)" />
        <link from="SiteMap (Url)" to="GIDesign (DesignID)" type="WeakByUrl" linkname="toDesignById" baseurl="~/GenericInquiry/GenericInquiry.aspx" paramnames="id" />
        <link from="SiteMap (Url)" to="GIDesign (Name)" type="WeakByUrl" linkname="toDesignByName" baseurl="~/GenericInquiry/GenericInquiry.aspx" />
        <link from="ListEntryPoint (ListScreenID)" to="SiteMap (ScreenID)" />
        <link from="SiteMap (ScreenID)" to="GIDesign (PrimaryScreenIDNew)" linkname="to1Screen" />
        <link from="SiteMap (NodeID)" to="SiteMap (ParentID)" type="WeakToParent" recursive-nesting="yes" include-parents="False" />
        <link from="MUIScreen (NodeID)" to="SiteMap (NodeID)" />
        <link from="MUIWorkspace (WorkspaceID)" to="MUIScreen (WorkspaceID)" type="FromMaster" linkname="workspaceToScreen" split-location="yes" updateable="True" />
        <link from="MUISubcategory (SubcategoryID)" to="MUIScreen (SubcategoryID)" type="FromMaster" updateable="True" />
        <link from="MUITile (ScreenID)" to="SiteMap (ScreenID)" />
        <link from="MUIWorkspace (WorkspaceID)" to="MUITile (WorkspaceID)" type="FromMaster" linkname="workspaceToTile" split-location="yes" updateable="True" />
        <link from="MUIArea (AreaID)" to="MUIWorkspace (AreaID)" type="FromMaster" updateable="True" />
        <link from="MUIPinnedScreen (NodeID, WorkspaceID)" to="MUIScreen (NodeID, WorkspaceID)" type="WeakIfEmpty" isEmpty="Username" />
        <link from="MUIFavoriteWorkspace (WorkspaceID)" to="MUIWorkspace (WorkspaceID)" type="WeakIfEmpty" isEmpty="Username" />
        <link from="GIDesign (NoteID)" to="Note (NoteID)" type="Note" />
        <link from="GIFilter (NoteID)" to="Note (NoteID)" type="Note" />
        <link from="GIFilter (NoteID)" to="GIFilterKvExt (RecordID)" type="RowKvExt" />
        <link from="GIGroupBy (NoteID)" to="Note (NoteID)" type="Note" />
        <link from="GIOn (NoteID)" to="Note (NoteID)" type="Note" />
        <link from="GIRelation (NoteID)" to="Note (NoteID)" type="Note" />
        <link from="GIResult (NoteID)" to="Note (NoteID)" type="Note" />
        <link from="GIResult (NoteID)" to="GIResultKvExt (RecordID)" type="RowKvExt" />
        <link from="GISort (NoteID)" to="Note (NoteID)" type="Note" />
        <link from="GITable (NoteID)" to="Note (NoteID)" type="Note" />
        <link from="GIWhere (NoteID)" to="Note (NoteID)" type="Note" />
      </relations>
      <layout>
        <table name="GIDesign">
          <table name="GIFilter" uplink="(DesignID) = (DesignID)">
            <table name="Note" uplink="(NoteID) = (NoteID)" />
            <table name="GIFilterKvExt" uplink="(NoteID) = (RecordID)" />
          </table>
          <table name="GIGroupBy" uplink="(DesignID) = (DesignID)">
            <table name="Note" uplink="(NoteID) = (NoteID)" />
          </table>
          <table name="GIMassAction" uplink="(DesignID) = (DesignID)" />
          <table name="GIMassUpdateField" uplink="(DesignID) = (DesignID)" />
          <table name="GINavigationScreen" uplink="(DesignID) = (DesignID)">
            <table name="GINavigationParameter" uplink="(DesignID, ScreenID) = (DesignID, ScreenID)" />
          </table>
          <table name="GIRecordDefault" uplink="(DesignID) = (DesignID)" />
          <table name="GISort" uplink="(DesignID) = (DesignID)">
            <table name="Note" uplink="(NoteID) = (NoteID)" />
          </table>
          <table name="GITable" uplink="(DesignID) = (DesignID)">
            <table name="GIRelation" uplink="(DesignID, Alias) = (DesignID, ParentTable)">
              <table name="GIOn" uplink="(DesignID, LineNbr) = (DesignID, RelationNbr)">
                <table name="Note" uplink="(NoteID) = (NoteID)" />
              </table>
              <table name="Note" uplink="(NoteID) = (NoteID)" />
            </table>
            <table name="GIResult" uplink="(Alias, DesignID) = (ObjectName, DesignID)">
              <table name="Note" uplink="(NoteID) = (NoteID)" />
              <table name="GIResultKvExt" uplink="(NoteID) = (RecordID)" />
            </table>
            <table name="Note" uplink="(NoteID) = (NoteID)" />
          </table>
          <table name="GIWhere" uplink="(DesignID) = (DesignID)">
            <table name="Note" uplink="(NoteID) = (NoteID)" />
          </table>
          <table name="SiteMap" uplink="(DesignID) = (Url)" recursion="(NodeID) = (ParentID)" linkname="toDesignById">
            <table name="ListEntryPoint" uplink="(ScreenID) = (ListScreenID)" />
            <table name="MUIScreen" uplink="(NodeID) = (NodeID)">
              <table name="MUIPinnedScreen" uplink="(NodeID, WorkspaceID) = (NodeID, WorkspaceID)" />
            </table>
            <table name="MUITile" uplink="(ScreenID) = (ScreenID)" />
          </table>
          <table name="SiteMap" uplink="(Name) = (Url)" recursion="(NodeID) = (ParentID)" linkname="toDesignByName">
            <table name="ListEntryPoint" uplink="(ScreenID) = (ListScreenID)" />
            <table name="MUIScreen" uplink="(NodeID) = (NodeID)">
              <table name="MUIPinnedScreen" uplink="(NodeID, WorkspaceID) = (NodeID, WorkspaceID)" />
            </table>
            <table name="MUITile" uplink="(ScreenID) = (ScreenID)" />
          </table>
          <table name="SiteMap" uplink="(PrimaryScreenIDNew) = (ScreenID)" recursion="(NodeID) = (ParentID)" linkname="to1Screen">
            <table name="ListEntryPoint" uplink="(ScreenID) = (ListScreenID)" />
            <table name="MUIScreen" uplink="(NodeID) = (NodeID)">
              <table name="MUIPinnedScreen" uplink="(NodeID, WorkspaceID) = (NodeID, WorkspaceID)" />
            </table>
            <table name="MUITile" uplink="(ScreenID) = (ScreenID)" />
          </table>
          <table name="Note" uplink="(NoteID) = (NoteID)" />
        </table>
        <table name="MUIWorkspace">
          <table name="MUIFavoriteWorkspace" uplink="(WorkspaceID) = (WorkspaceID)" />
        </table>
        <table name="MUISubcategory" />
        <table name="MUIArea" />
      </layout>
      <data>
        <GIDesign>
          <row DesignID="64910ad5-ae67-4fca-b791-058849f2814d" Name="TESTDATES" FilterColCount="3" PagerStyle="0" PageSize="0" NewRecordCreationEnabled="0" MassDeleteEnabled="0" AutoConfirmDelete="0" MassRecordsUpdateEnabled="0" MassActionsOnRecordsEnabled="0" ExposeViaOData="0">
            <GIFilter LineNbr="1" IsActive="1" Name="DateFrom" FieldName="INTran.tranDate" DataType="string" DisplayName="From Date" IsExpression="1" DefaultValue="@WeekStart-1" ColSpan="1" Required="0" />
            <GIFilter LineNbr="2" IsActive="1" Name="DateTo" FieldName="INTran.tranDate" DataType="string" DisplayName="To Date" IsExpression="1" DefaultValue="@WeekEnd-1" ColSpan="1" Required="0" />
            <GISort LineNbr="1" IsActive="1" DataFieldName="INTran.tranDate" SortOrder="A" />
            <GISort LineNbr="2" IsActive="1" DataFieldName="InventoryItem.inventoryCD" SortOrder="A" />
            <GITable Alias="INTran" Name="PX.Objects.IN.INTran">
              <GIRelation LineNbr="1" ChildTable="InventoryItem" IsActive="1" JoinType="I">
                <GIOn LineNbr="1" ParentField="inventoryID" Condition="E " ChildField="inventoryID" Operation="A" />
              </GIRelation>
              <GIResult LineNbr="1" IsActive="1" Field="tranDate" SchemaField="INTran.TranDate" IsVisible="1" DefaultNav="1" RowID="0dcfd9ab-a8e9-4b47-9dbb-be31e37a0291" />
              <GIResult LineNbr="2" IsActive="1" Field="tranType" SchemaField="INTran.TranType" IsVisible="1" DefaultNav="1" RowID="51d68bd5-e0d6-4d3a-8367-94260886de85" />
              <GIResult LineNbr="4" IsActive="1" Field="qty" SchemaField="INTran.Qty" IsVisible="1" DefaultNav="1" RowID="cd4144b0-eef2-4266-9a1f-d6ee123e2445" />
              <GIResult LineNbr="5" IsActive="1" Field="uOM" SchemaField="INTran.UOM" IsVisible="1" DefaultNav="1" RowID="df04268c-bded-4995-ab4a-97852c56f1be" />
            </GITable>
            <GITable Alias="InventoryItem" Name="PX.Objects.IN.InventoryItem">
              <GIResult LineNbr="3" IsActive="1" Field="inventoryID" SchemaField="InventoryItem.InventoryID" IsVisible="1" DefaultNav="1" RowID="627befa9-e0f8-41ab-b09d-df56e2aca331" />
            </GITable>
            <GIWhere LineNbr="1" IsActive="1" OpenBrackets="(        " DataFieldName="INTran.tranDate" Condition="B " IsExpression="0" Value1="[DateFrom]" Value2="[DateTo]" CloseBrackets=")        " Operation="A" />
          </row>
        </GIDesign>
      </data>
    </data-set>
    

    【讨论】:

    • 这行得通!它显示上周的数据,但是当我尝试更改日期和日期时,它不会更新结果
    • 我更新了我使用的条件(图像),并且在我更改日期时工作正常。我还包括了我在示例中使用的 GI xml,您可以将其复制并粘贴到新文件(xml 文件扩展名)中,然后在 GI 屏幕上导入 Acumatica。
    猜你喜欢
    • 2014-10-06
    • 2018-04-22
    • 2016-11-24
    • 1970-01-01
    • 2021-02-04
    • 2019-04-30
    • 2020-12-14
    • 2018-07-03
    • 1970-01-01
    相关资源
    最近更新 更多