Breaking news from around the world
Get the Bing + MSN extension
Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, PowerApps, Microsoft Flow, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates to Dynamics 365Release overview guides and videos Release Plan | Early Access Availability
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Talent TechTalks | Upcoming TechTalks
Actually , In starting we developed a table which have one string field for putting values example "100 & 200". But some users entered value like" space 100 & space 200". so that's create problem for getting report through Power BI.
So my question is, Their any possibility to change string field to real filed on user interface form level. So user can only enter real value.
If you want them to enter "100" you need to change field type to real or int on the table. If you want to let them enter "100 & 200" then you need to implement validation on the field and check that string formatted as you like.
The best way is to change the table field from string to real or int. Ax will handle all the validations for you. If you can't make changes to the table then override the validate method of that field in the form and only allow proper real numbers.
if the problem is only left-right 'space' override the modified method and use strLtrim and strRtrim to get rid of right and left space.
Thanks ievgen, I appreciate your quick response, Can you please explain little bit more how can I change the field on table because on field properties type is not editable. And in this field used EDT which is also string.
You can't change the primitive data type of an existing field. You need to create a new field with a new type. Then change your application code to use the new field. You need also to create a runnable class that will migrate data from your old field to the new field.
Now you can deploy those changes to test and prod, and run the migration class. In the next deployment you can remove the old field.
Do not simply delete your old field and add a new one with the same name, because this would fail in database sync, preventing you from deploying it to test / prod.
But the correct solution really depends on your full requirement which we don't know. If only numbers should be allowed, use real or int type. If you need to allow alphanumeric characters, use string.
You can also link your string field to another table where all allowed values can be defined. Examples of such pattern in standard system include customer group, item group, zip code etc.
thanks, for you response Nikolaos, I need that field act like a real value this field used for enter quantity value only because sometimes user give space in before enter the the quantity it create problem.
Then add validation to check that only numbers are entered, you can use str2NumOk() function to check that. However, I would recommend to change field type instead.
You can't do calculations based on string fields, so you should definetely use a numeric data type.
If you are changing field type str to real or int then you have to change in Form control, Reports also. Also in code if you are used.
Better create new field and update data in table.
Business Applications communities