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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to make jquery who can calll value of field at other entity form

(0) ShareShare
ReportReport
Posted on by

Hi guys, i want to get value of field at other entity form at dynamics portal. What should i do?

I try this code :

$(document).ready(function(){
    //show alert message
    //alert("Hello word !");

    //set the topic field
    //var email =  $("#EMailAdress1").attr();
    //$("#email").val("email);
    //$("#topic").val("hey");
    $("#email").val($('#EMailAddress1).val());
});

But it doesn't work. Anybody can help me?

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hello Aulia,

    To get the value of a field in a portal page using JQuery , you can use this :

    $("#{crm_schema_name}").val();

    Example:

    I have a field in my form with the schema name "samo_firstsalecompromisedate_description"

    to get the value i used this :

    $("#samo_firstsalecompromisedate_description").val();

    Tip: Try inspecting the field using the browser ( to get the exact name of the field => schema name in the CRM)  then  test your jquery command in the browser console

    Hope this answer suits you!!

    Regards!

    Taha

  • Khanza Profile Picture
    on at

    thanks for the reply Taha, i mean the code doesn't work when i want to get value from another field at another entity form. When i was try to run that code, i get a null value.

    I want to ask, how to get field value from different entity form, thank you. I hope you can help me

    Regards, Aulia.

  • Community Member Profile Picture
    on at

    Hello Again,

    Using jquery, you have access only to the information listed in the current page (Opened entity form).

    If you want to transfer information from page A to Page B you could use the url.

    For example :   

    URL page A : www.myportal.microsoftcrmportals.com/pageA/

    URL page B : www.myportal.microsoftcrmportals.com/pageB/

    You can transfer the information from page A to page B by adding it in the URL and then retreiving it using javascript i  the page B.

    The new url of page B becomes:  www.myportal.microsoftcrmportals.com/pageB/?params=paramsvalue

    Using  javascript in the page B you can retreive paramsvalue.

    Hope this is what you are looking for!!

    Regards,

    Taha

  • Khanza Profile Picture
    on at

    ehm, i can write those code at there?

    contactus.PNG

    can you make example about the code to retrieve from another page? i'm sorry i'm the beginner, can you help me? Thankyou.

  • Community Member Profile Picture
    on at

    Hello Aulia,

    I'm having problème figuring out what you want to implement. Could you describe to me with screenshots what you want to do?  

    To answer your question, yes it's written in this section, for the two pages A and B.

    Taha

  • Verified answer
    Emmaneul James Abraham Profile Picture
    727 on at

    hello Aulia,

    Instead of trying to get data from other entity form you can try to fetch the data from other entity , this you can achieve using web template (liquid template) code. let me know if you need any help to write liquid code.

    Thanks

    James

  • Khanza Profile Picture
    on at

    yea, i use liquid template to make it. Can you help me?

  • Suggested answer
    Community Member Profile Picture
    on at
  • Suggested answer
    Emmaneul James Abraham Profile Picture
    727 on at

    Hello Aulia

    to use liquid code please follow below steps

    1) create portal >> web template record

    2) and add fetch xml , find sample code below

    {% fetchxml sample_query %}

    <fetch mapping="logical" returntotalrecordcount="true">

    <entity name="entityname"> <attribute name="attr1" /> <attribute name="attr2" /> </entity> </fetch>

    {% endfetchxml %}

    {% assign results= sample_query.results.entities %}

    {% for item in results %}

    {{item.attr1}}

    {{item.attr2}}

    {% endfor %}

    3) Map web template to your page template so that it will map to web page.

    Note :- Don't forget to provide entity permissions to the entity you have used

    cheers

    James

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans