Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

ON CLICK Approve and submit button in HTML

Posted on by 5,005

ON click an action should be performed in html dashboard

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

    if i give current user name its publishing

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

    ok

  • Verified answer
    cloflyMao Profile Picture
    cloflyMao 25,198 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
    sandeepc 5,005 on at
    RE: ON CLICK Approve and submit button in HTML

    code

  • Verified answer
    cloflyMao Profile Picture
    cloflyMao 25,198 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
    sandeepc 5,005 on at
    RE: ON CLICK Approve and submit button in HTML

    code

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

    ,

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

    code

  • Verified answer
    cloflyMao Profile Picture
    cloflyMao 25,198 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
    sandeepc 5,005 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

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,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans