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
OTOT 

Opportunity table-Custom fields and Company Info

Hi There,

We have a custom field on the Opportunity form. What table stores the value of the field? I've found the field name in the CustomFiledDefinition table, but I can't find it's value.

Also...

How can I relate an Opportunity to a company name without having a Lead previously created?

Thanks!

René

DevAngelDevAngel

Hi OT,

For item one of your post, you need to obtain the name of the table that the custom field belongs to.  Once you have the table name, aka entity name, you can get the value of a custom field by querying the table that contains the custom field.

For item two of your post, you can create an Opportunity and specify an account to related it to (I assume that's what you mean by a company name).  You do not need to create a lead and then convert the lead to an Opportunity.  Does this answer the question?

OTOT

Thanks for you reply!

I have the name of the table,'Opportunity' and the field 'OT Product'.  By your response, am I to query the table 'Opportunity' for the value of 'OTProduct' ?...I'm confused. I know the table it applies to and the field name, I just need to know where the value for this field is located. I have the opportunity_ID, but I have no idea of where to get the "OTProduct" value they selected.

The account table does not have any reference to a Company name. am I to assume that Account name holds that value of the company name? To demonstrated this, I've created an Opportunity, an account and a contact record. At no point in this process am I required to enter the Company name. Unless, I'm missing something...

Best Regards,

 

 

 

 

DevAngelDevAngel

Hi OT,

You have found a field labeled OT Product and you need to use it's id in the select list.

As to the Company Name, when a lead IS converted the company name is used as the account name.  So, you might have a Coca Cola account.

OTOT

Hi,

Yes, I understand, but which table do I query?  "select * from {table} where ID=my_id value"

 

My original question was dealing with not having a lead created first...So, would the end user who is creating an opportunity (without a prior existing lead) have to enter the Company name in the AccountName field?

 

 

DevAngelDevAngel

Hi OT,

The table you found, opportunity, the field you found, id of OT Product, what else do you need to know? SELECT [OT Product] FROM opportunity

OTOT

So by what you've stated, this would be my statement.

select 00N20000000gyneEAA from Opportunity.

 

 

DevAngelDevAngel

Hi OT,

That is correct.  Note that the table name is case sensitive and should be opportunity.

OTOT

For some reason, this doesn't work. The VB.NET project returns "Bad field name". I contacted support and they are unable to explain why I can't access the field or see the field using the sforce browser.

Since I can't see the field in the opportunity table using the sforce browser, wouldn't this be a permission issue? Is it possible that my account does not have access to custom fields via the API?

strange....

 

DevAngelDevAngel

Hi OT,

Please post the SOAP request and I'll see if I can't determine the problem that way.

OTOT

Hey Dave,

Basically we using the Queryfilter.zip example. We inlcuded all the fields from the opportunity table. It worked fine until I attempted to included the custom field. This what were adding to the selectlist array

SelectList.Add("00N20000000gyne")

We then pass the array to the

"SampleQueryFilter_Simple" sub

DevAngelDevAngel

Hmm...

When you do a describe call on the opportunity, do you get 00N20000000gyne or cf_00N20000000gyne? 

OTOT

great...

now the project is not responding at all:

"An unhandled exception of type 'System.Xml.XmlException' occurred in system.xml.dll

Additional information: System error."

..wonderful

OTOT

I take it the reason why I'm getting the error is becuase of the patch that was applied that affects Idlists in queries?

Dim results() As Object = Me.Invoke("query", New Object() {scope, type, maxRows, [select], filter, idList, ifModifiedSince, useCaseSafeIDs}"

 

DevAngelDevAngel

Hi OT,

If you are using that type of query, then yes, you will get an error at this time.

OTOT

Do you have an ETA when this issue will be resolved?

 

DevAngelDevAngel

Hi OT,

Fix will be in today.  I will be post a notification as soon as I have verfication that all is well.  The problem has been identified and internal unit testing is in progress.