Skip to main content
Solved

@me expression does not work for some Generic inquiries(Shows a validation error) in conditions


Forum|alt.badge.img+1

I have created a GI to get data records from custom table. I want to filter the records by UserID. 

So that I added a condition as follows. 

But using @me as Value1 shows a validation error as follows.

 

 

Why i’m getting this error. I have used @me as UserId in another GI and it works well & did not show any validation error.

Any Idea on this?

 

Thanks.

Best answer by Naveen Boga

@charithalakshan49   Here is the issue with DAC field (User ID). 

Please change it from String to PXGUID() in DAC  and

nvarchar() to uniqueidentifier in the database

 

Then it is working fine.

 

DAC field

  #region Userid
    [PXDBGuid()]
    [PXUIField(DisplayName = "Userid")]
    public virtual Guid? Userid { get; set; }
    public abstract class userid : PX.Data.BQL.BqlGuid.Field<userid> { }
    #endregion

 

 

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

13 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3381 replies
  • November 24, 2022

Hi, @charithalakshan49  You can provide the value as @me and run the GI. The system will not validate it as it is a dynamic variable.

You can click on the VIEW INQUIRY and check that are you getting the proper results or not.


Forum|alt.badge.img+1

@Naveen Boga Thanks for the response. But I could not see the expected results when I am running the GI. It does not show any resulting records.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3381 replies
  • November 24, 2022

Hi @charithalakshan49  Can you please share the XML format of the GI here? 


Forum|alt.badge.img+1

@Naveen Boga Yes, here it is


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3381 replies
  • November 25, 2022

@charithalakshan49  It seems that you are using the custom table, can you also share the EmployeeDetails DAC file as well.

Or 

You can share the customization package, if possible. 


Forum|alt.badge.img+1

Hi @Naveen Boga , here is the DAC and db script

 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3381 replies
  • November 25, 2022

@charithalakshan49  I have checked the DAC and table script and it is bit different and I’m not what is the data storing in the User ID field.

I have checked for the Default Acumtatica SOOrder with @me and it is working with the OwnerID field. You can refer Owner ID field and verify.

 

For SOOrder → OwnerID field with @me is working fine.

 

 


Forum|alt.badge.img+1

@Naveen Boga Yes, it works fine for deafult acumatica tables. But not for my custom table. I’m storing 

Base.Accessinfo.UserID as UserID column of my custom table.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3381 replies
  • November 25, 2022

Yes, for User ID field @me will not work I guess. Please check the OwnerID field from SOOrder table and check


Forum|alt.badge.img+1

@Naveen Boga Yes It works for SOOrder.OwnerID and also it works for Contact.UserID.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3381 replies
  • Answer
  • November 25, 2022

@charithalakshan49   Here is the issue with DAC field (User ID). 

Please change it from String to PXGUID() in DAC  and

nvarchar() to uniqueidentifier in the database

 

Then it is working fine.

 

DAC field

  #region Userid
    [PXDBGuid()]
    [PXUIField(DisplayName = "Userid")]
    public virtual Guid? Userid { get; set; }
    public abstract class userid : PX.Data.BQL.BqlGuid.Field<userid> { }
    #endregion

 

 


Forum|alt.badge.img+1

@Naveen Boga Thanks I will check and will update here. Could you please tell me what is the data type I should use in mysql (Not in microsoft sql server)?


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3381 replies
  • November 28, 2022

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