cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (10,997)