• Pavel Zaverach
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hello everyone,

i try to build a custom lightning web component for a generic way to merge custom and standardobjects like the standard merge functionality for account, contact and leads.

Therefore i built two lwcs:
  • potentialDuplicates
  • mergeDuplicates
potentialDupplicates show the result for the duplicate rules (DuplicateRule), duplicate recordset (DuplicateRecordSet) and duplicate record item (DuplicateRecordItem) and looks like the following one:
https://ibb.co/gwp1fRk (https://ibb.co/jMRKJZL)

The first lwc (german language) show the salesforce standard "potential duplicates" component.
Below that - the highlighted one is my custom lwc.

The first screen (step1) looks like the following (Unfortunately I can't upload images - sorry for that):
https://ibb.co/MkJmmZT

After the selection and click on "Next" second screen (step2) appears and looks like the follwing:
https://ibb.co/xXQZDV1

On screen2 you have to choose the masterrecord and fields which has to move to masterrecord.

For comparison: In the standard potential duplicates the screen for step2 looks like the following:
https://ibb.co/5x7hfFv

I want to do this the exact same way. Here comes my problem: I didn't find a structure provided by apexcontroller that is able to iterate in a way to this list that columns and rows are syncron. The prepared structure of (selected) data records should be combined in such a way that they can be passed on to an apex controller, which then takes over the merge process.

One of my various solutions provide the following structure: Map<Id, List<Map<String, String>>>. Where key of map is the record id. The value of the outer map is a list with a map (key: apiname, value: fieldvalue). But this structure does not fit to the columns of screen2 and you can't iterate over map. Also a template expression doesn't allow NumericLiteral to access a specific index or key. It seems like everything has to be a list.

If I can realize this list of the selection, the processing of the data sets in Apex is only a child's play. Today I have worried all day about it and have not found an adequate solution.

Any suggestions for a provided structure of objects, arrays, maps to rule this target?

After i finished that components and everything works fine I am willing to publish the corresponding components.