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.
To change the page where the redirect will go you need to change the value of the PXPrimaryGraphAttribute
of that DAC.
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.
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>>>>)
})]
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.
For example like below:
[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>>>>
{
}