function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
OnDem DevOnDem Dev 

Query default Custom field of Opportunity object?

Hi,

 

In my package, query to Opportunity object is made in which Current Generators, Main Competitiors are queried and shown in Visualforce page.

After doing Managed Release, and installing package in another instance.

When that Visualforce page is viewed, the Current Generators and Main Competitors fields are empty.

When i checked the fields of Opportunity object, each custom field like Current Generators is twice, one is default and other Managed Release.

 

So how can the value from the Current Generators and other Custom Opportunity fields be obtained.

 

Regards

 

WesNolte__cWesNolte__c

Hey

 

Just a shot in the dark, have you tried prefixing the field names with the package namespace?

 

Wes 

OnDem DevOnDem Dev

Thanks,

 

I did not add the Namespace prefix to any of the fields, they are automatically getting added when the package is installed in VF pages.

 

Can you please let me know what could be the solution?

 

Regards

WesNolte__cWesNolte__c

Oh I see.

 

So your code in your packaging org is:

 

[SELECT field FROM object];

 

And in your package-installed Org it's:

 

[SELECT prefix__field FROM object];

 

Is this correct? So even though the prefix is there it's not selecting the correct field? I don't think you can see the apex code to confirm this, but you might be able to ask support to check it out for you.

 

Wes