• abdn
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 5
    Replies
I am creating a mail merge template on opportunity. On Opportunity, we have a custom Account lookup field named Supplier Name (API name is SupplierName__c). I want to include this Account fields like Phone, Address etc in the mail merge template but I am not able to do this.

I can display Supplier Name (like this <<Opportunity_SupplierName>> ) but cannot retrieve other fields. To display phone, I tried this:

<<SupplierName_Phone >>

<<Supplier_Name_Phone>>

<<Opportunity_SupplierName_Phone>>

<<Opportunity_Supplier_Phone>>

Any Idea how it should be done?

Hi ...

I am using REST api for my application. But I also need to use Metadata api. So for metadata api calls I am trying to use the session Id of REST authentication. For now I am able to use session id of REST api for saop api calls but when I call a  metadata method I get this error:  "INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session"

 

Here is my code:

try{
   $mySforceConnection = new SforcePartnerClient();
   $mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/partner.wsdl.xml');	
   $serverUrl = "$instance_url/services/Soap/u/27.0/00Dxxxxxxxxxxxx";
   $sessionId = $_SESSION['access_token'];
   $mySforceConnection->setSessionHeader($sessionId);
   $mylogin = $mySforceConnection->attach($serverUrl, $sessionId);
   $myMetadataConnection = new SforceMetadataClient(SOAP_CLIENT_BASEDIR.'/metadata.wsdl.xml', $myLogin, $mySforceConnection);

   /*--These 3 lines of code works fine ----*/
   $query = "SELECT Id, FirstName, LastName, Phone from Contact";
   $response = $mySforceConnection->query($query);
   print_r($response);
   /*--------------------------------------*/

  $customField = new SforceCustomField();
  $customField->setFullName('Contact.MyCustomFieldb__c');
  $customField->setDescription('Description of New Field');
  $customField->setLabel('My Custom Field Label');
  $customField->setType('Text');
  $customField->setFormula('HYPERLINK(AbdnS3__Password__c , "The Name")');
  $customField->setLength(100);
  //Contact->nameField=$customField;

  /*-----------This line giving the Error----------*/
  print_r($myMetadataConnection->create($customField));
	
} catch (Exception $e) {
   echo $myMetadataConnection->getLastRequest();
   echo $e->faultstring;	
}

 thanks

Hi all...

I want to create SHA-256 HMAC encoded message. The secrete key which i am using is in HEX formate. On a website i converted my key '1234567890abcdef1a2b3c4d5f6a7b3a' to characters and used in the code below.  I am also using an online tool which computes the  SHA-256 HMAC message so i can check my code is working properly or not. 

Problem:-  My code does not create correct message(only first few characters matches some time with the online tool messae). When i traced the error i found that there is some problem with Blob.valueOf(key) at line 4 because when at line 6 i convert the key back to Hex the output does not match the Hex input (Output=12345678c290c2abc38dc3af1a2b3c4d5f6a7b3a) red colored charecters are extra and e is missing. I tried some other hex charactres and all the time extra characters appeared in the hex string when converted back(mostly c2 and 38 are the extra characters).  I also tried to convert Hex to decimal in apex and then by using this method String.fromCharArray( intArr ) converted decimals into string, again the result was same(output 2  = 12345678c290c2abc38dc3af1a2b3c4d5f6a7b3a). Here is the code:

/*1234567890abcdef1a2b3c4d5f6a7b3a This hex is converted to the following character String 'key'*/
String key = '4Vx�«Íï+<M_j{:';    
String temp = '1F1F1F1F1356998400';
Blob mac = Crypto.generateMac('hmacSHA256',Blob.valueOf(temp),Blob.valueOf(key));
String csvBody = EncodingUtil.convertToHex(mac);
system.debug(EncodingUtil.convertToHex(Blob.valueOf(key))); //12345678c290c2abc38dc3af1a2b3c4d5f6a7b3a

 can any one help me eith this?

Hi all.

I have to made a custom report in a visual force page using JavaScript(Ajax toolkit). The report shows As of Date Opportunities records for previous 4 weeks separately e.g. 

------------------------------------------------------------------------------------------------------------------------------------------------------------------

                               |                                                                 As of date                                                                                                       |

       |------------------------------------------------------------------------------------------------------------------------------------------

Historical stage  |   06/09/2012 - 06/15/2012  | 06/16/2012-06/22/2012 | 06/23/2012-06/29/2012 | 06/30/2012-07/06/2012 |

 ------------------------------------------------------------------------------------------------------------------------------------------------------------------

Above the funnel |              Count= 42                |   Count = 35                      |          Count = 30               |         Count = 29               |

-------------------------------------------------------------------------------------------------------------------------------------------------------------------- 

 

The problem is that: What will be the criteria to decide which which opportunity belongs to which week.. Currently i am using Close Date to assign an Opportunity to a particular week but it gives wrong result. e.g. if an opportunities close date is 06/14/2012 then i am counting it in the first week..... Please Help

thanx

Hi guys,

 

today I received a strange error message after trying to change the controller in the visualforce editor

 

Error: java.sql.SQLException: ORA-00001: unique constraint (CORE.AKAPEX_CLASS) violated ORA-06512: at "HAPPY.CAPEX", line 505 ORA-06512: at line 1 : {call cApex.update_class(?,?,?,?,?,?,?,?,?,?,?,?)})} 

 

 

and remebered about a Blog article on Wes's Blog about strange error messages where I found this

 

  

Error: java.sql.SQLException: ORA-00001: unique constraint (CORE.AKAPEX_CLASS) violated ORA-06512: at “SNEEZY.CAPEX”, line 505 ORA-06512: at line 1 : {call cApex.update_class(?,?,?,?,?,?,?,?,?,?,?,?)})} 

.

 

 

Looks like some SF guys are huge fans 'Snow White and the Seven Dwarfs' .

 

 

So the big question is, where are the others and of course where's Snow White?