Solved

Need to add Contact selector field in the stock Items screen that should display the values for ContactID

  • 17 October 2023
  • 10 replies
  • 158 views

Userlevel 6
Badge +3

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 Type[] { 
        typeof(CRContact.contactID), 
        typeof(CRContact.fullName), 
        typeof(CRContact.email)
    },
    SubstituteKey = typeof(CRContact.contactID),
    DescriptionField = typeof(CRContact.fullName),
    CacheGlobal = true
)]​​​​​​​

icon

Best answer by Harshita 20 October 2023, 16:48

View original

10 replies

Userlevel 6
Badge +3

Hi @Harshita ,

Could you please try below code snippet?

[PXDBInt]
[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.

Userlevel 6
Badge +3

Hi @Harshita ,

Could you please try below code snippet?

[PXDBInt]
[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?

Userlevel 6
Badge +3

Hi @Harshita ,

Could you please try below code snippet?

[PXDBInt]
[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.

Userlevel 7
Badge +12

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

Userlevel 7
Badge +10

Hi @Harshita ,

Could you please try below code snippet?

[PXDBInt]
[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

Userlevel 6
Badge +3

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.

 

 

Userlevel 6
Badge +3

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)
 


 


 

Userlevel 7
Badge +12

This should do it

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

Userlevel 6
Badge +3

hi @Harshita,

Can you try with this.

        [PXDBInt()]      
        [PXSelector(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.

[PXDBInt]
[PXUIField(DisplayName="Contact2", Visibility = PXUIVisibility.SelectorVisible)]     
        [PXSelector(typeof(Search<Contact.contactID>), SubstituteKey = typeof(Contact.displayName), DescriptionField = typeof(Contact.displayName), CacheGlobal = true)]
 

 


 

Userlevel 6
Badge +3

hi @Harshita,

Can you try with this.

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

Please Use PXSelector in the aspx.

 


 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved