Skip to main content
Answer

create a substring from string in acumatica report

  • April 20, 2023
  • 3 replies
  • 889 views

Forum|alt.badge.img

Hi,

I need to trim a part from the string in my report field.

This is my report I need to show ST2-MATERIAL HANDLING   -GST value as MATERIAL HANDLING

and ST2-AGRICULTURE PNEUMATI   -GRN as AGRICULTURE PNEUMATI

 

How can i do from the report designer in acumatica

Best answer by hkabiri

@jeewanishalika20 Check if you can use Substring( str, start, length ) function to achieve this. Since the String can be different in different documents, then you have to find the first occurrence of dash (-) InStr( str, findStr ) and also last one InStrRev( str, findStr ) so get what in between the two using the substring.

https://help.acumatica.com/(W(3))/Help?ScreenId=ShowWiki&pageid=00a69dbb-c06b-4ce4-8b29-e86ee0e8ed47

3 replies

hkabiri
Acumatica Moderator
Forum|alt.badge.img+8
  • Acumatica Support Team
  • Answer
  • April 20, 2023

@jeewanishalika20 Check if you can use Substring( str, start, length ) function to achieve this. Since the String can be different in different documents, then you have to find the first occurrence of dash (-) InStr( str, findStr ) and also last one InStrRev( str, findStr ) so get what in between the two using the substring.

https://help.acumatica.com/(W(3))/Help?ScreenId=ShowWiki&pageid=00a69dbb-c06b-4ce4-8b29-e86ee0e8ed47


Forum|alt.badge.img

Hi @hkabiri ,

I try it.

ST2-MATERIAL HANDLING-GST

I used InStr( ‘ST2-MATERIAL HANDLING-GST’, ‘-’ ) to find the dash index and it return 3.

But when I used the database column for ST2-MATERIAL HANDLING-GST it return -1.

InStr( ‘[INItemClass.ItemClassCD], ‘-’ ) when I use it it return -1.But the column value is ST2-MATERIAL HANDLING-GST .

Do you have any idea about that.

 


Forum|alt.badge.img
  • Freshman II
  • October 25, 2023

Hi @hkabiri ,

I try it.

ST2-MATERIAL HANDLING-GST

I used InStr( ‘ST2-MATERIAL HANDLING-GST’, ‘-’ ) to find the dash index and it return 3.

But when I used the database column for ST2-MATERIAL HANDLING-GST it return -1.

InStr( ‘[INItemClass.ItemClassCD], ‘-’ ) when I use it it return -1.But the column value is ST2-MATERIAL HANDLING-GST .

Do you have any idea about that.

 

Hi @jeewanishalika20 , did u manage to find the solution? because iam having same issue right now. if you can share it would be great