Here i am fetch the guid value of the record based on record name using fetch xml in the java script function. Below is the code
var fetch1 = '<fetch mapping="logical">' +
'<entity name="service">' +
'<attribute name="serviceid"/>'+
'<attribute name="name"/>'+
'<order attribute="name" descending="false" />' +
'<filter type="and">' +
'<condition attribute="name" operator="eq" value="' + servicename+ '" /> ' +
'</filter>' +
'</entity>' +
'</fetch>';
var res = svc.Fetch(fetch1);
if(res!=null)
{
if (res[0].attributes.id != null) {
testid = res[0].attributes["id"];
}
}
//lookup
lookupValue[0].id = "testid";
Error : UciError: Invalid value testid for value[0].id