web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Form Fields : copy value of One field , covert it and then instert into another field (same table )

(0) ShareShare
ReportReport
Posted on by

Form (Table Fields) Fields  = Mac Address ,   Converted Mac Address

Requirement :  The user Inputs Mac Address e-g( 843A4B000000 , 843A5AFFFFFF )

I want to convert this Mac Address into  base10 Number and then insert the value into

the Converted Mac Address Field....

Please tell me how and where can I write the code??

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    You already asked where to put the code in your previous thread, Form Input : Convert small letters to Capital letters, and I replied to the question. Please the read the response there.

  • yasu Profile Picture
    on at

    ya I read your answer... I meant at times people give code ,,, but they dont specify many things ... thats y I wrote here

    in this case immediately  when the user changes field is also ok .. at the time of saving is also ok...

    by the way will you  not answer this question???

  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    I'm sorry, but I don't see any question nor a problem description in your reply, just "when the user changes field is also ok .. at the time of saving is also ok...".

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    "Where can I write the code??" -> in the modified method of the Mac Address field's FormControl, or FormDataSource Field.

    "tell me how" -> by right clicking on the Methods node of the 2 options above, selecting the method to override, then typing the code on your keyboard.

  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    Well, the best practice is putting the business logic to table, not to a form, to make it reusable and easier to upgrade. And as I explained in them other thread, the right place depends when the logic is required to run. Doing it immediately when a field is modified is one option I mentioned there, but it's not only possibility.

    It would be great if this single discussion wasn't spread to several threads; people either loser information or it must be duplicated. I (or some other moderator) probably should have locked this thread straight away.

  • yasu Profile Picture
    on at

    but you still didnt answer how to copy the field?

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    You either read it from the form control:

    msdn.microsoft.com/.../formstringcontrol.text.aspx

    msdn.microsoft.com/.../formcontrol.valuestr.aspx

    Or from the FormDataSource table.field, depending on how did you implement it. On the form like I gave one solution for you, or in a more generic place like Martin also suggested.

  • yasu Profile Picture
    on at

    I dont know why a simple question is becoming too difficult .....

    Does anyone know the contents of the method to be written??????

  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    I suggest you stop your complains and random short questions and switch to a more systematic approach that gives you better chance to understand how to design a technical solution for your business requirement.

    Start with explaining what business logic you're actually trying to implement.

    If I combine pieces you mentioned in your last four threads, it looks like you want allow users to type in a MAC address, you want to validate it and then storing it in database in a different form. If it's the case, there is no requirement to have two fields and copying between them; there will be just one field in database.

    I didn't answer how to "how to copy the field" because you didn't explain what you mean by that it seems to me that you talk about it just because you don't understand how to design the technical solution correctly. Maybe you have a reason for it, but you can't expect to know it if you don't bother to share it with us.

  • yasu Profile Picture
    on at

    Well sir . First It is the same Form , Same table ...

    If you read carefully , the user will input like this  843A4B000000 ..

    I want to convert it into a Base 10 Number and save it into another field in the form

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans