Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

requestobject() method doesn't called in Offline html page in woordford . below is my code please check

Posted on by 175
<html>
<head>
<!-- Activate IE9 document mode, if available -->
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=false">

<meta name="viewport" content="initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
<script type="text/javascript" src="../jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="../Schema.js"></script>
<script type="text/javascript" src="../Enums.js"></script>
<script type="text/javascript" src="../Common.js"></script>
<script type="text/javascript" src="JSBridge.js" ></script>
</head>
<body onload="pageload();" onChange="pageload();">

<body>
<h3> Hello </h3>
<input type="text" id="test1"></input>
<input type="text" id="test2"></input>
<input type="text" id="test3"></input>
<input type="text" id="test4"></input>
<script>

function pageload(){

document.getElementById("test1").value="abc";
MobileCRM.UI.EntityForm.requestObject(function (entityForm) {

document.getElementById("test2").value="efg";
mainFunction(entityForm);
  return true;
}, MobileCRM.bridge.alert, null);

function mainFunction(entityForm){
document.getElementById("test2").value="efg";
var accountEntity = entityForm.entity;
accountEntity.properties.name = "abc";
accountEntity.properties.emailaddress1 = "aakashc276@gmail.com";
MobileCRM.bridge.alert("yes");
var xhr = new XMLHttpRequest();
xhr.open("GET", "">reqres.in/.../3", true);
xhr.onload = function () {
document.getElementById("test4").value=xhr.responseText;
var firstname = xhr.responseText.data.name;
accountEntity.properties.name = firstname;

xhr.send();

}
}
}
</script>
</body>


</html>




*This post is locked for comments

  • Suggested answer
    Prashant_ Profile Picture
    Prashant_ 1,040 on at
    RE: requestobject() method doesn't called in Offline html page in woordford . below is my code please check

    Please check JSbridge file properly loaded or  not during debugging.If you have created directory in Offline HTML then you should load it as below

    <script type="text/javascript" src="../JSBridge.js"></script>

    <script type="text/javascript" src="../JSBridgeExtension.js"></script>

    Try to debug code you will find appropriate error.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans