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

integrate linked in from MS CRM 2015

$
0
0

Hi Experts,

I have done the create application for getting the api key in the linked in developer site and key is working.(login linked in logo appear in the crm contact)

But I don't think full code of scripts working or not. because I checked with alert, not alert will be triggered.

I getting the error "Error: Could not execute 'onLinkedInLoad'. Please provide a valid function for callback."

Please find my html with script code here. and I calling this through web resource in the contact.

<html><head>
<script src="iwcdev.crm.dynamics.com/.../new_json2">
</script>
<script src="//platform.linkedin.com/in.js" type="text/javascript">
api_key: 75a4zjkut5j862
authorize: true
onLoad: onLinkedInLoad
</script>
<meta charset="utf-8"></head><body ;="">
<script type="in/Login"></script>
<script type="text/javascript">
alert("1");
// Setup an event listener to make an API call once auth is complete
function onLinkedInLoad() {
IN.Event.on(IN, "auth", shareContent);
alert("2");

}

// Handle the successful return from the API call
function onSuccess(data) {
console.log(data);
alert("success");

}

// Handle an error response from the API call
function onError(error) {
console.log(error);
alert("error");
}

// Use the API call wrapper to share content on LinkedIn
function shareContent() {

// Build the JSON payload containing the content to be shared
var payload = {
"comment": "Check out developer.linkedin.com! http://linkd.in/1FC2PyG",
"visibility": {
"code": "anyone"
alert("payload");
}
};
alert("3");
//var cpnyID = xrm.Page.getAttribute("firstname").getValue();
//alert(cpnyID);
var cpnyID = "Nagarajan Jayaraman";
alert(cpnyID);
IN.API.Raw(url).method(methodType).body(bodyContent).result(resultCallback);
IN.API.Raw("/companies/" + cpnyID + "/shares?format=json")
// IN.API.Raw("/people/~/shares?format=json")
.method("POST")
.body(JSON.stringify(payload))
.result(onSuccess)
.error(onError);
}
alert("final");
</script>


<a href="www.linkedin.com/contacts;amp;trk=nav_responsive_sub_nav_network#?filter=recent&amp;trk=nav_responsive_sub_nav_network" target="_blank">Click for Linked in</a>

</body></html>

Please tell me where I done mistake!

Thanks,

Nagarajan


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images