通用搜索 - 重定向到自定义屏幕 [英] Universal Search - Redirect to Custom screen
问题描述
我创建了一个自定义屏幕,它是客户屏幕的副本.问题是,当我们在通用搜索中输入客户 ID 时,我们如何重定向到我们的自定义屏幕而不是客户屏幕.请查看我们自定义屏幕的图形代码.
I have created a custom screen which is a duplicate of the Customer screen. The question is, when we enter customer id in universal search, how we can redirect to our custom screen instead of the Customer screen. Please have a look at the graph code of our custom screen.
public class CustomScreen : BusinessAccountGraphBase<Customer, Customer, Where<BAccount.type, Equal<BAccountType.customerType>,
Or<BAccount.type, Equal<BAccountType.combinedType>>>>
{
}
推荐答案
搜索框使用记录的 Note ID 字段的值作为关键字在 SearchIndex
中查找记录,其中EntityType
是为记录存储的.它从 EntityType
读取 PXPrimaryGraphAttribute
的值并重定向到指定的图形.
The Search box is using the value of the Note ID field of the records as the key for finding the record in the SearchIndex
where the EntityType
is stored for the record.
From the EntityType
it is reading the value of the PXPrimaryGraphAttribute
and doing the redirect to the specified graph.
要更改重定向的页面,您需要更改该 DAC 的 PXPrimaryGraphAttribute
的值.
To change the page where the redirect will go you need to change the value of the PXPrimaryGraphAttribute
of that DAC.
您可以尝试将 PXPrimaryGraphAttribute
添加到您的图表中,以表明它是指定 DAC 的主要图表.根据文档,它应该覆盖由应用于 Customer
DAC 的 PXPrimaryGraphAttribute
设置的主图.
You can try adding the PXPrimaryGraphAttribute
to your graph to indicate that it is the primary graph for the specified DAC. Per documentation, it is supposed to override the primary graph set by the PXPrimaryGraphAttribute
applied to the Customer
DAC.
对于 Customer
DAC,应用的属性如下:
In case of Customer
DAC the applied attribute is the following:
[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 分配给 BusinessAccountMaint
或 CustomerMaint
,您需要根据需要相应地更改条件和图表.
As you can see depending on the specified conditions the DAC can be assigned to either BusinessAccountMaint
or CustomerMaint
and you need to change the conditions and graphs correspondingly to what you need.
例如如下:
[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>>>>
{
}
这篇关于通用搜索 - 重定向到自定义屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!