Namespaces added to relationships created locally

Issue #641 resolved
Eric Alexander created an issue
  1. Managed Package Installed
  2. Create a lookup from a local custom object to the manages object. Relationship name of theLookup

In the Apex editor, when access the relationship from the autocomplete

Screen Shot 2017-06-29 at 12.41.18 PM.png

after selecting it the Namespace for the referenced object is added when it should not be

Screen Shot 2017-06-29 at 12.42.07 PM.png

The relationship is not part of the package or any namespace

After removing the namespace (in the query only) the color indicate there is no reference found

Screen Shot 2017-06-29 at 12.43.09 PM.png

Yet when referenced in the code it is colored properly

Screen Shot 2017-06-29 at 12.44.06 PM.png

Comments (12)

  1. Scott Wells repo owner

    Eric, there's a file in the OST called META-INF/PackagedCustomObjectFields.properties that helps me know whether to add a namespace qualification or not. Do you mind looking at the entry (or lack thereof) for this relationship field in that file? Of course, as I think about it, it could be that there's something I'm not doing right for the relationship fields since they aren't explicitly on the object and are implicit peers of the corresponding custom relationship field. I'll take a look as well and hopefully it'll be pretty trivial to fix. As always, thanks for reporting!

  2. Eric Alexander reporter

    @RoseSilverSoftware I do not see a directory named META-INF in the OST zip that displays in the IDE but I did find the file in the root of the OST.

    Here are the entries for that object

    CHARGENTSFA__PAYMENT_REQUEST__C.ACCOUNTID__C=false CHARGENTSFA__PAYMENT_REQUEST__C.CHARGENTSFA__BILLING_CONTACT__C=true CHARGENTSFA__PAYMENT_REQUEST__C.CHARGENTSFA__EMAIL_ADDRESS__C=true CHARGENTSFA__PAYMENT_REQUEST__C.CHARGENTSFA__HASH_SUM__C=true CHARGENTSFA__PAYMENT_REQUEST__C.CHARGENTSFA__INCLUDE_PARENT_ID__C=true CHARGENTSFA__PAYMENT_REQUEST__C.CHARGENTSFA__NOTES__C=true CHARGENTSFA__PAYMENT_REQUEST__C.CHARGENTSFA__OPPORTUNITY__C=true CHARGENTSFA__PAYMENT_REQUEST__C.CHARGENTSFA__PAYMENT_LINK_FORMATTED__C=true CHARGENTSFA__PAYMENT_REQUEST__C.CHARGENTSFA__PAYMENT_REQUEST_TRANSACTION_TYPE__C=true CHARGENTSFA__PAYMENT_REQUEST__C.CHARGENTSFA__PAY_LINK__C=true CHARGENTSFA__PAYMENT_REQUEST__C.CHARGENTSFA__SEND_PAYMENT_REQUEST_EMAIL__C=true CHARGENTSFA__PAYMENT_REQUEST__C.CHARGENTSFA__STATUS__C=true CHARGENTSFA__PAYMENT_REQUEST__C.DEACTIVATION_TASKS_CREATED__C=false CHARGENTSFA__PAYMENT_REQUEST__C.FORCED_STATUS__C=false CHARGENTSFA__PAYMENT_REQUEST__C.IS_RECURRING_TRANSACTION__C=false CHARGENTSFA__PAYMENT_REQUEST__C.NOTIFICATION_ERRORS__C=false CHARGENTSFA__PAYMENT_REQUEST__C.RELATED_TRANSACTION__C=false CHARGENTSFA__PAYMENT_REQUEST__C.X2ND_NOTIFICATION__C=false CHARGENTSFA__PAYMENT_REQUEST__C.X3RD_NOTIFICATION__C=false

    Looks like it is a relationship thing with the lookup TO this object

  3. Scott Wells repo owner

    Eric, what version of the plugin are you running? Or when was the last time you updated your OST? That file should definitely be in META-INF.

    Either way, it looks like I'm not taking into account the implicit relationship field when populating that file. That will be the fix. Thanks for confirming!

  4. Eric Alexander reporter

    @RoseSilverSoftware Using the latest version of the plugin. Had not regenerated the OST in a while though.

    I just now regenerated it and it was in META-INF now. Issue still present

  5. Scott Wells repo owner

    Cool. Yeah, I'm pretty sure I know what's happening and it would still be a bug if so. I'll take a look soon.

  6. Ken Lewis

    Hi Scott, I have been seeing this issue with other, non-relationship, custom fields that I have added to Objects in managed packages also. (So, the custom field is not part of the managed package, but the Object is.) When I select the field name in the auto-complete window, it expands to include the managed package namespace (when the namespace should not be included, since the field is not part of the package). I've included an image here. Not sure if this should be a comment on this issue, or a new Issue altogether. Happy to create one if that would be useful. managed-package-custom-field-namespace.png

  7. Scott Wells repo owner

    Ken, has your connection picked up the organization namespace? If not, click the Test button to pick it up:

    OrganizationNamespace.png

    and also make sure that the organization namespace is correlated to the official namespace properly at the project level, e.g.:

    OrganizationToOfficialNamespace.png

    In that example my DE org has a namespace of base_dev but the package's official namespace is base. When you set things up that way, you just develop against the real namespace and IC will take care of translating to your dev org's namespace during deployment and vice-versa during retrieval. If you're developing directly against your official namespace, those two will be the same (that's the default).

    Make sure you're configured that way and see if it doesn't resolve the completion issue for you. It shouldn't prefix namespaces when the connection against which you're developing has that namespace. It should only prefix when a namespace qualification is required.

  8. Ken Lewis

    Hi Scott, Sorry for the delay but I thought I would follow up and update you on what I found, just in case it would be helpful.

    The connection I am using is to a Sandbox with multiple managed installed packages. The organization's NamespacePrefix is null. The development work I am doing is not packaged. In am referencing many custom fields within the installed managed packages, as well as non-packaged custom fields.

    Occasionally, it seems like IC thinks one of my non-packaged custom fields is part of a namespaced managed package when I use code-completion.

    Anyway, this is not a major issue, and might actually be resolved by this update in 1.7.9.6; I'm just adding the additional info here in case it is helpful. Thanks for building such an awesome tool!!

    organization-namespace.png

    modules-and-connections.png

  9. Scott Wells repo owner

    Ken, definitely update to the latest build (1.7.9.9 right now) because I've addressed many of these issues. After updating, please regenerate your OST and then let me know if you see these problems anymore. Thanks!

  10. Log in to comment