SHow lookup extra fields on display

Forums Classic DFFS SHow lookup extra fields on display

Viewing 2 reply threads
  • Author
    Posts
    • #13207
      Charlie Bell
      Participant

      I have this code working on New and edit but I need something to work in the display I have tried a few things and variations and no luck here is the code I am using in edit.
      function ShowNote(){
      var sVal = $(“#dffs_Account_x0020_Name”).find(“option:selected”).val(), res;
      var res = spjs_getItemByID({“listName”:”Accounts”,”listBaseUrl”:”/Intranet/crm”,”id”:sVal,”viewFields”:[“Note”]});
      $(“span.accountnotes”).html(res.Note);
      var res3 = spjs_getItemByID({“listName”:”Accounts”,”listBaseUrl”:”/Intranet/crm”,”id”:sVal,”viewFields”:[“Service_x0020_Type_x0020_Agreeme”]});
      $(“span.servagree”).html(res3.Service_x0020_Type_x0020_Agreeme);
      }

    • #13215
      Alexander Bautz
      Keymaster

      In DispForm you don’t have a select to find the value is, so you must change this variable:

      var sVal = $("#dffs_Account_x0020_Name").find("option:selected").val();

      to this

      var href = $("#dffs_Account_x0020_Name td.ms-formbody").find("a").attr("href");
      var sVal = GetUrlKeyValue("ID",false,href);

      Hope this helps,
      Alexander

    • #13234
      Charlie Bell
      Participant

      Thanks worked like a charm..

Viewing 2 reply threads
  • You must be logged in to reply to this topic.