• James_Adapx
  • NEWBIE
  • 75 Points
  • Member since 2008

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 48
    Replies
I have a Developer Edition account, and I'm not able to get into development mode, or that's what it looks like - don't see any preview when building a page. I went to the personal info section and checked the development mode per instructions, but that doesn't seem to make any difference. Is there some other setting?
  • February 17, 2009
  • Like
  • 0

hi

 

i want to make a button on contact , on click of that button i want to navigate to detail page of the related account.

 

Has anybody worked on similar functionality , please let me know.

 

Thanks in advance

Ritika

  • January 30, 2009
  • Like
  • 0
I am receiving this error when trying to save a trigger to my production SF account:

Code:
 Run test failure marker: resource '': 'System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, opportunityContactRoleUpdate: execution of BeforeInsert

 
Here is my trigger. I've tried it on after insert as well:

Code:
trigger opportunityContactRoleUpdate on Opportunity (before Insert, before Update)
{

 // Loop over the Opportunities in the 'new' list of the
 for(Opportunity o : Trigger.new)
 {
  // Here we need to do the contsraint check
  if((o.StageName == 'Closed Won (Recurring)' || o.StageName == 'Pilot (Recurring)') && o.Recurring_Opportunity__c=='Yes' && o.Probability>=90.0 && o.Client_Id__c==4944)
  {
  
   // We need yesterdays Date. First go to the start of the current Month just to be safe.
   // Then subtract one day.
   Date a = System.today();
   Date b = a.toStartOfMonth();
   Date c = b.addDays(-1);
   
   // Get the Opportunity that this one was created from using
   // the client id and a close date of before the first of last month
   // We are getting a limit of 1, to get the latest. It might not have been
   // From the last month per se, but the latest excluding this one.
   List<Opportunity> oldOpps = [SELECT id FROM opportunity WHERE Client_Id__c = :o.Client_Id__c AND closedate <= :c ORDER BY closedate DESC LIMIT 1];
   
   // Get any OpportunityContactRoles attached to the old Opportunity
   List<OpportunityContactRole> ocrs = [SELECT id, OpportunityId FROM OpportunityContactRole WHERE OpportunityId=:oldOpps[0].id];
   
   // Loop through any found OpportunityContactRole objects and set the OpportunityId
   // to the OpportunityId of the new Opportunity
   for(integer i=0; i<ocrs.size(); i++)
   {
    OpportunityContactRole new_ocr = new OpportunityContactRole(OpportunityId = o.id,ContactId = ocrs[i].ContactID,Role = ocrs[i].Role);
    insert new_ocr;
   }
  }
 }
}

 I've checked my profile permissions and I have 'Modify All' set...any reason why I shouldn't be able to create this new opportunityContactRole? I can't find anything about why I wouldn't with the 'Modify All' permissions set...

My issue is I want to export data in code from a button to excel so we can do a mail merge for 10 different word docs. I can export if I do a visual force page but the button can only call one page and I dont see another way of exporting data to excel in code. This is a custom object. Is there a way to export to multiple files?

I want to be able to change the from email in apex depending on some different scenarios. Salesforce pulls the from email out of my personal settings , so it doesnt look like I can set this in code.. Does any one know of a way to do this?

I created an apex class and I downloaded the wsdl for that class. I also have downloaded the wsdl for the sandbox. I try to access this class in c# and I am getting an invalid login session error. I am guessing this is beause I am loging into the sandbox instead of the webservice class, but I dont see that I can login using the webservice class?? Is there a way to add loggin ability to the webservice class? Does this make sense?

 

So basically I dont really need to login into the sandbox, I just need to login into this webservice class I created in the sandbox but there doesnt seem to be a way?

 

Thanks 

 

Apex class 

global class CorePattern
{

WebService static string GetPattern(string penSerNbr, string shelfSize)
{
return '';
}
error
 System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapHeaderException: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

I have seen the locking statements for apex but it doesnt seem to work that way in C#. I get a malformed query error when trying to lock the record. 

 

 sandbox.QueryResult result3 = LiveBinding.query("select id, name  from Account where id = " + "'" + pen.Account__c + "'" + " limit 1 for update");

Is there a way to ignore failing tests when deploying code to production site?  I am trying to make some changes to an existing class which has no errors and it is failing to deploy because it says there are tests that have failed. I know it runs all tests when deploying but is there a switch to disable it or maybe through eclipse you can do this? I am failing for the same reason in eclipse too.. So, Ant or eclipse solution would be great.
So I am trying to do something very simple but it doesnt want to update the field. After a user creates a case I want to update a field in that case based on what the user entered. Problem is it just doesnt put anything in there. The field is a text box on the case. This seems like it should put something in there.. Am I missing anything here?
 
trigger updateCase on Case (after update, after insert)
{
Case[] cs = [select Id, AccountId, Account_Owner__c, Account_Owner_Email__c  from Case where Id in :Trigger.new];
 
cs[0].Account_Owner_Email__c = 'Something';  //for now just hard coding something in to see the field actually update

}
I get the error "Opportunity is Undefined" when clicking this button. So I am trying to pass in the Opportunity Id so that I can pull information out of that Opprotunity..
 
 
 
Here is the javascript
{!REQUIRESCRIPT("/soap/ajax/10.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")}
 
var accts = sforce.apex.execute("sumTotal","getTotal", {arg:!Opportunity.Id});
 
Here is the class I am calling
global class sumTotal{
    WebService static double getTotal(Id optid){
    Opportunity opt = [select Id, Name, shipping_method__c, accountid from Opportunity where Id=: optid];
   
            
        ShipCode__c code = [select id, Is_USPS__c, USPS_Service_Name__c from ShipCode__c where     USPS_Service_Name__c =: opt.shipping_method__c];
        Account accnt_info = [select shippingpostalcode,billingpostalcode from account where id=:opt.accountid];
        double total_shipping_charge=0;
Here is the entire error

"A problem with the OnClick JavaScript for this button or link was encountered:
{faultcode:'soapenv:client',faultstring: ' No operation available for request
{http://soap.sforce.com/schemas/package/sumTotal}getTotal, please check the WSDL for the service.',}"


I am trying to call a class from a button and passing in a parameter like this:

The javaScript:

{!REQUIRESCRIPT("/soap/ajax/10.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")}
var opt1 = "{!Opportunity.Id}";

var accts = sforce.apex.execute("sumTotal","getTotal", {opt:opt1});


the class I am calling looks like this.

public class sumTotal{

public static double getTotal(Opportunity opt){

}}


    We are using a custom field we created in the live site and are referencing it in the sand box. When we try to move, the package is trying to import that custom field into the live site again and failing ... any ideas?


Message Edited by James_Adapx on 09-03-2008 10:39 AM
The error is below. I created the webservice in .net and then generated the apex class from the wsdl.


System.CalloutException: Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':html'

Class.NalpeironUpdateSeat.Service1Soap.seatUpdate: line 19, column 13
Class.orderExt.UpdateKeyActivationsWithNalpeiron: line 102, column 48
Class.orderExt.save: line 190, column 12
External entry point


    I get this error trying to generate an apex class from a wsdl. Failed to parse wsdl: "Error: Found more than one wsdl:portType. WSDL with multiple portType not supported". This wsdl is for the licenseing of the software we sell. Here is the ports, is there a way around the port limitation?




Message Edited by James_Adapx on 09-08-2008 09:00 AM

Hi all,

 

Im newbie in force.com, and i have a question, my question is that: i want to export list of object into CSV file using Apex. So please help me how to do this?

 

Thanks,

I created an apex class and I downloaded the wsdl for that class. I also have downloaded the wsdl for the sandbox. I try to access this class in c# and I am getting an invalid login session error. I am guessing this is beause I am loging into the sandbox instead of the webservice class, but I dont see that I can login using the webservice class?? Is there a way to add loggin ability to the webservice class? Does this make sense?

 

So basically I dont really need to login into the sandbox, I just need to login into this webservice class I created in the sandbox but there doesnt seem to be a way?

 

Thanks 

 

Apex class 

global class CorePattern
{

WebService static string GetPattern(string penSerNbr, string shelfSize)
{
return '';
}
error
 System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapHeaderException: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

I have seen the locking statements for apex but it doesnt seem to work that way in C#. I get a malformed query error when trying to lock the record. 

 

 sandbox.QueryResult result3 = LiveBinding.query("select id, name  from Account where id = " + "'" + pen.Account__c + "'" + " limit 1 for update");

I have a Developer Edition account, and I'm not able to get into development mode, or that's what it looks like - don't see any preview when building a page. I went to the personal info section and checked the development mode per instructions, but that doesn't seem to make any difference. Is there some other setting?
  • February 17, 2009
  • Like
  • 0

I'm creating my first trigger, and I can't get it to update the custom object.

 

Essentially the trigger uses the "Request Type" drop down, finds a Scope matching that field, and populates two fields on the request.  In my testing it finds the scope correctly, but does not update the Request custom object.

 

Is there something I'm forgetting?

 

Thanks,

 

Jeremy

 

 

trigger setScope on Request__c (before insert, before update) { //NOTE: This Trigger will not execute during bulk updates if (Trigger.new.size() > 1) return; for (Request__c r : Trigger.new) { Request__c oldR; if ((r.Record_Type__c != null && (r.Scope_Name__c == '' || r.Scope_Name__c == null) && (r.Scope_Description__c == '' || r.Scope_Name__c == null)) || (Trigger.IsUpdate)) { System.Debug('Matched Criteria'); if (Trigger.IsUpdate) { System.Debug('Update'); oldR = Trigger.oldMap.get(r.Id); if (r.Record_Type__c == oldR.Record_Type__c) System.Debug('Update: Record Type has not changed'); continue; } Scope__c Scope; Scope = [ SELECT Id, Name, Description_Scope__c FROM Scope__c WHERE (Scope__c.Name = :r.Record_Type__c) LIMIT 1]; if (Scope != null) { System.Debug('Found Scope ' + Scope.Name); r.Scope_Name__c = Scope.Name; r.Scope_Description__c = Scope.Description_Scope__c; System.Debug('Scope ' + r.Scope_Name__c); } } } }

 

 

 

  • February 13, 2009
  • Like
  • 0

hi

 

i want to make a button on contact , on click of that button i want to navigate to detail page of the related account.

 

Has anybody worked on similar functionality , please let me know.

 

Thanks in advance

Ritika

  • January 30, 2009
  • Like
  • 0
Hi All,

I'm hoping to get some help with this guide on how to make a quick close button that works on a list. I just tried to implement this, and I'm getting an error when I click the button:

 "A problem for this on-click javascript button or link was encountered: sforce is not defined"

Any ideas? I confirmed that Closed is indeed a status for the Status picklist and double-checked that I followed the rest of the instructions.

Thanks!

-Jake
Hi,
 
I am a new bee to Apex development.
I am trying to generate Apex class from Fedex shipping WSDL file.
 
After parsing the file, I tried to generate the Apex class but I was getting the following error,
 
Apex generation failed.
Error message:
Error: Unsupported WSDL. Operation 'deleteShipment' has more than one output element.
 
How do I generate the Apex class?
 
please throw some light on it.
 
thanks
sk
  • June 26, 2008
  • Like
  • 0