2017-01-06 7 views
0

LeadExtensionを変更してオーナーIDを追加し、電子メールアドレスのユニバーサル検索時に営業担当者が自分のリードを知っているようにしました。しかし、私は数字だけでなく説明であることを報告するためにそれを得ることができました。実際の従業員の名前の代わりにID番号を表示するにはユニバーサル検索でOwnerIDから所有者の説明を取り出す方法

//modify leads search to report ownerid 
    public class LeadExtension : PXCacheExtension<Contact> 
    { 
     [PXRemoveBaseAttribute(typeof(PXSearchableAttribute))] 
     [PXMergeAttributes(Method = MergeMethod.Append)] 
     [PXSearchable(SearchCategory.CR, "{0} {1}", new Type[] { typeof(Contact.contactType), typeof(Contact.displayName) }, 
        new Type[] { typeof(Contact.eMail), typeof(Contact.phone1), typeof(Contact.phone2), typeof(Contact.phone3), typeof(Contact.webSite) }, 
        WhereConstraint = typeof(Where<Current<Contact.contactType>, NotEqual<ContactTypesAttribute.bAccountProperty>, And<Current<Contact.contactType>, NotEqual<ContactTypesAttribute.employee>>>), 
        Line1Format = "{0}{1}{2}{3}", Line1Fields = new Type[] { typeof(Contact.salutation), typeof(Contact.phone1), typeof(Contact.eMail), typeof(Contact.ownerID) }, 
        Line2Format = "{1}{2}{3}", Line2Fields = new Type[] { typeof(Contact.defAddressID), typeof(Address.displayName), typeof(Address.city), typeof(Address.state), typeof(Address.countryID) } 
        )] 
     public Guid? NoteID { get; set; } 
    } 

答えて

1

あなたは、:実際の従業員の名前の代わりに、typeof演算(Contact.ownerID)を使用したID番号を報告するために、以下を変更する簡単な方法はありますTM.PXOwnerSelectorAttribute.EPEmployee.acctNameフィールドも含める必要があります。関連付けられた従業員はOwnerIDフィールドだけでアクセス可能であるため、Contact.ownerIDもTM.PXOwnerSelectorAttribute.EPEmployee.acctNameフィールドの前にLine1Fields配列に存在する必要があります。また、Line1Formatプロパティを{0}{1}{2}{4}に変更することを忘れないでください。そうしないと、ID番号が表示されます。以下は

はあなたの参照のための最終延長コードです:

public class LeadExtension : PXCacheExtension<Contact> 
{ 
    [PXRemoveBaseAttribute(typeof(PXSearchableAttribute))] 
    [PXMergeAttributes(Method = MergeMethod.Append)] 
    [PXSearchable(SearchCategory.CR, "{0} {1}", new Type[] { typeof(Contact.contactType), typeof(Contact.displayName) }, 
     new Type[] { typeof(Contact.eMail), typeof(Contact.phone1), typeof(Contact.phone2), typeof(Contact.phone3), typeof(Contact.webSite) }, 
     WhereConstraint = typeof(Where<Current<Contact.contactType>, NotEqual<ContactTypesAttribute.bAccountProperty>, And<Current<Contact.contactType>, NotEqual<ContactTypesAttribute.employee>>>), 
     Line1Format = "{0}{1}{2}{4}", 
     Line1Fields = new Type[] { typeof(Contact.salutation), typeof(Contact.phone1), typeof(Contact.eMail), 
            typeof(Contact.ownerID), typeof(TM.PXOwnerSelectorAttribute.EPEmployee.acctName) }, 
     Line2Format = "{1}{2}{3}", 
     Line2Fields = new Type[] { typeof(Contact.defAddressID), typeof(Address.displayName), typeof(Address.city), typeof(Address.state), typeof(Address.countryID) } 
    )] 
    public Guid? NoteID { get; set; } 
} 
+0

は大きな感謝を作品! – AcumaticaGuy

関連する問題