Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Form Methods and controls

(0) ShareShare
ReportReport
Posted on by 64

pastedimage1684236202119v1.png

i have a button called calculateemi , if i select a record and click on calculate emi it should calculate emi and insert them in another table. if records already exist for the loan either it should show msg as exist or button should be disabled. How can i achieve it ?

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: Form Methods and controls

    You can access FormDatasource directly in clicked method by its name.I believe it's a custom form.

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Form Methods and controls

    You can use DataSourceName.FieldName to get the current selected record.

    If the multiple records are selected, you need to make use of multiselecthelper class.

    You need to add the code on clicked method.

    https://community.dynamics.com/ax/b/mafsarkhan/posts/get-select-records-by-multiselectionhelper-class

    Thanks,

    Girish S.

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,554 Super User 2024 Season 1 on at
    RE: Form Methods and controls

    Hi, In clicked method of calculateEMI button, write code to calculate and insert record im another table.

    Change AutoDeclaration property of calculateEMI button to yes. In active method of form datasource, write select statement to find related record in another table and enable calculateEMI button if found else disabled

    Check this article

    https://wp.me/p9INDW-w

  • gaya3 killy Profile Picture
    gaya3 killy 64 on at
    RE: Form Methods and controls

    Hi,

    I already wrote code for disabling the button. But i need emi records to be inserted which are equal to tenure when i click on calculate emi. only selected record emi's should be inserted . how can i pass active record details to clicked method of button control and i need to loop through it.

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Form Methods and controls

    Hi,

    You need to add the validation on the active method of the form DataSource. Add the select statement to check whether the record exist for the loan. If record exists, make the button as enabled equal to false otherwise true.

    Thanks,

    Girish S.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans