Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

.

(0) ShareShare
ReportReport
Posted on by 5,100

hi, all

how to send the values showing under marker 1 and marker 2 .  to the obtained marks and maximum marks?

actualy the values should come under obtained marks and max marks while changing code it update like belwo

*This post is locked for comments

  • Suggested answer
    ajyendra Profile Picture
    ajyendra 1,732 on at
    RE: html dashboard- values showing wrongly

    Hi

    html += "<tr><td class='nme' id='" + uploadMarks.value[i].new_studentsubjectmarksid + "'>" + enrollNo + "</td><td>" + studentName + "</td><td contenteditable='true'><input type='number' placeholder='marker1' id='marker1" + i + "' onchange='getobtainedMarks(this,"+i+");'/></td><td contenteditable='true'><input type='number' placeholder='marker2' id='marker2" + i + "' onchange='getobtainedMarks(this,"+i+");'/></td><td contenteditable='true'><input type='number' placeholder='marker3' id='marker3" + i + "' onchange='getobtainedMarks(this,"+i+");'/></td><td class='minatt'><p id='demo" + i + "'></p><input onchange='checkObtainedMarks(this)' style='width:100%' type='number' id='" + uploadMarks.value[i].new_studentsubjectmarksid + "_minattendance' name='name'" + " value='" + marksobtained + "' data='" +uploadMarks.value[i].new_maximummarks1 + "' min='0' max='" + uploadMarks.value[i].new_maximummarks1 + "' disabled></td><td class='text-center'>" + maxMarks + "</td></tr>";

    JS-------------------

    function getobtainedMarks(selectObject,idx)
    {
    debugger
    //from that index you can first find index of row and put it in variable i then that i used in
    var marker1 = document.getElementById("marker1" + idx).value;

    var marker2 = document.getElementById("marker2" + idx).value;

    var marker3 = document.getElementById("marker3" + idx).value;

    if (marker1 == null || marker1 == undefined || marker1 == "") {

    marker1 = 0.0;

    } else {
    marker1 = parseFloat(marker1);
    }

    if (marker2 == null || marker2 == undefined || marker2 == "") {
    debugger;
    marker2 = 0.0;

    } else {
    marker2 = parseFloat(marker2);
    }


    if (marker3 == null || marker3 == undefined || marker3 == "") {

    marker3 = 0.0;

    } else {
    marker3 = parseFloat(marker3);
    }


    document.getElementById("demo"+idx).innerHTML = ((marker1 + marker2 + marker3) / 3).toFixed(1);

    }

  • Suggested answer
    ajyendra Profile Picture
    ajyendra 1,732 on at
    RE: html dashboard- values showing wrongly

    Hi,

    Make sure that this time you copy as it code


    function UploadFirstMarks() {

    debugger;

    var parentResource = parent.Alert.getCrmWindow();

    var subject_id = parentResource.semester_subject.control.get_selectedIds()[0];

    var examschedule_id = parentResource.college_exam_schedule_grid.control.get_selectedIds()[0];

    // var examination = '<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"><entity name="new_examination"><attribute name="new_examinationid" /><attribute name="new_name" /><attribute name="createdon" /><order attribute="new_name" descending="false" /><filter type="and"><condition attribute="new_examschedulename" operator="eq" value="' + examschedule_id + '" /><condition attribute="new_subject" operator="eq" value="' + subject_id + '" /></filter></entity></fetch>';

    var examination = '<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"><entity name="new_examination"><attribute name="new_examinationid"/><attribute name="new_name"/><attribute name="createdon"/><order attribute="new_name" descending="false"/><filter type="and"><condition attribute="new_examschedulename" operator="eq" value="' + examschedule_id + '"/><condition attribute="new_subject" operator="eq" value="' + subject_id + '"/></filter><link-entity name="new_subject_course_stream_mapping" from="new_subject_course_stream_mappingid" to="new_subject" link-type="inner" alias="be"/><link-entity name="new_subjectevaluationscheme" from="new_subjectevaluationschemeid" to="new_examscheme" link-type="inner" alias="bf"><link-entity name="new_otherassessment" from="new_examscheme" to="new_subjectevaluationschemeid" link-type="outer" alias="bg"/></link-entity><filter type="and"><condition entityname="bg" attribute="new_examscheme" operator="null"/></filter></entity></fetch>';

    var subjectexam = getFetch("new_examination", examination);

    var _html = "";

    $.each(subjectexam.value, function (index, res) {

    _html += "<option value='" + res.new_examinationid + "'>" + res.new_name + "</option>"; });

    $('#StudentSubjectComponent').append(_html);

    }

    $(document).ready(function () {

    $("#StudentSubjectComponent").change(function () {

    $("#subjectExamtable").empty();

    debugger;

    $(this).parents("tr").remove();

    var grid_id = $('#StudentSubjectComponent :selected').val();

    var uploadMarks;

    if (grid_id != null) {

    var fetch = '<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" ><entity name="new_studentsubjectmarks" ><attribute name="new_studentsubjectmarksid" /><attribute name="new_subjecttype1" /><attribute name="new_subject2" /><attribute name="new_marker1" /><attribute name="new_marker2" /><attribute name="new_marker3" /><attribute name="new_examtype" /><attribute name="new_name" /><attribute name="new_maximummarks1" /><attribute name="new_marksobtained1" /><attribute name="new_enrollmentno" /><order attribute="new_name" descending="false" /><filter type="and" ><condition attribute="new_isotherassesment" operator="eq" value="0" /><condition attribute="new_examination" operator="eq" uiname="Audits and Regulatory Compliance" uitype="new_examination" value="' + grid_id + '" /><condition attribute="new_appeared" operator="eq" value="1" /></filter><link-entity name="new_studentsubjectattendance" from="new_studentsubjectattendanceid" to="new_studentsubject" link-type="inner" alias="ae" ><link-entity name="new_studentcoursestreamdivisionsession" from="new_studentcoursestreamdivisionsessionid" to="new_studentsession" link-type="inner" alias="af" ><attribute name="new_examrollno" /><attribute name="new_student" /><attribute name="new_studentname" /><attribute name="new_rollnumber" /><link-entity name="new_student" from="new_studentid" to="new_student" link-type="inner" alias="st" ><attribute name="new_studentname" /><attribute name="new_firstname" /><attribute name="new_contactname" /><attribute name="new_contact" /><attribute name="sis_registrationid" /></link-entity></link-entity></link-entity></entity></fetch>';

    uploadMarks = getFetch("new_studentsubjectmarkse", fetch);

    }

    var len = uploadMarks.value.length;

    var head

    var html = "";

    var tbody = "";

    tbody = "<thead><tr><th valign='middle'>Enrollment No.</th><th>Student Name</th><th class='text-center'>Marker1</th><th class='text-center'>Marker2</th><th class='text-center'>Marker3</th><th class='text-center'>Obtained Marks</th><th class='text-center'>Maximum Marks</th></tr></thead><tbody>";

    if (len > 0) {

    for (i = 0; i < len; i++) {

    var enrollNo, end, s, e;

    //var enrollNo = uploadMarks.value[i]["af_x002e_new_examrollno"];

    var enrollNo = uploadMarks.value[i].af_x002e_new_rollnumber;

    var studentName = uploadMarks.value[i]["st_x002e_sis_registrationid@OData.Community.Display.V1.FormattedValue"];

    var marker1=uploadMarks.value[i]["new_marker1"];

    var marker2=uploadMarks.value[i]["new_marker2"];

    var marker3=uploadMarks.value[i]["new_marker3"];

    var maxMarks = uploadMarks.value[i]["new_maximummarks1@OData.Community.Display.V1.FormattedValue"];

    var marksobtained = uploadMarks.value[i].hasOwnProperty("new_marksobtained1") ? uploadMarks.value[i]["new_marksobtained1"] : "";

    html += "<tr><td class='nme' id='" + uploadMarks.value[i].new_studentsubjectmarksid + "'>" + enrollNo + "</td><td>" + studentName + "</td><td contenteditable='true'><input type='number' placeholder='marker1' id='marker1" + i + "' onchange='getobtainedMarks(this);'/></td><td contenteditable='true'><input type='number' placeholder='marker2' id='marker2" + i + "' onchange='getobtainedMarks(this);'/></td><td contenteditable='true'><input type='number' placeholder='marker3' id='marker3" + i + "' onchange='getobtainedMarks(this);'/></td><td class='minatt'><p id='demo" + i +"'></p><input onchange='checkObtainedMarks(this)' style='width:100%' type='number' id='" + uploadMarks.value[i].new_studentsubjectmarksid + "_minattendance' name='name'" + " value='" + marksobtained + "' data='" +uploadMarks.value[i].new_maximummarks1 + "' min='0' max='" + uploadMarks.value[i].new_maximummarks1 + "' disabled></td><td class='text-center'>" + maxMarks + "</td></tr>";

    }

    }

    var examTable = tbody + html + "</tbody>";

    var table = $("#subjectExamtable").append(examTable);

    if ($.fn.DataTable.isDataTable('#subjectExamtable')) {

    $('#subjectExamtable').DataTable().destroy();

    }

    table.DataTable();

    });

    });

    ///////////////////////////

    function getobtainedMarks(selectObject)
    {
    debugger;
    //from that index you can first find index of row and put it in variable i then that i used in
    var marker1 = document.getElementById("marker1" + i).value;

    var marker2 = document.getElementById("marker2" + i).value;

    var marker3 = document.getElementById("marker3" + i).value;

    if (marker1 == null || marker1 == undefined || marker1 == "") {

    marker1 = 0.0;

    } else {
    marker1 = parseFloat(marker1);
    }

    if (marker2 == null || marker2 == undefined || marker2 == "") {
    debugger;
    marker2 = 0.0;

    } else {
    marker2 = parseFloat(marker2);
    }


    if (marker3 == null || marker3 == undefined || marker3 == "") {

    marker3 = 0.0;

    } else {
    marker3 = parseFloat(marker3);
    }


    debugger
    document.getElementById("demo"+i).value = (marker1 + marker2 + marker3) / 3;

    }

    inside getobtained function please get index i already put comment.

  • sandeepc Profile Picture
    sandeepc 5,100 on at
    RE: html dashboard- values showing wrongly

    .

  • sandeepc Profile Picture
    sandeepc 5,100 on at
    RE: html dashboard- values showing wrongly

    ok

  • ajyendra Profile Picture
    ajyendra 1,732 on at
    RE: html dashboard- values showing wrongly

    I sent you a request again and please share your full code there.

  • sandeepc Profile Picture
    sandeepc 5,100 on at
    RE: html dashboard- values showing wrongly

    .

  • sandeepc Profile Picture
    sandeepc 5,100 on at
    RE: html dashboard- values showing wrongly

    could you pls send request again. i will accept

  • sandeepc Profile Picture
    sandeepc 5,100 on at
    RE: html dashboard- values showing wrongly

    ok

  • ajyendra Profile Picture
    ajyendra 1,732 on at
    RE: html dashboard- values showing wrongly

    I sent you code in Private message Check and applied.

  • sandeepc Profile Picture
    sandeepc 5,100 on at
    RE: html dashboard- values showing wrongly

    .

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,432 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans