• MLee
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hello,
 
Can somebody please assist with the following query?
 
I have a custom object called "Meeting_Notes__c" that has an opportunity lookup on the page (not required). I would like to place a detail button that uses the JavaScript Onlick event at the top of the Meeting_Notes__c page.
 
If an opportunity has been entered I need to open the opprotunity edit page and update the opportunities "Next Step" and "Current Status" fields with data from the active meeting note record.
 
If there is not an opportunity I would like to alert the user that there is not a related opportunity and return to the active meeting note record.
 
This is what i have so far.
 
---------------------------------------------------------------------------------------------------------------------
 
{!REQUIRESCRIPT("/soap/ajax/8.0/connection.js")}
 
//establish connection to SF
var connection = sforce.connection;

//Query meeting note and retrieve related Opportunity ID
var meetingnoteId = "{!Meeting_Notes__c.Id}";
var qr = connection.query("Select Meeting_Notes__c.OpportunityId__c From Meeting_Notes__c
Where Meeting_Notes__c = '" + meetingnoteId + "'");
 
//Declare Opportunity variable
var meetingnoteOpp ="{!Meeting_Notes__c.OpportunityId__c}";
 
//If an opportunity is populated edit opportunity else alert user that there is not an opportunity
if (meetingnoteOpp != 'NULL')
 {
       open(https://tapp0.salesforce.com/{!Meeting_Notes__c.OpportunityId__c}/e?retURL=%{!Meeting_Notes__c.OpportunityId__c}&opp10={!Meeting_Notes__c.Next_Step__c}&00N30000001B3x7={!Meeting_Notes__c.Current_Status__c})
 }
else
 {
       alert("This is a test")
 }
)
 
--------------------------------------------------------------------------------------------
 
Thank you in advance - MLee
  • October 30, 2007
  • Like
  • 0
Hi All,
 
In our Contracts object, we have a Master Agreement recordtype and other recordtypes for the associated service schedules.  The service schedules link back to the Master by way of a Lookup field.  I'm trying to create an s-control (url) that will let my users create a service schedule from the Master record.  The s-control will create a new record but it won't pass the Master's contract id to the associated lookup field in the service schedules.  Would anybody be able to suggest how to correct the following?  Based on my reading of the html source, CF00N60000001IQhp is the lookup field id.
 
setup/ui/recordtypeselect.jsp?ent=Contract&retURL=%2F{!Contract.Id}&save_new_url=%2F800%2Fe%3FretURL%3D%252F{!Contract.Id}%26accid%3D{!Contract.AccountId}&CF00N60000001IQhp_lkid={!Contract.Id}&CF00N60000001IQhp_lkold={!Contract.ContractNumber}
 
Thanks.
 
Aiden