Skip to main content

Hello Community,
I have been trying to add a Contact selector field in the Stock Items (IN202500) but looks like there’s something I am missing here. Can anyone guide me out what else I am missing here?


Code Attribute:
/PXDBInt]
/PXUIField(DisplayName = "Contact", Visibility = PXUIVisibility.SelectorVisible)]
/PXSelector(typeof(Search<CRContact.contactID>),
    new TypeT] { 
        typeof(CRContact.contactID), 
        typeof(CRContact.fullName), 
        typeof(CRContact.email)
    },
    SubstituteKey = typeof(CRContact.contactID),
    DescriptionField = typeof(CRContact.fullName),
    CacheGlobal = true
)]​​​​​​​

hi @Harshita,

Can you try with this.

        ÂPXDBInt()]      
        bPXSelector(typeof(Search<Contact.contactID>), SubstituteKey = typeof(Contact.displayName))].

Please Use PXSelector in the aspx.

 


 


hi @Harshita,

Can you try with this.

         PXDBInt()]      
        bPXSelector(typeof(Search<Contact.contactID>), SubstituteKey = typeof(Contact.displayName))].

Please Use PXSelector in the aspx.

 


 

Hello @praveenpo ,
thank you for your prompt response. I now tried with your lines of code and it has been added successfully, but the field isn’t allowing me to select any line, its like whenever I select any line in the dialog box it doesn’t get displayed on the selector field.

ePXDBInt]
dPXUIField(DisplayName="Contact2", Visibility = PXUIVisibility.SelectorVisible)]     
        rPXSelector(typeof(Search<Contact.contactID>), SubstituteKey = typeof(Contact.displayName), DescriptionField = typeof(Contact.displayName), CacheGlobal = true)]
 

 


 


This should do it

[PXDBInt]
[PXSelector(typeof(Contact.contactID), DescriptionField = typeof(Contact.displayName), CacheGlobal = true, Filterable = true)]
[PXUIField(DisplayName="Contact2")]


This should do it

[PXDBInt]
[PXSelector(typeof(Contact.contactID), DescriptionField = typeof(Contact.displayName), CacheGlobal = true, Filterable = true)]
[PXUIField(DisplayName="Contact2")]

Hello @dcomerford ,
Now it worked, But it doesn’t display all the records that have been created under Contacts (CR302000)
 


 


 


Hello @dcomerford & @praveenpo , How can i put a filter in this to not display the contacts of the Employee type? using project Editor
So its like I would only like to display the records of the type Contact, Sales Person, Business Account & Lead in this selector - Contact field.

 

 


Hi @Harshita ,

Could you please try below code snippet?

ePXDBInt]
/PXSelector(
typeof(Search<Contact.contactID, Where<Contact.contactType, NotEqual<ContactTypesAttribute.employee>>>),
DescriptionField = typeof(Contact.displayName),
CacheGlobal = true,
Filterable = true)]
/PXUIField(DisplayName = "Contact2")]

Hope, it helps!

Regards,

Sweta


@Harshita Was just going to add the very same Search condition by @sweta68 beat me to it


Hi @Harshita ,

Could you please try below code snippet?

ePXDBInt]
/PXSelector(
typeof(Search<Contact.contactID, Where<Contact.contactType, NotEqual<ContactTypesAttribute.employee>>>),
DescriptionField = typeof(Contact.displayName),
CacheGlobal = true,
Filterable = true)]
/PXUIField(DisplayName = "Contact2")]

Hope, it helps!

Regards,

Sweta

Thanks a lot @sweta68 for your prompt response. Its now working as expected.


Hi @Harshita ,

Could you please try below code snippet?

ePXDBInt]
/PXSelector(
typeof(Search<Contact.contactID, Where<Contact.contactType, NotEqual<ContactTypesAttribute.employee>>>),
DescriptionField = typeof(Contact.displayName),
CacheGlobal = true,
Filterable = true)]
/PXUIField(DisplayName = "Contact2")]

Hope, it helps!

Regards,

Sweta

Hello @sweta68 , how about if I just wanted to display the contact type = Contact?


Hi @Harshita ,

Could you please try below code snippet?

ePXDBInt]
/PXSelector(
typeof(Search<Contact.contactID, Where<Contact.contactType, NotEqual<ContactTypesAttribute.employee>>>),
DescriptionField = typeof(Contact.displayName),
CacheGlobal = true,
Filterable = true)]
/PXUIField(DisplayName = "Contact2")]

Hope, it helps!

Regards,

Sweta

Hello @sweta68 , how about if I just wanted to display the contact type = Contact?

Have replaced the logic as Equal<ContactTypesAttribute.Contact>. Now working fine.


Reply