Skip to main content
Solved

Lookup does not show any columns


Forum|alt.badge.img+1

Hi,

I have created a lookup to display SOAddresses. However I could not see any columns in the lookup and the only column there in the column configuration is AddressId(when I select it, it also gives an error). 

Any idea about this? Below are the related screenshots.

 

 

Thanks

 

Best answer by darylbowman

Works for me:

 

 

You could try deleting the custom form field and re-making it?

View original
Did this topic help you find an answer to your question?

darylbowman
Captain II
Forum|alt.badge.img+13

Could you post the selector code?


Forum|alt.badge.img+1

@darylbowman 

    #region UsrAddresses
    [PXDBString(300)]
    [PXSelector(typeof(Search<SOAddress.addressID>))]
    [PXUIField(DisplayName="Addresses")]

    public virtual string UsrAddresses { get; set; }
    public abstract class usrAddresses : PX.Data.BQL.BqlString.Field<usrAddresses> { }
    #endregion


darylbowman
Captain II
Forum|alt.badge.img+13

There’s a number of things wrong with how you’re defining it.

Firstly, you’re storing the address as a string instead of the int? addressID. I wouldn’t recommend this.

Secondly, there aren’t any other columns because you haven’t defined any other columns.

 

I would change custom field to an int? (nullable int) in both your code and the database. Then use this, or something like it:

        #region UsrAddresses
        [PXDBInt]
        [PXSelector(typeof(Search<SOAddress.addressID>),
                    typeof(SOAddress.addressLine1),
                    typeof(SOAddress.addressLine2),
                    typeof(SOAddress.city),
                    typeof(SOAddress.state),
                    typeof(SOAddress.postalCode),
                    DescriptionField = typeof(SOAddress.addressLine1))]
        [PXUIField(DisplayName = "Addresses")]

        public virtual int? UsrAddresses { get; set; }
        public abstract class usrAddresses : PX.Data.BQL.BqlInt.Field<usrAddresses> { }
        #endregion

You can read more about options for defining selectors here.


deybanperez83
Jr Varsity III

Hi @charithalakshan49 ,

I agree @darylbowman, and you should store the addressID as an Int type at DB.

In addition, I want to highlight that you should define which are the columns being displayed in the selector.

 
Regards,


darylbowman
Captain II
Forum|alt.badge.img+13
deybanperez83 wrote:

In addition, I want to highlight that you should define which are the columns being displayed in the selector.

 

I’m not sure where you got that, but according to the Acumatica wiki article, which I linked, that isn’t necessary.


Forum|alt.badge.img+1

@darylbowman @deybanperez83  Thanks for the responses.

@darylbowman I tried your code, but the same results as follows. AddressLine1 is the only column there. 

 

In Column configuration, I can add AddressId Column but it gives this error.

 


darylbowman
Captain II
Forum|alt.badge.img+13

Could you post your code again? It seems like something still doesn’t match because it mentions a string.


Forum|alt.badge.img+1

@darylbowman       

 #region UsrAddresses
        [PXDBInt]
        [PXSelector(typeof(Search<SOAddress.addressID>),
                    typeof(SOAddress.addressLine1),
                    typeof(SOAddress.addressLine2),
                    typeof(SOAddress.city),
                    typeof(SOAddress.state),
                    typeof(SOAddress.postalCode),
                    DescriptionField = typeof(SOAddress.addressLine1))]
        [PXUIField(DisplayName="Addresses")]
        public virtual int? UsrAddresses { get; set; }
        public abstract class usrAddresses : PX.Data.BQL.BqlInt.Field<usrAddresses> { }
        #endregion

____________________________________________________________________

And I want to mention that if I use a table like InventoryItem, this problem does not occur anymore. if I code like below, all the columns of inventoryItem table shows in my lookup.

        [PXDBInt]
        [PXSelector(typeof(Search<InventoryItem.inventoryID>))]
        [PXUIField(DisplayName="Addresses")]
        public virtual int? UsrAddresses { get; set; }
        public abstract class usrAddresses : PX.Data.BQL.BqlInt.Field<usrAddresses> { }


darylbowman
Captain II
Forum|alt.badge.img+13

Works for me:

 

 

You could try deleting the custom form field and re-making it?


Forum|alt.badge.img+1

@darylbowman  I tried recreating it, but I got the same result. It seems to be a problem in my Acumatica Instance. Could you please tell me what is the acumatica version that you are using? 


darylbowman
Captain II
Forum|alt.badge.img+13

I am using 22R1, but I wouldn’t expect that to be a problem.

 

Before you give up hope, confirm / try the following:

  • Make sure the database field was changed from nvarchar or whatever it was to int
  • Unpublish the customization packages
  • Republish the customization packages
  • Make sure you tried deleting the selector element from the UI and adding it again after the new code was published

darylbowman
Captain II
Forum|alt.badge.img+13

If none of that works, you can try publishing the package I uploaded here.


Forum|alt.badge.img+1

@darylbowman Thanks for helping me. I’ll tryout the things that you said. 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings