• Nerd Whisperer
  • NEWBIE
  • 25 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies

Hi,

 

I have field called "WhatId" and it can have either account./opportunity/contact.. records.

I need to filter out opportunity records.

 

I tried using below query:

 

select id, subject,whatid, whoid from Task

where whatid like '006%'

 

I am getting error message "Invalid operator on id field". I tried using substring also, it didnot work.

 

Please let me know a way to identify opportunity records?

 

Thanks,

JBabu.

  • July 19, 2012
  • Like
  • 0

Hi,

Is there any way to display the another field  rather than name, after selecting the lookup. For example we have account, contact objects. If we select the account from contact, it will displays the name after selecting the account. I need to display the account number after selecting the account from contact.

 

Thanks,

Lakshmi

Hi,

 

I have field called "WhatId" and it can have either account./opportunity/contact.. records.

I need to filter out opportunity records.

 

I tried using below query:

 

select id, subject,whatid, whoid from Task

where whatid like '006%'

 

I am getting error message "Invalid operator on id field". I tried using substring also, it didnot work.

 

Please let me know a way to identify opportunity records?

 

Thanks,

JBabu.

  • July 19, 2012
  • Like
  • 0

Hi All,

 

I'm hoping that someone can help me with this?

 

I want to create a custom button in Opps that creates a new case, providing the Opp is 'closed won'.

If the Opp is not 'closed won', then I need it to alert "Opp must be won to create case".

 

I've created a button using 'Content Source = URL' which creates a new case and populates the new case fields with data from the related Opp fields (see code below), but now that I want this to be conditional on the related Opp being closed won, it seems I need to make the button OnClick Javascript and use some Javascript code.

 

/500/e?retURL=%2F500%2Fo
&cas4_lkid={!Account.Id}
&cas4={!Account.Name}
&CF00N30000009y6pH_lkid={!Opportunity.Id}
&CF00N30000009y6pH={!Opportunity.Name}
&cas5={!Opportunity.Type}
&cas14={!Opportunity.Name}
&retURL=/{!Opportunity.Id}
&saveURL=/{!Opportunity.Id}

 

I'm guessing the Javascript would need to be structured like this:

 

var status = "{!Opportunity.StageName}";
if (status == "Closed Won")
{
SCRIPT TO CREATE CASE AND POPULATE CASE FIELDS WITH DATA FROM RELATE OPP FIELDS

}
else
{
alert ('Opportunity needs to be won before a case can be created.');
}

 

Can anyone give me any help here?

 

Thanks in advance.

 

Steve