Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Set default value of a checkbox

Posted on by Microsoft Employee

Hello there,

In the PurchReqLine details, there is a checkbox for 'Accept partial delivery'. By default this is set to false. How would I modify it to true by default.

I tried setting the value to 1 in AOT but it didn't work.

I also tried inserting a line in the run() method of the main form (PurchReqTable form) methods as: LineComplete.checked(true);

That didn't work either.

Any help is appreciated.

thank you.

 

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Set default value of a checkbox

    I have figured out my issue. It's now working fine.

    I added the line below to the datasource table's initvalue method.

    this.LineComplete= true

    thank you

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Set default value of a checkbox

    Hi Gertjan,

    I have tried editing the initValue method of the purchreqline table and even the run method of the purchrqetable form. to no avail.

    This request has been resent from Purchasing team. is there anything I'm missing?

  • Verified answer
    gpvdlinden Profile Picture
    gpvdlinden 1,200 on at
    RE: Set default value of a checkbox

    You should add the initialization in the initValue method of the purchreqline table or on the initvalue of the datasource in the form or dataset. In this method you can define the default value. You will need a (small) modification for this.

    If the value is not preserved when saving the record (insert or update) it means that after the initialization of the line somewhere in code the value is changed. But please first testwith the initValue methods mentioned.

    Can you verify if this worked for you?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans