35
Views
7
Comments
[ObjectDiff] ObjectDiff Comparison not working for some attribute types
objectdiff
Service icon
Forge asset by Stuart Harris
Application Type
Service
Service Studio Version
11.53.19 (Build 61407)

I am trying to use the objectdiff module on 2 objects of the same entity with a set of attributes among which some are foreign keys.

When I use the module to catch any difference between these 2 objects, some comparisons work while for some attribute the module is catching a difference but overwrites the old value with “EMPTY” and the new value with “EMPTY” as well. 

The comparison doesn’t seem to be working when:

  • The attribute that is being changed is a foreign key to an entity where this same attribute is the primary key

  • The attribute that is being changed is a foreign key that point to an entity that is not static

Only use case where the comparison works as expected is when the foreign key being changed is pointing at a static entity?

Is that an expected behavior?

The entity being compared is provided in the screenshot. Among all the attributes, some like BrandId, CostDistributionId, CampaignStartDate, CampaignEndDate, PrintingFlag are correctly being compared by the objectdiff component while some other like CampaignId, ChannelName are not


Screen Shot 2022-10-07 at 9.54.31 AM.png
2024-11-07 03-28-42
Stuart Harris
Champion

Hi Meziane,

The entity the foreign key points to must have its Label attribute set.  Values for foreign keys use the "Label" attribute of the foreign entity as well as displaying the id. 

Could you check your entities, Brand, CostDistribution, CampaignStartDate, etc have a Label attribute set?

Kind regards,

Stuart

UserImage.jpg
Meziane Chauvin

Hi Stuart, 

I am comparing 2 objects of the ExpenseLog nature (see screenshot)

ExpenseLog_BrandId.png
UserImage.jpg
Meziane Chauvin

The comparison on brandId works as expected. I attached a screenshot of the BrandId key defined in the Brand entity

UserImage.jpg
Meziane Chauvin

However the comparison is not working for the channel name attribute. See following screenshot and the next. The label seems appropriately set from what I can see. Or do you mean something else by "Label"

ExpenseLog_ChannelName.png
UserImage.jpg
Meziane Chauvin

See additional screenshot for Channel entity

ChannelEntity.png
2024-11-07 03-28-42
Stuart Harris
Champion

Hi Meziane,

Thank you, those images really help! :)

Ah yes, I do mean something else by Label.  Its the Label attribute on the entity.

To get to this screen select the foreign entity, eg the ChannelName entity, then click on More...

Then set the Label Attribute to ChannelName.

If this is not the issue we'll have to keep investigating, but hopefully that is what is missing.

And if it doesn't work, could you post an example of the diff output?

Thanks and I hope this helps.

Stuart 

2024-11-07 03-28-42
Stuart Harris
Champion

Hello Meziane,

I hope your issues have been resolved.

If not, I have just found and fixed a bug (fixed in version 1.0.0.5) where the value displayed for foreign keys was "EMPTY" when the foreign key entity identifier data type was "Text" rather than "Long Integer" or "Integer".  This seems to be the same behaviour you were experiencing.

I hope this helps.

Kind regards,

Stuart

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.