• Nik_P
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies
Hey all...
 
Wrote this s-control, and I am going bug-eyed looking for the error, as it just isn't working.  Any comments from the experts???
 
Code:
<html> 
<head> 

<script language="JavaScript1.2" src="/js/functions.js"></script>
<script src="/soap/ajax/12.0/apex.js"></script>

<script>

function create_tasks_1()
{       
 //
 var Record = "{!Account.Id}";
 var RecordOwner = "{!Account.OwnerId}";
 //
 // Step 1 - Send Introduction Letter
 //
 var callarray=[];
 var callobj=new sforce.SObject("task");
 callobj.set("WhoId",Record);
 callobj.set("OwnerId",RecordOwner);
 callobj.set("Priority","Normal");
 callobj.set("Status","Not Started");
 callobj.set("Type","Type");
 callobj.set("Subject","Subject");
 callobj.set("Description","Description");
 callobj.set("ActivityDate",Date()+1);
 callarray.push(callobj); 
 var callcr = sforce.connection.create(callarray);
 for (var i=0; i<callcr.length ;i++ )
 {
    if (callcr[0].getBoolean("success")) 
    {
       //alert("Call - Success");
    } 
    else 
    {
       alert("Call - Failure");
    }
 }
parent.window.location.href = 'https://na3.salesforce.com/{!Account.Id}'; 

} 
</script> 

</head> 

<body>
<table width="100%"> 
<tr> 
<td align=center> 
<span class="moduleTitle">Creating Four Month Blitz... please wait</span> 
</td> 
</tr> 
<tr> 
<td>&nbsp;</td> 
</tr> 
<tr> 
<td align=center> 
<img src="/img/waiting_dots.gif" alt="Please wait..." title="Please wait..." width=196 height=20> 
</td> 
</tr> 
</table> 

<br /> 
<div id="output-div"></div> 

</body> 
</html>

 
Trying to run this S-Control off of a custom button on the account page - the final version will have about 10 tasks setup for them (using professional, so workflow is not available).
 
Thanks!
 
N
  • May 27, 2008
  • Like
  • 0
Hello all,
 
Just a quick question for the experts out there.  We are looking to add multiple Web to Lead forms, which would have a lead source for a particular whitepaper download from the Internet.  The Web to Lead part works great, but we would like to automate the creation of a record in an object called Downloads, which would include the Lead ID, the name of the document (The lead source) and the Date (formulated to today).  Would the best way (in your opinion) to do this be:
  • develop some code which sits with the W2L form on the web, which would grab the Lead ID, then create the custom record
  • develop an Apex trigger that when a lead is created with a certain lead source type, that a record is created.
 
Thanks all,
 
Nik
  • February 22, 2008
  • Like
  • 0
Hey all,
 
I have a small issue with an S-Control I am writing, mostly as it deals with relationships, and I haven't been able to pull out the information I require with my query string.....
 
To put in context, I have a custom object named Site.  I also have a custom object named Site_Contact, which is to allow a many-to-many relationship for contacts to sites.  The site also has a lookup (not master) to the account.  What my s-control is going to do is allow them to press the button, and change any contacts associated to the site to be associated with the account which owns the site (if site is purchased by Company B, the contacts associated with the site who used to work for Company A (who used to own the site) would also move to Company B)...This s-control would run off of a button on the related list on the site detail.
 
I tried the inner join, but then, after reading through the APEX white paper, see that the joins do not work with a SOQL Call...
 
so, I have the following code for my query right now....
 
Code:
var qStr = "Select Id,AccountID, (SELECT Contact__c, Site__C From Site_Contact__c) from Contact";
try{
   var queryResults = sforce.connection.query(qStr);
   if (queryResults != null){
      if (queryResults.size > 0){
      var records = queryResults.getArray('records');
      }
   }
} 
catch(err) {
   alert(err)
}

 The tables are set up as:
Contact (Standard SFDC)
Site (Id, Contact__c)
Site_Contact (Id, Contact__c, Site__c)
 
So, I am thinking that I need to grab Id, AccountID from Contacts where (grab Id from Site Contact where the property__c field is equal to the Id of the Site detail you are on.

Of course, this doesn't seem to be working for me.  Would any of you gurus be able to point out my err in trying
  • August 02, 2007
  • Like
  • 0
Good evening all,
 
Having fun with Salesforce, and then a new challenge pops up ... we are looking at our opportunity products.  We use scheduling, but to throw a wrench into the situation, most times the prices are based on a unit price (1.54 per unit) instead of the quantity and list price (our product components are typically sold in the thousands, which would mean some calculator work for our sales guys to figure this out).  Now, the opportunity products has the sales price as a formula field, so we cannot edit this field.  However, the "development" expertise in me is minimal, and I have been unable to figure out a way to take a custom field created called "unit price", and take this field to calculate the total price through our schedule (so that the price is calculated using the unit price and not the standard sale price in the price book itself).
 
Any of you ever dealt with this kind of customization before?  If so, I would love any help you could possibly throw my way (and if we ever run into each other, I am sure a beer would need to pass from my hand to yours!  :) )
 
Thanks,
 
Nik
  • April 18, 2007
  • Like
  • 0
Good afternoon, all,
 
First off, i apologize if the questions are somewhat newbieish - I must admit i am a true neophyte when it comes to s-control creation...
 
My question revolves around adding an s-control on the opportunity form.  With scheduled products, your revenue (and release) is spread out amongst months or quarters, and to view this you have multiple clicks.  We do have a report which will show this, but once again, you need to leave the opp field to view, and it would be best to view on the opp.  What I was thinking was embedding an s-control on the detail form that would "show" this information.  My questions to all you experts is...
 
1) Can you "embed" a report on a screen through an s-control, so that it is shown (while also passing along info like the opp name, schedule, etc to filter the report)?
 
2) If this is a silly way to do it, what suggestions would you have?
 
Thanks,
 
Nik
  • March 14, 2007
  • Like
  • 0
Hey all...
 
Wrote this s-control, and I am going bug-eyed looking for the error, as it just isn't working.  Any comments from the experts???
 
Code:
<html> 
<head> 

<script language="JavaScript1.2" src="/js/functions.js"></script>
<script src="/soap/ajax/12.0/apex.js"></script>

<script>

function create_tasks_1()
{       
 //
 var Record = "{!Account.Id}";
 var RecordOwner = "{!Account.OwnerId}";
 //
 // Step 1 - Send Introduction Letter
 //
 var callarray=[];
 var callobj=new sforce.SObject("task");
 callobj.set("WhoId",Record);
 callobj.set("OwnerId",RecordOwner);
 callobj.set("Priority","Normal");
 callobj.set("Status","Not Started");
 callobj.set("Type","Type");
 callobj.set("Subject","Subject");
 callobj.set("Description","Description");
 callobj.set("ActivityDate",Date()+1);
 callarray.push(callobj); 
 var callcr = sforce.connection.create(callarray);
 for (var i=0; i<callcr.length ;i++ )
 {
    if (callcr[0].getBoolean("success")) 
    {
       //alert("Call - Success");
    } 
    else 
    {
       alert("Call - Failure");
    }
 }
parent.window.location.href = 'https://na3.salesforce.com/{!Account.Id}'; 

} 
</script> 

</head> 

<body>
<table width="100%"> 
<tr> 
<td align=center> 
<span class="moduleTitle">Creating Four Month Blitz... please wait</span> 
</td> 
</tr> 
<tr> 
<td>&nbsp;</td> 
</tr> 
<tr> 
<td align=center> 
<img src="/img/waiting_dots.gif" alt="Please wait..." title="Please wait..." width=196 height=20> 
</td> 
</tr> 
</table> 

<br /> 
<div id="output-div"></div> 

</body> 
</html>

 
Trying to run this S-Control off of a custom button on the account page - the final version will have about 10 tasks setup for them (using professional, so workflow is not available).
 
Thanks!
 
N
  • May 27, 2008
  • Like
  • 0
Hey all,
 
I have a small issue with an S-Control I am writing, mostly as it deals with relationships, and I haven't been able to pull out the information I require with my query string.....
 
To put in context, I have a custom object named Site.  I also have a custom object named Site_Contact, which is to allow a many-to-many relationship for contacts to sites.  The site also has a lookup (not master) to the account.  What my s-control is going to do is allow them to press the button, and change any contacts associated to the site to be associated with the account which owns the site (if site is purchased by Company B, the contacts associated with the site who used to work for Company A (who used to own the site) would also move to Company B)...This s-control would run off of a button on the related list on the site detail.
 
I tried the inner join, but then, after reading through the APEX white paper, see that the joins do not work with a SOQL Call...
 
so, I have the following code for my query right now....
 
Code:
var qStr = "Select Id,AccountID, (SELECT Contact__c, Site__C From Site_Contact__c) from Contact";
try{
   var queryResults = sforce.connection.query(qStr);
   if (queryResults != null){
      if (queryResults.size > 0){
      var records = queryResults.getArray('records');
      }
   }
} 
catch(err) {
   alert(err)
}

 The tables are set up as:
Contact (Standard SFDC)
Site (Id, Contact__c)
Site_Contact (Id, Contact__c, Site__c)
 
So, I am thinking that I need to grab Id, AccountID from Contacts where (grab Id from Site Contact where the property__c field is equal to the Id of the Site detail you are on.

Of course, this doesn't seem to be working for me.  Would any of you gurus be able to point out my err in trying
  • August 02, 2007
  • Like
  • 0
Hello -
 
I have a client who wants to add a stoplight image next to a custom "STATUS" field. I found this formula in the help section of the Salesforce site: IMAGE(image_url, alternate_text, height, width)
 
However, this formula directs you to find an image URL. Is it possible to insert an image from a saved file such as a gif or jpeg? Does the image have to be linked to a URL to insert?
 
Any input is appreciated.
 
Thanks!