khoait / DCE.PCF

Power Apps PCF Controls Repository
GNU General Public License v3.0
49 stars 13 forks source link

displayed value/s not change while updating the value from backend/ copied record from other entity. #175

Open mmmonsanto opened 1 month ago

mmmonsanto commented 1 month ago

Component [DCE PCF Components]

Component name and version

A clear and concise description of what the bug is. I had and polylookup fields in case entity and everytime the case updated it will create an record to a Case Tracking History and one of the field is copying a record from the polylookup field in Case Entity into the Case Tracking History entity.

Bugs are the following:

  1. during displaying of the copied Json record in the Case Tracking History. the polylookup field cannot load the record(Showing an empty value to the field).
  2. change the value of the polylookup field in the Case tracking history form will update the value in the backend. but when updating the record from backend with same json format and reload the value in the UI Case Tracking History form. the original record will still be loaded in the field.

Expected behavior

JSON value should be the values to load in the configured polylookup field.

Actual behavior

JSON value is modified/changed but the original/current record prior on changed still be displayed in the form.

Screenshots selected a value for Manager field:

image

when the record is saved, it has a correct JSON value in the field

image

after, updating the value to NULL value in the backend and then reload the value in the form, it is still be displayed. screenshot from backend that the record is NULL

image

In the form, the current record prior to update the value to NULL will be displayed instead to an empty value

image

Additional context

I am using Dynamics 365 CRM, Power Platform environment.

khoait commented 1 month ago

hi @mmmonsanto, please note that the control will try to reflect the related records from the relationship, not from JSON. JSON objects are just a convenient way to access those selected items. This only happens in the frontend, when you open the form, the JSON will be updated to reflect related records.

changing JSON manually doesn't change the related records. If you want to remove all selected items from backend (plugins/flows), your plugin should disassociate all related records instead.

hope this helps!