Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

Lookup Field

$
0
0

Good afternoon,

I am using the code below to get the name and id of a Lookup which is in the Product entity.

I'm able to bring the result usually, but I'm not getting fills the lookup with the result.

SetaUnidade function ()
{
if (Xrm.Page.getAttribute ("productid"). getValue ()! = null)
{
var = ProdutoID Xrm.Page.getAttribute ("productid") getValue () [0] .id.;
alert (ProdutoID)

XrmServiceToolkit.Rest.RetrieveMultiple (
"ProductSet"
"? $ select = $ new_unidadeoperacionalid & filter = ProductId eq guid '" + ProdutoID + "'"
function (results) {
for (var i = 0; i <results.length; i ++) {
var new_unidadeoperacionalid = results [i] .new_unidadeoperacionalid.Id;
var new_unidadeoperacionalname = results [i] .new_unidadeoperacionalid.Name
}
alert (new_unidadeoperacionalid);
alert (new_unidadeoperacionalname);

var value = new Array ();
value [0] = new Object ();
value [0] .id = new_unidadeoperacionalid;
value [0] .name = new_unidadeoperacionalname;
value [0] = .typename new_unidadeoperacional;
Xrm.Page.getAttribute ("new_unidadeoperacionalid") setValue (value).;
},
function (error) {
alert (error.message);
},
function () {
// On Complete - Do Something
},
true
);
}
}


Viewing all articles
Browse latest Browse all 55831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>