Customization Acumatica通用查询默认为上周

Customization Acumatica通用查询默认为上周,customization,acumatica,Customization,Acumatica,如何默认常规查询显示上周数据 我希望GI在查看查询时显示上周的数据,但也能够在以后更改参数的日期。对于GI参数的默认值,您可以使用@WeekStart-1和@WeekEnd-1,如屏幕截图所示 如果今天的结果是11/3/17将返回10/22的开始和10/28 如果使用日期字段作为参数“Schema field”,并选中“From Schema”,则可以看到可能的日期函数,如下所示 对于我在示例中使用的一般查询,下面是XML。将内容保存在XML文件中,并作为GI上载(如果要测试) <

如何默认常规查询显示上周数据


我希望GI在查看查询时显示上周的数据,但也能够在以后更改参数的日期。

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

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

如果使用日期字段作为参数“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参数的默认值,您可以使用@WeekStart-1和@WeekEnd-1,如屏幕截图所示

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

如果使用日期字段作为参数“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>


这很有效!它显示上周的数据,但当我尝试更改日期从和日期到时,它不会更新结果我更新了我使用的条件(图像),并且在更改日期时效果良好。我还包括了我在示例中使用的GIXML,您可以将其复制并粘贴到一个新文件(xml文件扩展名)中,然后在GI屏幕上导入Acumatica!它显示上周的数据,但当我尝试更改日期从和日期到时,它不会更新结果我更新了我使用的条件(图像),并且在更改日期时效果良好。我还包括了我在示例中使用的GIXML,您可以将其复制并粘贴到新文件(xml文件扩展名)中,并在GI屏幕上导入Acumatica。