• rekha sharma
  • NEWBIE
  • 54 Points
  • Member since 2012


  • Chatter
    Feed
  • 2
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 16
    Replies
Hi All i am using amazon s3 rest API For put copyhttp://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectCOPY.html.

I am sending all the header and required parameters but i am getting exception

<Error><Code>RequestTimeout</Code><Message>Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.</Message><RequestId>29BB7877BC9BBB2F</RequestId><HostId>AzGJ4IF1Uf4olokB9eB13kNFHQTKns0jCpUqXy2HnHKZQzoEPFgd+y1DYXrV8yWUq+PmZk+dV9gkDXpEIVYK5V1ouB0WfgTP</HostId></Error>

Below is Code i am using , this can be executed from console also.

String region='us-west-2';
        
        String method = 'PUT';
        String key= 'XXXXXXXX';
        String secret = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX;
        String filename = 'Doc.pdf';
        String formattedDateString = Datetime.now().format('EEE, dd MMM yyyy HH:mm:ss z','America/Denver');    
        HttpRequest req = new HttpRequest();
        Http http = new Http();
          
        
        req.setHeader('Host','DestinationBucket.s3.amazonaws.com');  //path style
        req.setHeader('x-amz-copy-source','SourceBucket/SourceObject');
        req.setHeader('x-amz-metadata-directive', 'COPY');
        req.setHeader('x-amz-copy-source-if-match','eTAG');
        req.setHeader('x-amz-copy-source-if-none-match','etag');
        req.setHeader('x-amz-copy-source-if-unmodified-since', formattedDateString );
        req.setHeader('x-amz-copy-source-if-modified-since', formattedDateString );
        req.setHeader('x-amz-acl','private');
        req.setHeader('x-amz-bucket-region','us-west-2');
        req.setHeader('Content-Length', '332876');
        req.setHeader('Date', formattedDateString);
        req.setHeader('Content-Type' ,'pdf');
        req.setEndpoint('https://DestinationBucket.s3.amazonaws.com/DestinationObject');
       
        req.settimeout(120000);
        req.setMethod(method);
        string auth;
        String stringToSign = method+'\n\n'+'docx'+'\n'+formattedDateString+'\n/DestinationBucket/DestinationObject';
        Blob mac = Crypto.generateMac('HMACSHA1', blob.valueof(stringToSign),blob.valueof(secret));
        String sig = EncodingUtil.base64Encode(mac);
        auth = 'AWS' + ' ' + key + ':' + sig;
        req.setHeader('Authorization',auth);
        
            //Execute web service call
            try {
                HTTPResponse res = http.send(req);
                System.debug('REKHA-Resp:' + String.ValueOF(res.getBody()));
           
                
            } catch(System.CalloutException e) {
                system.debug(' AWS Service Callout Exception on : ERROR: ' + e.getMessage());
            }
I need to automatically include conference bridge (skype or go to meeting ) while sending email through apex code. is that feasible or if there is any api available from GTM or skype to do so , any one have idea please share?
String[] types = new String[]{'Account'};
List<Schema.DescribeSobjectResult> results = Schema.describeSObjects(types);
Map<String, Schema.RecordTypeInfo> rmap = new Map<String, Schema.RecordTypeInfo> ();

for (Schema.RecordTypeInfo ri: results[0].getRecordTypeInfos()) {
        rmap.put(ri.getname(), ri);//use ri.getRecordTypeId() for an Id map 
    }
system.debug('@@@@@rmap@@@@'+rmap);

+++++++++++++++++++++++++++++++++++++++++++++++++++++
in the above debug log for record type i am getting the translated values for record types
User is facing the below error while doing case closure

Please log an AR with the following details:
========================================
UPSERT --- UPSERT FAILED --- ERRORS : (CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY) entity type cannot be updated: Case --- for SFDC record with ID : null,
========================================
Case Number:
Case ID: XXXXXXXXXX
Case Record Type: CRM Support

Hello All, 

 

Can anyone help me in identifying if there any oracle web service API exposed for integration with salesforce.

If yes where i can get more details? 

If no can we create web services at the end of oracle and expose them for salesforce is that feasible.

 

 

Thanks

 

Rekha

 

Picklist values are part of application metadata and cannot be changed from Apex. You can, however, use metadata API from outside the platform to do this. refered here .... http://boards.developerforce.com/t5/Apex-Code-Development/Is-it-possible-to-add-values-in-picklist-field-via-apex-api/m-p/158592#M23262

 

How to use metadata API to add/edit/delete picklist values.

I am going through blog  http://vaibhav-deep.blogspot.in/2011/01/capture-approvalrejection-comments-in.html 

please help me in creating  the test class of the following class.

 

public class OpportunityApprovalHistoryController {
public String opptyId {get;set;}
public List<ProcessInstanceHistory> getApprovalSteps() {
if (opptyId != null) {
Opportunity quote = [Select Id, (Select TargetObjectId, SystemModstamp, StepStatus, RemindersSent, ProcessInstanceId, OriginalActorId, IsPending, IsDeleted, Id, CreatedDate, CreatedById, Comments, ActorId From ProcessSteps order by SystemModstamp desc) from Opportunity where Id = :opptyId];
return quote.ProcessSteps;
}
return new List<ProcessInstanceHistory> ();
}

}

http://vaibhav-deep.blogspot.in/2011/01/capture-approvalrejection-comments-in.html

I am taking reference from here to create an attachment , Can i use the same from trigger instead of button.I am getting

System.VisualforceException: Getting content from within triggers is currently not supported. Exception.

Please Help.

In java we can extend the properties, can we do the same in case of apex

for eg: what if i want to override the properties of <apex:command button> to toggle button?

we are using burp suite professional, i am not able to use this tool.

Our application is using rest api all the code is in salesforce itself,

also suggest do we require to use Burp scanner since code is in salesforce,

 

note:Already run a scanner from checkmarx

Submitted code to checkmarx including the XMLDom.cls, and XmlDomTest.cls from the source:

http://code.google.com/p/visualforce-components/source/browse/trunk/XmlDom/src/unpackaged/classes/

 

Problem: Test Method with no Asserts.

we are using burp suite professional, i am not able to use this tool.

Our application is using rest api all the code is in salesforce itself,

also suggest do we require to use Burp scanner since code is in salesforce,

 

note:Already run a scanner from checkmarx

Hi All i am using amazon s3 rest API For put copyhttp://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectCOPY.html.

I am sending all the header and required parameters but i am getting exception

<Error><Code>RequestTimeout</Code><Message>Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.</Message><RequestId>29BB7877BC9BBB2F</RequestId><HostId>AzGJ4IF1Uf4olokB9eB13kNFHQTKns0jCpUqXy2HnHKZQzoEPFgd+y1DYXrV8yWUq+PmZk+dV9gkDXpEIVYK5V1ouB0WfgTP</HostId></Error>

Below is Code i am using , this can be executed from console also.

String region='us-west-2';
        
        String method = 'PUT';
        String key= 'XXXXXXXX';
        String secret = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX;
        String filename = 'Doc.pdf';
        String formattedDateString = Datetime.now().format('EEE, dd MMM yyyy HH:mm:ss z','America/Denver');    
        HttpRequest req = new HttpRequest();
        Http http = new Http();
          
        
        req.setHeader('Host','DestinationBucket.s3.amazonaws.com');  //path style
        req.setHeader('x-amz-copy-source','SourceBucket/SourceObject');
        req.setHeader('x-amz-metadata-directive', 'COPY');
        req.setHeader('x-amz-copy-source-if-match','eTAG');
        req.setHeader('x-amz-copy-source-if-none-match','etag');
        req.setHeader('x-amz-copy-source-if-unmodified-since', formattedDateString );
        req.setHeader('x-amz-copy-source-if-modified-since', formattedDateString );
        req.setHeader('x-amz-acl','private');
        req.setHeader('x-amz-bucket-region','us-west-2');
        req.setHeader('Content-Length', '332876');
        req.setHeader('Date', formattedDateString);
        req.setHeader('Content-Type' ,'pdf');
        req.setEndpoint('https://DestinationBucket.s3.amazonaws.com/DestinationObject');
       
        req.settimeout(120000);
        req.setMethod(method);
        string auth;
        String stringToSign = method+'\n\n'+'docx'+'\n'+formattedDateString+'\n/DestinationBucket/DestinationObject';
        Blob mac = Crypto.generateMac('HMACSHA1', blob.valueof(stringToSign),blob.valueof(secret));
        String sig = EncodingUtil.base64Encode(mac);
        auth = 'AWS' + ' ' + key + ':' + sig;
        req.setHeader('Authorization',auth);
        
            //Execute web service call
            try {
                HTTPResponse res = http.send(req);
                System.debug('REKHA-Resp:' + String.ValueOF(res.getBody()));
           
                
            } catch(System.CalloutException e) {
                system.debug(' AWS Service Callout Exception on : ERROR: ' + e.getMessage());
            }
String[] types = new String[]{'Account'};
List<Schema.DescribeSobjectResult> results = Schema.describeSObjects(types);
Map<String, Schema.RecordTypeInfo> rmap = new Map<String, Schema.RecordTypeInfo> ();

for (Schema.RecordTypeInfo ri: results[0].getRecordTypeInfos()) {
        rmap.put(ri.getname(), ri);//use ri.getRecordTypeId() for an Id map 
    }
system.debug('@@@@@rmap@@@@'+rmap);

+++++++++++++++++++++++++++++++++++++++++++++++++++++
in the above debug log for record type i am getting the translated values for record types
User is facing the below error while doing case closure

Please log an AR with the following details:
========================================
UPSERT --- UPSERT FAILED --- ERRORS : (CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY) entity type cannot be updated: Case --- for SFDC record with ID : null,
========================================
Case Number:
Case ID: XXXXXXXXXX
Case Record Type: CRM Support

Hi,

 

I have a Dev sandbox cloned from Prod.


I have a field on it(Account.RKCB__Crunchbase_Permalink__c [ Screenshot ] ) which I access with the query:
SELECT Id,Type,ParentId,Name,OwnerId,RKCB__Crunchbase_Permalink__c, SalesTool_Company_ID__c FROM Account

 

I've checked field accessibility and it's 'Editable' for each profile[ Screenshot ]. 

And 'Visible'. [ Screenshot


Field is accessible for queries from the same account via web developer console [ Screenshot ].

 

Enterprise WSDL contains the field as well:

   <complexType name="Account">
      <complexContent>
         <extension base="ens:sObject">
            <sequence>
               . . .
               <element name="RKCB__Crunchbase_Permalink__c" nillable="true" minOccurs="0" type="xsd:string"/>
               . . .
            </sequence>
         </extension>
      </complexContent>
   </complexType>

 

Still, get the following error in Sandbox, but all is ok in Prod
System.Web.Services.Protocols.SoapException : INVALID_FIELD:
Id,Type,ParentId,Name,OwnerId,RKCB__Crunchbase_Permalink__c, SalesTool_Company_ID__c
^
ERROR at Row:1:Column:38
No such column 'RKCB__Crunchbase_Permalink__c' on entity 'Account'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

Hello All, 

 

Can anyone help me in identifying if there any oracle web service API exposed for integration with salesforce.

If yes where i can get more details? 

If no can we create web services at the end of oracle and expose them for salesforce is that feasible.

 

 

Thanks

 

Rekha

Hi, I want to call a nightly batch update process on all of the opportunities in the pipeline (certain criteria).

 

right now, I am logging in nightly and running a report and clicking all of the opportunities one at a time and clicking "edit" and then "save" and that's ridiculous. how do i automate this?

 

global class BatchUpdateForecast implements Database.Batchable<sObject>{

   global final String Query;
   global final String Entity;
   global final String Field;
   global final String Value;

   global BatchUpdateForecast (String q, String e, String f, String v){

      Query=q; Entity=e; Field=f;Value=v;
   }

   global Database.QueryLocator start(Database.BatchableContext BC){
      return Database.getQueryLocator(query);
   }

   global void execute(Database.BatchableContext BC, List<sObject> scope){
     //for(sobject s : scope){
     //s.put(Field,Value); 
     //}
     update scope;
    }

   global void finish(Database.BatchableContext BC){
   }
}

 

global class batchitupson_schedule implements Schedulable {
global void execute(SchedulableContext scMain) {
BatchUpdateForecast clsBatchItUpSon = new BatchUpdateForecast('Select Id, Name FROM Opportunity','Opportunity','Source_Name__c','Gwins');
ID idBatch = Database.executeBatch(clsBatchItUpSon, 100);
}
}

 

I am going through blog  http://vaibhav-deep.blogspot.in/2011/01/capture-approvalrejection-comments-in.html 

please help me in creating  the test class of the following class.

 

public class OpportunityApprovalHistoryController {
public String opptyId {get;set;}
public List<ProcessInstanceHistory> getApprovalSteps() {
if (opptyId != null) {
Opportunity quote = [Select Id, (Select TargetObjectId, SystemModstamp, StepStatus, RemindersSent, ProcessInstanceId, OriginalActorId, IsPending, IsDeleted, Id, CreatedDate, CreatedById, Comments, ActorId From ProcessSteps order by SystemModstamp desc) from Opportunity where Id = :opptyId];
return quote.ProcessSteps;
}
return new List<ProcessInstanceHistory> ();
}

}

http://vaibhav-deep.blogspot.in/2011/01/capture-approvalrejection-comments-in.html

I am taking reference from here to create an attachment , Can i use the same from trigger instead of button.I am getting

System.VisualforceException: Getting content from within triggers is currently not supported. Exception.

Please Help.

Submitted code to checkmarx including the XMLDom.cls, and XmlDomTest.cls from the source:

http://code.google.com/p/visualforce-components/source/browse/trunk/XmlDom/src/unpackaged/classes/

 

Problem: Test Method with no Asserts.

I want to pass the ID of the Contact from my VisualForce Email Template up to the Controller, via the Custom Component, so that the Controller can query Events for just this Contact.  However, I seem to be getting stuck at Component to Controller.

 

Per the VF Developer's Guide, under "Custom Component Controllers", step 3 says, "In the <apex:attribute> tag in your component definition, use the assignTo attribute to bind the attribute to the class variable you just defined."  However, I am finding this never sets the value in the Controller - just within the Component.  Is the Guide wrong or do I have an error?

 

Here is a snippet of the Component code:

 

<apex:component controller="EmailApptController" access="global">

    <apex:attribute name="ToID" type="ID" description="the account ID" assignTo="{!contactID}"/>
    <apex:attribute name="Something" type="String" description="something to assign" assignTo="{!something}"/>

 

 

And the relevant Controller:

 

public class EmailApptController {
	public List<Event> appts {get; set;}
	public String message {get; set;}
	public ID contactID {get; set;}
	public String something {get; set;}
	
	public EmailApptController() {
		datetime yaynow = datetime.now();
		appts = [SELECT WhoId, WhatId, OwnerId, Subject, StartDateTime, Result__c, Confirmation_Status__c, Location_Map_URL__c, Location__c, Location_Address__c, Location_City_State_Zip__c, Location_Directions__c, Location_Directions_2__c
					FROM Event
					WHERE WhoId = :contactID
					AND StartDateTime >= :yaynow
					AND Result__c != 'Cancelled'
					AND Result__c != 'Rescheduled'];
					
		if (appts.isEmpty()){
        	message = 'There are no pending appointments for this client: ' + contactID + ' and something is: '+ something;
        }
	}
	
}

 

 

contactID and 'something' always return null from the controller, but when I access them in the Component they are fine.

 

I have found this post in the wiki re Controller Component Communication, but it's way over my head and seems overkill if all I want to do is grab this one ID.  Any thoughts?

 

 

  • February 15, 2011
  • Like
  • 1
Hello,
I am trying to retrieve the detail records at the same time as the master record. I added a custom field lookup on Opportunity to Account (Contact__c).
 I get this error in Eclipse for the last line of code: "The configuration of your org has changed, please reload the page. Missing dependent object: Field: Opportunity.ContactId".
Could anybody help?
The business scenario that I have is totry to get is the latest Membership_End_Date__c for all Opportunities related to a given Contact.
 Thanks!

trigger UpdateIndividualMemberEndDate on Opportunity (after insert) { set<ID> contIDs = new Set<ID>(); if(Trigger.isInsert) { for(Opportunity o : System.Trigger.new){ contIDs.add(o.Contact__c); } Contact[] conts = new List<Contact>(); conts = [select Id, (select Membership_End_Date__c from Opportunities Order by Membership_End_Date__c desc) from Contact where ID in :contIDs]; Map<Id, Opportunity[]> contopp = new Map<Id, Opportunity[]>(); for (Contact eachCont: conts) { contopp.put(eachCont.Id, eachCont.Opportunities);} } }