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 :
Customer experience | Sales, Customer Insights,...
Answered

ON CLICK Approve and submit button in HTML

(0) ShareShare
ReportReport
Posted on by 5,514

ON click an action should be performed in html dashboard

I have the same question (0)
  • sandeepc Profile Picture
    5,514 on at

    Submit : Records will be saved in “Activity Monitoring Entity”. Status will be draft. Check if record for combination(Semester & Module) is already there in that case edit record else create.

    Approve: This will be shown to the Dean User Only. On approval records in activity monitoring will be published.

  • sandeepc Profile Picture
    5,514 on at

    s17.PNG any suggestions will be amrkd as verified

    its an html dashboard

  • sandeepc Profile Picture
    5,514 on at

    s23.PNG

  • sandeepc Profile Picture
    5,514 on at

    s22.PNG

  • Verified answer
    cloflyMao Profile Picture
    25,210 on at

    Hi Sandee,

    From your description and as per my understanding,

    it seems that you would like to merge data from two entities into another entity ?

    If so, I have other 2 questions to confrim:

    1. Could you share a screenshot with your column header title ?

    From your posted image, I didn't know which columns could represent your Semester and Module entity.

    2. There is no checkbox for each row of your table, so for your crm users, 

    how would you like to make them select rows ? only one item could be selected in each submission or multiple selects is allowed ?

    Regards,

    Clofly

  • sandeepc Profile Picture
    5,514 on at

    1. Could you share a screenshot with your column header title ?

    From your posted image, I didn't know which columns could represent your Semester and Module entity.

    Ans:  Semester Entity = Semester Entity

            Module Entity =Subject steup entity

  • sandeepc Profile Picture
    5,514 on at

    activity monitoring= new_activity monitoring

    name= new_name(activity  monitoring)

    s24.PNG

    above records will be saved in activity monitoring entity. when record for combination(Semester & Module) is already there in that case we will edit record else we will create.status will be draft

    finaly on approval from dean .these records in activity monitoring will be published

  • sandeepc Profile Picture
    5,514 on at

    i will select records single select only.i will

    i will edit record in activity monitoring form only.

  • sandeepc Profile Picture
    5,514 on at

    s25.PNG

    i added semester and subject setup coulmns to query . as of now here is no data for subject setup there is only for semester

  • Verified answer
    cloflyMao Profile Picture
    25,210 on at

    Hi Sandee,

    Please insert code below after your original script code:

    var semesterName = '';
    var moduleName = '';
     
    $(document).on("click", "tr", function() {
      // select row in semesterTable
      if ($(this).parent().parent().parent().attr('id') == 'semesterTable') {
        // make sure that column header not be selected
        if ($(this).find('td:nth-child(1)').text() != 'Semester') {
          $(this).addClass('success').siblings().removeClass('success');
          semesterName = $(this).find('td:nth-child(1)').text();
        }
      }
      // select row in modalTable
      if ($(this).parent().parent().parent().attr('id') == 'modalTable') {
        // make sure that column header not be selected
        if ($(this).find('td:nth-child(1)').text() != 'Module') {
          $(this).addClass('success').siblings().removeClass('success');
          moduleName = $(this).find('td:nth-child(1)').text();
        }
      }
    });
    
    $("#newInstalment").on("click", function() {
      if (semesterName != '' && moduleName != '') {
        addRecord(semesterName, moduleName);
      } else {
        Xrm.Utility.alertDialog("Both two tables rows should be selected or You don't select any row.");
      }
    });
    
    // name 1 is Semester
    // name 2 is Module
    function addRecord(name1, name2) {
      var data = {
        "new_name": name1   ''   name2
      }
      var req = new XMLHttpRequest();
      req.open("POST", Xrm.Page.context.getClientUrl()   "/api/data/v9.0/new_activity_monitorings", true);
      req.setRequestHeader("OData-MaxVersion", "4.0");
      req.setRequestHeader("OData-Version", "4.0");
      req.setRequestHeader("Accept", "application/json");
      req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
      req.onreadystatechange = function() {
        if (this.readyState === 4) {
          req.onreadystatechange = null;
          if (this.status === 200 || this.status === 204) {
            Xrm.Utility.alertDialog("An Activity Morning record has been added");
          } else {
            var error = JSON.parse(this.response).error;
            Xrm.Utility.alertDialog("Error in Action: "   error.message);
          }
        }
      };
      req.send(JSON.stringify(data));
    }

    I've added comments for each snippet works for, read them carefully.

    Regards,

    Clofly

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 74 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 31 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans