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
MannyGrewal
Frequent Visitor

Re: Accessing Entity Via Code

Have you tried this?

 

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

 

View solution in original post

3 REPLIES 3
ben-thompson Impactful Individual
Impactful Individual

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

---
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".
GLMSDev Helper II
Helper II

Re: Accessing Entity Via Code

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

Re: Accessing Entity Via Code

Have you tried this?

 

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

 

View solution in original post

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Users online (8,837)