truncating a field's length in BR

vishuanand
Kilo Contributor

Hi,

I am writing a BR where i want to truncate a field's length(lets say to 100 characters). For eg:

parsedObject.Description = recordObject.short_description;

Here, i want to truncate the length of short_description to 100. could anyone help me how to do this?

6 REPLIES 6

It is confusing as I cannot understand what is parsedObject or recordObject, Can you explain what you are trying to achieve (use case) and if this is a before BR? I would do be adding this line in my BR if I want to truncate the short description to 100 whenever it is updated.



current.short_description = current.short_description.toString().substring(1,100);




Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


preddy
Kilo Guru

Hi Vishwajeeth,



Can you try the below code this very helpful for you.



parsedObject.Description = recordObject.short_description..substr(0,99);



thanks


pavan dodla


Please Hit like, Helpful or Correct depending on the impact of the response