• nik9000
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
Currently I use an override for my opportunity clone, this line being a subset of it.
 
var redirectURL = "{!UrlFor($Action.Opportunity.Clone,Opportunity.Id,[retURL = $Request.retURL],true)}";
Is there any way I can set it to clone with OpportunityLineItems as well?
Hopefully there is an easy solution to this and I am just missing it.
 
For our company, we have Leads sent to a single user, as a generic pool, that others can come and claim Leads from (like a pool).  This pool user recently had some restructuring done to it, so that some people within the company do not have permissions to change the owner id to themselves (which is good and bad).  I want to create a hyperlink to an S-control on certain profiles to change the ownerid from the lead to the person that is logged in.  I did it (code below) but ran into a similar problem.  For admins and people with permission to claim a lead from the pool, everything works, but for any user that does not have access, the s-control will fail.  What I am looking for is a way to override this permission and allow this user to claim a lead from the pool.  My first instinct was to just post the URL to an offsite servlet and log in as an admin and just handle all the objects there, but I would ideally like to keep this confined as an S-Control.  Is this possible?
 
  this is the code that I used. I know the line that fails, and why it fails. I am just looking for a workaround that doesnt leave salesforce, if possible.
 
 
function startup() {
try{
if( '{!Lead.OwnerId}' == "00530000000fZ61") {
   var lead = new sforce.SObject("Lead");
   lead.Id = "{!Lead.Id}";
   lead.OwnerId = "{!$User.Id}"; //this fails
   var updateResult = sforce.connection.update([lead]);
   if(updateResult[0].getBoolean("success")) {
      return updateResult[0].id;
   } else {
       alert("Could not claim:\n\nError:\n"+updateResult[0]);
   }
}
window.close();
}catch(e){alert('update failed '+e);} }
 
window.onload = startup;
This is probably an easy question to answer, but basically I want to be able to clone an opportunity, but during the clone, erase a foreign key that is used in another system.  I figure I can just override the existing clone with an S-Cotnrol, but I do not know the syntax of setting a value of a field during the clone.  I do not want to have to use an s-control to map every field, as this object often changes fields and I do not want to have to maintain this s-control with every change.
 
Ideally i would like to use the Clone Case Action and just set the param on that url.  Something like this:
 
var redirectURL = "{!UrlFor($Action.Case.Clone,Case.Id, [ CF00N50000001T2Vj = '' ],true)}";
 
Is this possible or do i need to write an s-control to map each field individually during a clone?
This is probably an easy question to answer, but basically I want to be able to clone an opportunity, but during the clone, erase a foreign key that is used in another system.  I figure I can just override the existing clone with an S-Cotnrol, but I do not know the syntax of setting a value of a field during the clone.  I do not want to have to use an s-control to map every field, as this object often changes fields and I do not want to have to maintain this s-control with every change.
 
Ideally i would like to use the Clone Case Action and just set the param on that url.  Something like this:
 
var redirectURL = "{!UrlFor($Action.Case.Clone,Case.Id, [ CF00N50000001T2Vj = '' ],true)}";
 
Is this possible or do i need to write an s-control to map each field individually during a clone?