SHow lookup extra fields on display
- This topic has 2 replies, 2 voices, and was last updated 10 years, 1 month ago by .
Viewing 2 reply threads
Viewing 2 reply threads
- You must be logged in to reply to this topic.
Home › Forums › Classic DFFS › SHow lookup extra fields on display
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);
}
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
Thanks worked like a charm..