cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pdcmagno
Frequent Visitor

Entity is missing on CDS - Current Environment

Hi,

 

I am working on a Canvas App (Microsoft Dynamics 365 CE as its common data service) and I'm facing an issue right now. One custom entity is missing in the list of entities under the Current Environment. I used the 'change environment' option and point it to the same environment with the current environment and the custom entity I'm looking for appears. However, since there are now two source of data, the codes are breaking.

 

Kindly advise.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @pdcmagno ,

 

I am not sure why the custom entity doesn't appear in the Current environment, I can not reproduce this issue yet.

However, the solution I provide above should help to work around this issue, replace all entities with the ones in actual environment.

First to delete all entities in current environment, then switch to the actual environment and add these entities back. If the entity names are the same as before, the code should not crash.

Sik

View solution in original post

5 REPLIES 5
v-siky-msft
Community Support
Community Support

Hi @pdcmagno ,

I made a test, and found that changing the current environment to the same environment doesn't break your code if the Connection Names(Entity Name) are kept the same.

If you add a new entity first and then delete the old one, the new entity name will have an additional suffix "_1", and the names of the two entities are not the same, which will cause the code to crash.

Snipaste_2020-06-03_16-33-22.png

You need to delete the old entity first and then add a new entity, which will leave the entity name unchanged, and the code can still work as before.

Hope this helps.

Sik

Hi Sik,

 

Actually the main issue is the missing custom entity in the Current Environment. I only use the Change Environment because I couldn't see the entity under the Current Environment.

Hi @pdcmagno 

 

OK, I though you want to handle the code break issue.

What is the kind of Custom entity? could you share some screenshots to show the issue?

Sik

Hi Sik,

 

Please see below image. The Contact entity exists in the "Current Environment" and the actual environment. However the Customer Goals entity (custom entity) are not listed in the "Current Environment". Please take note that the Actual Environment is same with the Current Environment. I'm using a Patch function in my code to assign a value in the Customer Goal Lookup. It is okay and works on first try but when I reopened the app, code breaks asking for a different schema.

 

Error.png

 
 

Hi @pdcmagno ,

 

I am not sure why the custom entity doesn't appear in the Current environment, I can not reproduce this issue yet.

However, the solution I provide above should help to work around this issue, replace all entities with the ones in actual environment.

First to delete all entities in current environment, then switch to the actual environment and add these entities back. If the entity names are the same as before, the code should not crash.

Sik

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,284)