Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Unified Service Desk: get context from screen and put in $Return replacement parameter using javascript

Posted on by Microsoft Employee

I am trying to read some context from a webpage and put it in the $Return replacement parameter.

I'm following the method described here:

https://blogs.msdn.microsoft.com/usd/2016/05/04/exchange-information-between-unified-service-desk-and-standard-web-applications/

The following code still worked and was successfully written to the $Return replacement parameter:

function GetCustomerData(){
var klantnumber = document.getElementById("RichWidgets_wt3_block_wtMainContent_wt12").value;
return klantnumber;
}GetCustomerData();

However, since I want to also store another parameter in my context and I cannot store multiple parameters here I tried to mold this into an array or an object, both of which do not work:

Return as an array:

function GetCustomerData(){
var klantnumber = document.getElementById("RichWidgets_wt3_block_wtMainContent_wt12").value;
var accountnumber = document.getElementById("RichWidgets_wt3_block_wtMainContent_wt13").value;
var person = [klantnumber, accountnumber] ;
return person;
}GetCustomerData();

Return as an object:

function GetCustomerData(){
var klantnumber = document.getElementById("RichWidgets_wt3_block_wtMainContent_wt12").value;
var accountnumber = document.getElementById("RichWidgets_wt3_block_wtMainContent_wt13").value;
var person = {};
person.klantnr = klantnumber ;
person.accountnr= accountnumber ;
return person;
}GetCustomerData();

Is there a way to write multiple parameter to the $Return replacement parameter?

Thanks in advance!

*This post is locked for comments

  • Chinju Profile Picture
    Chinju 10 on at
    RE: Unified Service Desk: get context from screen and put in $Return replacement parameter using javascript

    Hi , Can you please tell the solution.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unified Service Desk: get context from screen and put in $Return replacement parameter using javascript

    i already solved it

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans