New BC v26 To Text() feature

In the new BC release version (v26), MS has added the ToText method to simple types (BigInteger, Boolean, Byte, Date, DateTime, Decimal, Duration, Guid, Integer, Label, Time, Version) for easy conversion to text. In the past we have to use format() to convert to text. 

https://learn.microsoft.com/en-us/dynamics365/release-plan/2025wave1/smb/dynamics365-business-central/convert-simple-type-values-text-using-new-totext-method?wt.mc_id=DX-MVP-5004336

Example: Below code will throw and error on Message() that you cannot convert DateTime to Text

In the old version, we would use Message(Format(DT))


In the new version, we can use ToText() 



Note: MS stated that this will work on label, however there is no such method and also you don't need to convert label type to text.



This little update make life a little easier. Try this method next time when you are on BC v26 :)



Comments

Popular Posts