This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IsTest | |
public with sharing class UserTest { | |
// from Trailblazer Community https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000FSHP0SAP | |
public static String getAppName() { | |
UserAppInfo userAppInfo = [SELECT Id, AppDefinitionId FROM UserAppInfo WHERE UserId = :UserInfo.getUserId() LIMIT 1]; | |
AppDefinition appDefinition = [SELECT DurableId, Label FROM AppDefinition Where DurableId = :userAppInfo.AppDefinitionId LIMIT 1]; | |
return appDefinition.Label; | |
} | |
// failing test to illustrate the problem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String key = 'hgdhdhhdjfh12ehsn'; | |
String secret = 'DNf32sdsj747dhkjd8893jjjdjds7jjk'; | |
//Generating current Unix timestamp (in seconds) | |
String getTime = string.valueOf(Datetime.Now().getTime()/1000); | |
String requestInput = key + secret + getTime; | |
Blob requestBlob = Blob.valueOf(requestInput); | |
Blob hash = Crypto.generateDigest('MD5', requestBlob); | |
//Need to convert into hex to generate the equivalent of md5(string) method of PHP. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String key = 'hgdhdhhdjfh12ehsn'; | |
String secret = 'DNf32sdsj747dhkjd8893jjjdjds7jjk'; | |
//Generating current Unix timestamp (in seconds) | |
String getTime = string.valueOf(Datetime.Now().getTime()/1000); | |
String requestInput = key + secret + getTime; | |
Blob requestBlob = Blob.valueOf(requestInput); | |
Blob hash = Crypto.generateDigest('MD5', requestBlob); | |
//Need to convert into hex to generate the equivalent of md5(string) method of PHP. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String key = 'hgdhdhhdjfh12ehsn'; | |
String secret = 'DNf32sdsj747dhkjd8893jjjdjds7jjk'; | |
//Generating current Unix timestamp (in seconds) | |
String getTime = string.valueOf(Datetime.Now().getTime()/1000); | |
String requestInput = key + secret + getTime; | |
Blob requestBlob = Blob.valueOf(requestInput); | |
Blob hash = Crypto.generateDigest('MD5', requestBlob); | |
//Need to convert into hex to generate the equivalent of md5(string) method of PHP. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page docType="html-5.0" sidebar="false"> | |
<apex:stylesheet value="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/> | |
<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"/> | |
<script> | |
jQuery(document).ready(function($) { | |
$.ajax('/services/data/v38.0/limits', | |
{ | |
beforeSend: function(xhr) { | |
// Set the OAuth header from the session ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright (c) 2015, FinancialForce.com, inc | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without modification, | |
* are permitted provided that the following conditions are met: | |
* | |
* - Redistributions of source code must retain the above copyright notice, | |
* this list of conditions and the following disclaimer. | |
* - Redistributions in binary form must reproduce the above copyright notice, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var logId = "07Lc000001OiO8GEAV"; | |
apex.ide.Viewer.open({ | |
id: "l-" + logId, | |
logId: logId, | |
Name: "Log " + logId, | |
xtype: "logviewer", | |
rawLogSize: 1 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* getDependentPicklistOptions | |
* by Benj Kamm, 2012 | |
* (inspired by http://iwritecrappycode.wordpress.com/2012/02/23/dependent-picklists-in-salesforce-without-metadata-api-or-visualforce/) | |
* CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0/us/) | |
* | |
* Build an Object in which keys are valid options for the controlling field | |
* and values are lists of valid options for the dependent field. | |
* | |
* Method: dependent PickListEntry.validFor provides a base64 encoded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Id | Name | Website | Phone | BillingStreet | BillingCity | BillingState | BillingPostalCode | BillingCountry | |
---|---|---|---|---|---|---|---|---|---|
1 | sForceTest1 | http://www.sforcetest1.com | (415) 901-7000 | The Landmark @ One Market | San Francisco | CA | 94105 | US | |
2 | sForceTest2 | http://www.sforcetest2.com | (415) 901-7000 | The Landmark @ One Market Suite 300 | San Francisco | CA | 94105 | US | |
3 | sForceTest3 | http://www.sforcetest3.com | (415) 901-7000 | 1 Market St | San Francisco | CA | 94105 | US |