ts-force icon indicating copy to clipboard operation
ts-force copied to clipboard

Generated names for person contact fields become pc, pc_dup, pc_dup_dup...

Open wuservices opened this issue 5 years ago • 1 comments

When generating code in an organization with Person Accounts enabled, custom Contact fields on an Account are exposed as Account.ContactField__pc and Account.OtherContactField__pc, but the code generator names these as pc and pc_dup (then pc_dup_dup and so on for more fields), instead of contactField and otherContactField.

This isn't a huge deal, since you can still fix it by overriding the defaults per the awesome docs:

{
  "apiName": "Account",
  "fieldMappings": [
    {
      "apiName" : "ContactField__pc",
      "propName": "contactField"
    },
    {
      "apiName" : "OtherContactField__pc",
      "propName": "otherContactField"
    }
  ]
}

wuservices avatar Dec 28 '20 22:12 wuservices

oh interesting... I had no idea there was a __pc API ending. I think it just needs to be added to this line of code:

https://github.com/ChuckJonas/ts-force/blob/master/ts-force-gen/src/util.ts#L5

Would be a good opportunity to rewrite the function to be a little less horrible.

ChuckJonas avatar Dec 31 '20 03:12 ChuckJonas