Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

ON CLICK Approve and submit button in HTML

(0) ShareShare
ReportReport
Posted on by 5,449

ON click an action should be performed in html dashboard

  • sandeepc Profile Picture
    5,449 on at
    RE: ON CLICK Approve and submit button in HTML

    if i give current user name its publishing

  • sandeepc Profile Picture
    5,449 on at
    RE: ON CLICK Approve and submit button in HTML

    ok

  • Verified answer
    cloflyMao Profile Picture
    25,208 on at
    RE: ON CLICK Approve and submit button in HTML

    Hi Sandee,

    1. Make sure your approval button's id attribute value equals "approval", only if a element with id "approval" exists then approval function will be executed.

    2. Try to change currentUserName == "Dean" to your own current user name to test updateRecord function if previous steps went well.

    Regards,

    Clofly

  • sandeepc Profile Picture
    5,449 on at
    RE: ON CLICK Approve and submit button in HTML

    code

  • Verified answer
    cloflyMao Profile Picture
    25,208 on at
    RE: ON CLICK Approve and submit button in HTML

    Hi,

    make sure you have submited a new record before execute update function,

    alert newRecordId inside approval button function

    $('#approval').on('click', function() {

    alert(newRecordId);

    var currentUserId = window.parent.Xrm.Page.context.getUserId().replace('{', '').replace('}', '');

    var currentUserName = window.parent.Xrm.Page.context.getUserName();

    only when newRecordId is available then you can jump into updateRecord function.

    Regards,

  • sandeepc Profile Picture
    5,449 on at
    RE: ON CLICK Approve and submit button in HTML

    code

  • sandeepc Profile Picture
    5,449 on at
    RE: ON CLICK Approve and submit button in HTML

    ,

  • sandeepc Profile Picture
    5,449 on at
    RE: ON CLICK Approve and submit button in HTML

    code

  • Verified answer
    cloflyMao Profile Picture
    25,208 on at
    RE: ON CLICK Approve and submit button in HTML

    Hi,

    Remove the original and change to my latest addRecord function.

    Regards,

    Clofly

  • sandeepc Profile Picture
    5,449 on at
    RE: ON CLICK Approve and submit button in HTML

    code

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 78 Super User 2025 Season 1

#3
Sahra Profile Picture

Sahra 43

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans