Solved

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

  • 24 November 2022
  • 13 replies
  • 103 views

Userlevel 4
Badge +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.

icon

Best answer by Naveen Boga 25 November 2022, 10:53

View original

13 replies

Userlevel 7
Badge +17

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.

Userlevel 4
Badge +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.

Userlevel 7
Badge +17

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

Userlevel 4
Badge +1

@Naveen Boga Yes, here it is

Userlevel 7
Badge +17

@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. 

Userlevel 4
Badge +1

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

 

Userlevel 7
Badge +17

@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.

 

 

Userlevel 4
Badge +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.

Userlevel 7
Badge +17

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

Userlevel 4
Badge +1

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

Userlevel 7
Badge +17

@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

 

 

Userlevel 4
Badge +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)?

Userlevel 7
Badge +17

@charithalakshan49  You can use UUID() type in the MySQL 

Link: https://www.aspsnippets.com/questions/185273/Solved-How-to-use-UniqueIdentifier-data-type-in-MySql-database/

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