• joey_hoey19
  • NEWBIE
  • 125 Points
  • Member since 2015
  • Salesforce Architect and Admin

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 13
    Replies
Hi Experts,

I'm on a project that needs to maintain the account and contact information in such a way that, the contacts are assigned to designation in Account.
Additionally it is also required to maintain infomration on the designations.
For example, If an account's sales manager is being replaced by another contact, they still want to maintain the information stored on the Designation.

Initially I thought of creating a custom object. But I just want to check if there is any standard funcationity/object available.
If not what are the considerations/steps needs to be taken care on a custom object?

Regards,
Anto Nirmal
hi to all,
how to make field as default for country field(text: datatype Ex: INDIA) for every record creation.

thanks in advance,
Anji
I am writing apex code that implents SandboxPostCopy so that I can automatically set up new and refreshed sandbox with code that is run via SandboxPostCopy.

One of things I want to do is to change the metadata configuration that are set up in Workflow Email alerts (e.g. the "From Email Address" in the email alert). 

Is it possible and if so how can I approach this via code? Thanks.
Hi,

I am running into this error:
{
  error_description: "expired authorization code"
  error: "invalid_grant"
}
Currently trying to connect to my Sandbox 'Connected App' from a client server running PHP scripts and using OAuth 2.0 JWT Bearer Token Flow as the method of authentication. I have gone over and over this document (OAuth 2.0 JWT Bearer Token Flow (https://help.salesforce.com/apex/HTViewHelpDoc?id=remoteaccess_oauth_jwt_flow.htm&language=en_US#validate_token)) so many times but can not seem to understand why i am getting this error.

I've checked my connected App settings and provided full access already with no restrictions of IP address so I don't know why I get expired authorization code error. Maybe it is in my PHP coding from the client side requesting the 'Access Token'? Here is my Code.
 
// You need to set these three to the values for your own application
define('CONSUMER_KEY', 'abc123');
define('CONSUMER_SECRET', '1234');
define('LOGIN_BASE_URL', 'https://test.salesforce.com');

//Json Header
$h = array(
	"alg" => "RS256"	
);

$jsonH = json_encode(($h));	
$header = base64_encode($jsonH); 

//Create JSon Claim/Payload
$c = array(
	"iss" => CONSUMER_KEY, 
	"sub" => "myemail@email.com", 
	"aud" => LOGIN_BASE_URL, 
	"exp" => "1333685628"
);

$jsonC = (json_encode($c));	
$payload = base64_encode($jsonC);

//Sign the resulting string using SHA256 with RSA
$s = hash_hmac('sha256', $header.'.'.$payload, CONSUMER_SECRET);
$secret = base64_encode($s);


$token = $header . '.' . $payload . '.' . $secret;

$token_url = LOGIN_BASE_URL.'/services/oauth2/token';

$post_fields = array(
	'grant_type' => 'urn:ietf:params:oauth:grant-type:jwt-bearer',
	'assertion' => $token
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $token_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

// Make the API call, and then extract the information from the response
    $token_request_body = curl_exec($ch) 
        or die("Call to get token from code failed: '$token_url' - ".print_r($post_fields, true));
Hope any one out there might be able to help me solve this!

Thanks.
Regards,
Joey
 
I'm utilizing my Web-to-Lead code that I generated and plugging it into PHP code so that I can use the form on a microsite. For some reason when I'm testing the site instead of displaying the form it displays a link asking me to redirect to login to Salesforce. Does anyone know of any reason that this would happen? 
Hi Experts,

I'm on a project that needs to maintain the account and contact information in such a way that, the contacts are assigned to designation in Account.
Additionally it is also required to maintain infomration on the designations.
For example, If an account's sales manager is being replaced by another contact, they still want to maintain the information stored on the Designation.

Initially I thought of creating a custom object. But I just want to check if there is any standard funcationity/object available.
If not what are the considerations/steps needs to be taken care on a custom object?

Regards,
Anto Nirmal
I have 2 users in one profile, User 1 with Role : ' GLOBAL_HQ',  & User 2 with Role : MP NA Manpower'
When I login through user 1 I am able to see xyz profile, but I when I logging through user 2 I can’t see the xyz profile.
I do not understand, WHY I am unable to find the xyz Profile for the User 2 ? Can anyone help me please.
My profile is system admin.
User-added image
Hi all 

I have email field on contact object.suppose today i creted on contact then automatically send the email to that contact person after 10 businness workig days.one more thing is which user created that contact record the user email in cc address .how can i achive this can you please give me some suggestions.


Regards
Raju.

 
hi to all,
how to make field as default for country field(text: datatype Ex: INDIA) for every record creation.

thanks in advance,
Anji
Hi to all,
How to expose the code(triggers, vf page or apex classes) written by you to all users in the organization.
please help me..

Thanks in advance,
Anji
Hi,

I am running into this error:
{
  error_description: "expired authorization code"
  error: "invalid_grant"
}
Currently trying to connect to my Sandbox 'Connected App' from a client server running PHP scripts and using OAuth 2.0 JWT Bearer Token Flow as the method of authentication. I have gone over and over this document (OAuth 2.0 JWT Bearer Token Flow (https://help.salesforce.com/apex/HTViewHelpDoc?id=remoteaccess_oauth_jwt_flow.htm&language=en_US#validate_token)) so many times but can not seem to understand why i am getting this error.

I've checked my connected App settings and provided full access already with no restrictions of IP address so I don't know why I get expired authorization code error. Maybe it is in my PHP coding from the client side requesting the 'Access Token'? Here is my Code.
 
// You need to set these three to the values for your own application
define('CONSUMER_KEY', 'abc123');
define('CONSUMER_SECRET', '1234');
define('LOGIN_BASE_URL', 'https://test.salesforce.com');

//Json Header
$h = array(
	"alg" => "RS256"	
);

$jsonH = json_encode(($h));	
$header = base64_encode($jsonH); 

//Create JSon Claim/Payload
$c = array(
	"iss" => CONSUMER_KEY, 
	"sub" => "myemail@email.com", 
	"aud" => LOGIN_BASE_URL, 
	"exp" => "1333685628"
);

$jsonC = (json_encode($c));	
$payload = base64_encode($jsonC);

//Sign the resulting string using SHA256 with RSA
$s = hash_hmac('sha256', $header.'.'.$payload, CONSUMER_SECRET);
$secret = base64_encode($s);


$token = $header . '.' . $payload . '.' . $secret;

$token_url = LOGIN_BASE_URL.'/services/oauth2/token';

$post_fields = array(
	'grant_type' => 'urn:ietf:params:oauth:grant-type:jwt-bearer',
	'assertion' => $token
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $token_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

// Make the API call, and then extract the information from the response
    $token_request_body = curl_exec($ch) 
        or die("Call to get token from code failed: '$token_url' - ".print_r($post_fields, true));
Hope any one out there might be able to help me solve this!

Thanks.
Regards,
Joey