cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GLMSDev
Level: Powered On

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
Highlighted
MannyGrewal
Level: Powered On

Re: Accessing Entity Via Code

Have you tried this?

 

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

 

View solution in original post

3 REPLIES 3
ben-thompson
Level 8

Re: Accessing Entity Via Code

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).

GLMSDev
Level: Powered On

Re: Accessing Entity Via Code

What is this EntityTypeName? Is it custom? Can you please tell what should I be passing ??
Highlighted
MannyGrewal
Level: Powered On

Re: Accessing Entity Via Code

Have you tried this?

 

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

 

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 163 members 5,896 guests
Please welcome our newest community members: