Skip to content

Commit

Permalink
#1692: ensure references to the entry-object can be checked correctly…
Browse files Browse the repository at this point in the history
…; sort log output
  • Loading branch information
JoernBerkefeld committed Sep 11, 2024
1 parent e63d303 commit fc9ac6f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion @types/lib/metadataTypes/Event.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions lib/metadataTypes/Event.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,16 @@ class Event extends MetadataType {
for (const object of edcObjects) {
// create secondary object to quickly check eventDataSummary against
dePrefixFields[object.dePrefix] = object.fields;
dePrefixRelationshipMap[object.dePrefix] = object.relationshipName;
dePrefixReferenceObjectMap[object.dePrefix] = object.referenceObject;

// if the current object is the entry object then relationshipName and referenceObject are set to empty strings because it's not "referencing" a "relationship" but just listing its own fields
dePrefixRelationshipMap[object.dePrefix] =
object.relationshipName === ''
? object.dePrefix.split(':')[0]
: object.relationshipName;
dePrefixReferenceObjectMap[object.dePrefix] =
object.referenceObject === ''
? object.dePrefix.split(':')[0]
: object.referenceObject;

// 1.1 check if fields in eventDataConfig exist in Salesforce
// if it has no value this is the entry-source object itself
Expand All @@ -701,8 +709,8 @@ class Event extends MetadataType {
) {
// check if we found fields for the object
errors.push(
`Fields for Salesforce object ${referencedObject} could not be checked. Used fields: ` +
object.fields.join(', ')
`Fields for Salesforce object ${referencedObject} could not be checked. Fields selected in entry event: ` +
object.fields.sort().join(', ')
);
} else {
// check if the fields selected in the eventDefinition are actually available
Expand Down

0 comments on commit fc9ac6f

Please sign in to comment.