AX / D365FO – Remove spaces from Text in Ax (TRIM)

To Remove spaces from Text you can get idea from below code sample. Here we are update name fields which include spaces on right and left side .

 Dirpartytable   Dirpartytable;  
   Name Name;  
   ;  
   while select forUpdate Dirpartytable  
   {  
     ttsBegin;  
     Name= strRTrim(strLTrim(Dirpartytable.Name));  
     Dirpartytable.Name = Name;  
     Dirpartytable.doUpdate();  
     ttsCommit;  
   }  
   info("Done");  

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s