Please can someone help me to make a kind of intermediate function or way by which we can call the function having Xrm.webApi call synchronously in any synchronous function without the use of async or await keywords in the existing functions name(in intermediate function async and await will work) like below :
function show(){
//code
var result=function webapicall(); // result:undefined error as it doesn't wait for api call to finish and move to next statement as the xrm.webApi calls are asynchronous, please help me in writing such code without async or await keywords which will execute this synchronously.
alert();
//synchronous code
//more code
}
function webapicall()
{
xrm.webApi.retrievemultiplerecords().then(successcallback,error function)
return response;
}