You need to sign in to do that
Don't have an account?
Rahul H 4
Hi Everyone, Can you please help me in writing a trigger to truncate the characters on a field
We are loading the Case from the website. There is an issue with Images field in Case entity as displayed below:
Text in Images Field in Case entity : ["https:\/\/www.intops.com.au\/wp-content\/uploads\/gravity_forms\/2-cb870933d1056667864f32a0efe9bcff\/2018\/08\/MDC3521112.JPG";]
So, everytime we have to remove the junk characters and set it as below and check the images.
Need update: https:\\www.intops.com.au/wp-content/uploads/gravity_forms/2-cb870933d1056667864f32a0efe9bcff/2018/08/MDC3521112.JPG
Can you please help to write a trigger to truncate the junk characters. Thanks a lot
Text in Images Field in Case entity : ["https:\/\/www.intops.com.au\/wp-content\/uploads\/gravity_forms\/2-cb870933d1056667864f32a0efe9bcff\/2018\/08\/MDC3521112.JPG";]
So, everytime we have to remove the junk characters and set it as below and check the images.
Need update: https:\\www.intops.com.au/wp-content/uploads/gravity_forms/2-cb870933d1056667864f32a0efe9bcff/2018/08/MDC3521112.JPG
Can you please help to write a trigger to truncate the junk characters. Thanks a lot
The only challenge in the above problem was to use escape sequence for the backslash('\') character and to write a special case for the 'https:\\' as that is the only string where '\/' has to be replaced with a backslah whereas everyehere else it has to be replaced with forward slash.
The below code works according to your use case:
Replace the description field with your text field.
Input:
Output:
Hope this helps,
Sandeep
All Answers
The only challenge in the above problem was to use escape sequence for the backslash('\') character and to write a special case for the 'https:\\' as that is the only string where '\/' has to be replaced with a backslah whereas everyehere else it has to be replaced with forward slash.
The below code works according to your use case:
Replace the description field with your text field.
Input:
Output:
Hope this helps,
Sandeep
Thanks,
Sandeep