通用搜索 - 重定向到自定义屏幕

问题描述 投票:2回答:1

我已经创建了一个自定义界面,它是客户界面的重复。问题是,当我们在通用搜索中输入客户ID时,如何重定向到我们的自定义界面而不是客户界面。请看一下我们的自定义界面的图表代码。

public class CustomScreen : BusinessAccountGraphBase<Customer, Customer, Where<BAccount.type, Equal<BAccountType.customerType>,
                Or<BAccount.type, Equal<BAccountType.combinedType>>>>
    {
    } 
acumatica
1个回答
1
投票

搜索框是以记录的备注ID字段的值作为查找记录的键,在 SearchIndex 其中 EntityType 是为记录存储的。EntityType 它正在读取 PXPrimaryGraphAttribute 并做重定向到指定的图形。

要改变重定向到的页面,你需要更改 PXPrimaryGraphAttribute 的DAC。

你可以尝试在该DAC中加入 PXPrimaryGraphAttribute 来表示它是指定DAC的主要图形。根据文档,它应该覆盖由 "DAC "设置的主图形。PXPrimaryGraphAttribute 适用于 Customer DAC。

如果是 Customer DAC的应用属性如下。

[CRCacheIndependentPrimaryGraphList(new Type[]
{
    typeof(BusinessAccountMaint),
    typeof(CustomerMaint),
    typeof(CustomerMaint),
    typeof(CustomerMaint),
    typeof(BusinessAccountMaint)
}, new Type[]
{
    typeof(Select<BAccount, Where<BAccount.bAccountID, Equal<Current<BAccount.bAccountID>>, And<Current<BAccount.viewInCrm>, Equal<True>>>>),
    typeof(Select<Customer, Where<Customer.bAccountID, Equal<Current<BAccount.bAccountID>>, Or<Customer.bAccountID, Equal<Current<BAccountR.bAccountID>>>>>),
    typeof(Select<Customer, Where<Customer.acctCD, Equal<Current<BAccount.acctCD>>, Or<Customer.acctCD, Equal<Current<BAccountR.acctCD>>>>>),
    typeof(Where<BAccountR.bAccountID, Less<Zero>, And<BAccountR.type, Equal<BAccountType.customerType>>>),
    typeof(Select<BAccount, Where<BAccount.bAccountID, Equal<Current<BAccount.bAccountID>>, Or<Current<BAccount.bAccountID>, Less<Zero>>>>)
})]

正如你所看到的,根据指定的条件,DAC可以被分配给以下两种情况 BusinessAccountMaintCustomerMaint 而你需要根据自己的需要改变相应的条件和图形。

比如像下面这样。

[CRCacheIndependentPrimaryGraphList(new Type[]
{
    typeof(BusinessAccountMaint),
    typeof(CustomScreen),
    typeof(CustomScreen),
    typeof(CustomScreen),
    typeof(BusinessAccountMaint)
}, new Type[]
{
    typeof(Select<BAccount, Where<BAccount.bAccountID, Equal<Current<BAccount.bAccountID>>, And<Current<BAccount.viewInCrm>, Equal<True>>>>),
    typeof(Select<Customer, Where<Customer.bAccountID, Equal<Current<BAccount.bAccountID>>, Or<Customer.bAccountID, Equal<Current<BAccountR.bAccountID>>>>>),
    typeof(Select<Customer, Where<Customer.acctCD, Equal<Current<BAccount.acctCD>>, Or<Customer.acctCD, Equal<Current<BAccountR.acctCD>>>>>),
    typeof(Where<BAccountR.bAccountID, Less<Zero>, And<BAccountR.type, Equal<BAccountType.customerType>>>),
    typeof(Select<BAccount, Where<BAccount.bAccountID, Equal<Current<BAccount.bAccountID>>, Or<Current<BAccount.bAccountID>, Less<Zero>>>>)
})]
public class CustomScreen : BusinessAccountGraphBase<Customer, Customer, Where<BAccount.type, Equal<BAccountType.customerType>,
            Or<BAccount.type, Equal<BAccountType.combinedType>>>>
{
} 
© www.soinside.com 2019 - 2024. All rights reserved.