The plethora of select elements on the fieldmap is a bit cumbersome, especially for SF Objects with more than say 10 fields (most of them). Can we implement a new UI for this? Add fields as needed? Drag and drop? It won't be hard to improve on what's there...

CommentFileSizeAuthor
#8 salesforce_fieldmap_ui.patch5.98 KBphenaproxima

Comments

phenaproxima’s picture

Why don't we put a single drop-down menu at the bottom of the field map table which contains a list of the unmapped fields available in the Salesforce object, and next to that a "Map Field" button? The idea being that you could select a field to be mapped, click the button, and then it would put a row in the table for that SF field which would contain the drop-down with the various Drupal fields available. So that way, there would only be as many drop-downs as necessary.

If you think this sounds like a good idea, I will be happy to write this patch.

aaronbauman’s picture

This sounds like a great solution to me.
Patches are always welcome

phenaproxima’s picture

Assigned: Unassigned » phenaproxima
Status: Active » Patch (to be ported)

Cool :) I'll get on this.

phenaproxima’s picture

Cool :) I'll get on this.

phenaproxima’s picture

Cool :) I'll get on this.

aaronbauman’s picture

Status: Patch (to be ported) » Needs work
EvanDonovan’s picture

Status: Needs work » Active

"Needs work" should be reserved for when there is actually a patch in the issue, but it needs to be rewritten, following review - see http://drupal.org/node/156119.

phenaproxima’s picture

StatusFileSize
new5.98 KB

Was FINALLY able to get to this...let me know how it can be improved, in the (likely) event that it needs improvement.

It works for me when I apply it within the sites/all/modules/salesforce directory with the command:
patch -p0 < salesforce_fieldmap_ui.patch

aaronbauman’s picture

Status: Active » Needs review
emptyvoid’s picture

I must agree this patch is heaven, especially when you have 100s of custom fields for your business objects. :) I'll continue to test the patch on my current project and provide patches and or feedback over the next few weeks..

Thanks for the contribution @phenaproxima!

EvanDonovan’s picture

In the future, can you roll patches with diff -up? It makes them easier to review.

Also, this line is syntactically invalid: + forEach($target['fields'] as $key => $field) {

Should be "foreach". Likewise with the "isSet" a few lines further down.

That said, I am going to test this now.

EvanDonovan’s picture

@phenaproxima: What version of the module was this rolled against? Some hunks fail against a dev release from mid-September? It looks from reading the patch that the changes to work with CTools for loading maps were not in yet.

EvanDonovan’s picture

Status: Needs review » Needs work

Also, throws the following error: "Fatal error: Cannot use object of type stdClass as array in .../salesforce_api.admin.inc on line 504"

Can you re-roll against latest dev? Sounds like a great concept.

aaronbauman’s picture

Status: Needs work » Fixed

#8 updated against DEV, committed with some additional error handling and UX elements

phenaproxima’s picture

@EvanDonovan: Sorry about the syntax weirdness. That's the way I normally write code - I know it contravenes the Drupal coding standards and I should have fixed that before posting the patch. My apologies.

I don't remember what version I wrote the patch for - whichever one was current at the end of August...I'm glad to see it's been committed, though :)

Status: Fixed » Closed (fixed)
Issue tags: -ui, -UX

Automatically closed -- issue fixed for 2 weeks with no activity.