cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GLMSDev
Helper II
Helper II

Accessing Entity Via Code

Hi 

 

I have created an entity as shown below 

1.PNG2.PNG

and trying to read the Entity using below code. But none of them are working

 

 
 context.webAPI.retrieveRecord("aaa1s","4661b90a-028c-e911-a84e-000d3ae02142","?$select=name").then(
           function success(result){
                alert(result.name);
        },
        function (error){
            console.log(error.message);
        });

        context.webAPI.retrieveRecord("aaa1","4661b90a-028c-e911-a84e-000d3ae02142","?$select=name").then(
            function success(result){
                 alert(result.name);
         },
         function (error){
             console.log(error.message);
         });

        context.webAPI.retrieveRecord("crf65_aaa1s","4661b90a-028c-e911-a84e-000d3ae02142","?$select=crf65_name").then(
            function success(result){
                 alert(result.crf65_name);
         },
         function (error){
             console.log(error.message);
         });
 
1 ACCEPTED SOLUTION

Accepted Solutions

Have you tried this?

 

 context.webAPI.retrieveRecord("crf65_aaa1",......);

 

View solution in original post

3 REPLIES 3
ben-thompson
Solution Sage
Solution Sage

The code you need to use is 

 

context.webAPI.retrieveRecord("entityTypeName","entityGuid", selectstatement);

 

You've entered the entityName of the record there not the entityTypeName (which to be honest I think everyone does when they first start doing this).

---
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

What is this EntityTypeName? Is it custom? Can you please tell what should I be passing ??

Have you tried this?

 

 context.webAPI.retrieveRecord("crf65_aaa1",......);

 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,586)