• 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?
  • September 15, 2015
  • Like
  • 0

HI...

I am developing a web application integrated with salesforce. I used REST API and SOAP API (PHP Toolkit) for integration. The application creates a custom field on Contact.  This field must be shown on the Contact detail page hence must be added to Contact's layout. I am able to create the field by using metadata api by PHP coding but the problem is now how to add the field to the Contact's Layout. I read php toolkit documentations but did not found any help. Any one there got any Idea how to do this?

  • September 09, 2013
  • Like
  • 0

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

  • August 25, 2013
  • Like
  • 0

HI....  

 

I want to create a button on Contact object using php toolkit. I searched the net and salesforce docs for two days but did not found much help. There are examples of creating fields. Is there a way to create a button on objects via an AP?.

 

thanks

  • June 18, 2013
  • Like
  • 0

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?

  • June 08, 2013
  • Like
  • 0

I has customer portal licences. I want each portal user to see only his data. I also want customer portal to integrate with an out side website so that each user can show information related to his own data on website. my question is that Can this data connect to the website via API exchange?

  • December 18, 2012
  • Like
  • 0

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

  • July 13, 2012
  • Like
  • 0
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?
  • September 15, 2015
  • Like
  • 0

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

  • August 25, 2013
  • Like
  • 0

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?

  • June 08, 2013
  • Like
  • 0

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

  • July 13, 2012
  • Like
  • 0

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?