Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Power Portal use id from entitylist to create case and set contact

Posted on by 45

Hi,

I'm working on setting up a portal.

The portal should show a list of contacts (contactlist webpage), when a contact is selected it should show a readonly (contactdetails webpage) screen of the selected contact with on the right side of the screen a couple of links, each link on the right should open a new webpage (create case webpage) with a webform of the entity portal_request. So far so good, I've managed to to this with a web link set. At this stage the contactid is in the querystring.

Now the difficult part:

When the new webpage (create case webpage) is opened I want the guid from the contact that was selected and where the id was in the querystring to be put in a lookup field called portal_contactid. so that the new portal_request record is linked to the contact.

Is there any way of doing this or does anyone have any suggestions on other solutions on getting this done?

Kind regards,

Rick Basten

  • Verified answer
    LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Power Portal use id from entitylist to create case and set contact

    Hi Partner,

    This needs some custom JS development.

    Please open your web form and the step you want to set the look up field, and in the "Form Options" tab find the "Custom JavaScript" and fill in the Jquery code to get the querystring parameters and set it as value to look up field.

    1.How to get Querystring.

    function getUrlVars()
    {
        var vars = [], hash;
        var hashes = window.location.href.slice(window.location.href.indexOf('?')   1).split('&');
        for(var i = 0; i < hashes.length; i  )
        {
            hash = hashes[i].split('=');
            vars.push(hash[0]);
            vars[hash[0]] = hash[1];
        }
        return vars;
    }

    If your parameter name is contactid, you could get it like:

    var contactid = getUrlVars()["contactid";

    And then use the following code to set value to Look up field.

    $("attribute_name").attr("value","Name");
    $("arrtibute_id").attr("value","attribute_GUID");
    $("#attribute_entityname").attr("value","entity_name");

    Hope it helps.

    Best Regards,

    Leo

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans