locked
Retrieve the sub grid values in CRM 2013 RRS feed

  • Question

  • Hi All,

     I am retrieve the sub grid values, below function is working fine!

     If subgrid has values  claim has yes am setting one value.

    If subgrid has No am setting one value.  If sub grid has both Yes, No i have to set another value. can you please suggest me how to set the both  values are in the sub grid?

    function RetrieveSubGridRecords()

    {
        var claimed;
        if (document.getElementById("m_pmembers")) {
            var grid = document.getElementById("mcsuk_pmembers").control;
            for (var rowNo = 0; rowNo < grid.GetRecordsFromInnerGrid().length; rowNo++)
                claimed = grid.GetRecordsFromInnerGrid()[rowNo][3].cells[3].outerText;
              }
        else {
            setTimeout("RetrieveSubGridRecords();", 2500);
        }
        if(claimed=="No")
        {
            Xrm.Page.getAttribute('k_aclaim').setValue(110090000);
        }
        else if(claimed=="Yes")
            {
                Xrm.Page.getAttribute('k_claim').setValue(110090001);
            }

        else 
        {
          setTimeout("RetrieveSubGridRecords();", 2500);
        }

    }

    Monday, December 7, 2015 10:44 PM

All replies

  • Isn't this a duplicate?

    Rickard Norström Developer CRM-Konsulterna
    http://www.crmkonsulterna.se
    Swedish Dynamics CRM Forum: http://www.crmforum.se
    My Blog: http://rickardnorstrom.blogspot.se

    Tuesday, December 8, 2015 7:05 AM
  • You want if grid return No then set Value 110090000?

    if Both (Yes,No) then set value 110090001 ?

    function RetrieveSubGridRecords()

    {
        var claimed;
        if (document.getElementById("m_pmembers")) {
            var grid = document.getElementById("mcsuk_pmembers").control;
            for (var rowNo = 0; rowNo < grid.GetRecordsFromInnerGrid().length; rowNo++)
                claimed = grid.GetRecordsFromInnerGrid()[rowNo][3].cells[3].outerText;
              }
        else {
            setTimeout("RetrieveSubGridRecords();", 2500);
        }
        if(claimed=="No")
        {
            Xrm.Page.getAttribute('k_aclaim').setValue(110090000);
        }
        else
             {
                Xrm.Page.getAttribute('k_claim').setValue(110090001);
            }
     }


    Muhammad Sohail


    • Edited by sohail450 Tuesday, December 8, 2015 1:07 PM
    Tuesday, December 8, 2015 1:00 PM