web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer Service forum

Get related field value from guid in ms crm portal on change event(Portal)

(0) ShareShare
ReportReport
Posted on by

Hi All,

I have requirement where i gave 'Product' look up on 'Order' and whenever product changes then value of  'Unit Price' should also changes on Order.

I have the guid of the Product. But i dont know how to get values related to Product attributes.

I have the code on Entity form under javascript tab.

What will be the approach to simplify it?

Categories:
  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hi,

    Download Rest Builder design your query, and use it on change of the product lookup,: github.com/.../releases

    You can check here some sample for CRM 2011 crmuk.wordpress.com/.../crm-2011-set-default-unit-when-selecting-a-product

  • Community Member Profile Picture
    on at

    I know that SIr, Will work on portal also?

    Where i need to put that JS.

    Can you send me sample code for portal?

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    Ohh sorry I ignored portal, my bad.

    Ok so to implement this you need to do some additional steps:

    1. Enable OData feed for product entity using entitylist OR setup create a web template, having a product entity fetchxml (retrieve details from product entity based on the product id)

    2. Create one page which will be using this web template.

    3. Write JQuery in your order entity form to get product id and pass it to your web page which will return your unit details and set it back to the unit lookup.

    You can use this page as a reference it will help you with the details steps, just implement it for your requirement: www.netwoven.com/.../using-liquid-templates-fetchxml-retrieve-data-dynamics-365-online-portal

  • Community Member Profile Picture
    on at

    Hi Mahender,

    i cant get product id. I'm using 'request.params.id' but i can get when i m putting in webpage which has edit form in. If i put in webtemplate and attach it to web page then i cant.

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hello,

    You need to use jquery to get value of your lookup field , you need to bind onchange event to your lookup something like this (have not tested it)

    $("#productid").on("change",SetUnit);

    function SetUnit()

    {

    //get product id

    var productid=$("#productid").val();

    //get details further using above approach

    }

  • Community Member Profile Picture
    on at

    I tried , but it does not get fire even.

    My Code

    $(ics_product).on("change",myfunction);

    function myfunction()

    {

        alert("Hello");

       var product=$(ics_product).val();

    }

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    $('#ics_product').on("change",myfunction);

    function myfunction()

    {

        alert("Hello");

       var product=$('#ics_product').val();

    }

    You can also debug your code

  • Community Member Profile Picture
    on at

    this also does not trigger sir, How can i debug this by f12 or what.

    I does not trigger how can i debug sir.

  • urklnme Profile Picture
    443 on at

    FYI:  netwoven link does not work

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Customer Service

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans