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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (3,341)