• Anindya Chattopadhyay
  • NEWBIE
  • 30 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 19
    Replies

Hi all:

I am trying to consume Kraken API from Apex. Here is the link to their API:

https://www.kraken.com/help/api#general-usage

For the public market data, it works without any problem. However can't get the Private user data API working. For Private calls, we need to provide Signature and Key. 

API-Key = API key
API-Sign = Message signature using HMAC-SHA512 of (URI path + SHA256(nonce + POST data)) and base64 decoded secret API key

Here is my code:

           request.setHeader('API-KEY', 'XYZ');    //API-Key = API key	        
	       private static String getNonce{
    		 get{
    			return String.valueOf(System.currentTimeMillis());
    			
    		 } 
    		 set;
    	    }            
            String path = '/0/'+endPoint;
            String secret = 'ABC==';
            String payLoad = null //Not passing any data at this stage
            Blob digest = Crypto.generateDigest('SHA-256', blob.valueOf(getNonce+payLoad));
            Blob pathBlob = Blob.valueOf(path);
            
            String combinedDataAsHex = EncodingUtil.convertToHex(pathBlob) + EncodingUtil.convertToHex(digest);
            
	        Blob combinedDataAsBlob = EncodingUtil.convertFromHex(combinedDataAsHex);
            
            Blob apiSignature = Crypto.generateMac('hmacSHA512', combinedDataAsBlob, EncodingUtil.base64Decode(secret)); 
            request.setHeader('API-Sign', EncodingUtil.base64Encode(apiSignature));

I made sure the key and secret are exact. Now when I execute the following line:

HttpResponse response = new Http().send(request);

the reasponse code is always 200 OK. However when I print the response, I see:

15:58:53:953 USER_DEBUG [843]|DEBUG|RESPONSE: {"error":["EGeneral:Internal error"]}

If someone can please help me that would be great. May be I am doing something wrong when generating the combined data as Blob?!

Any help will be much appreciated.

Thanks and regards,
Anindya

Hi All:

We have set up Partner Community where users can log as users of Partner Community. In that Community portal , users can view/edit Opportunity. The Community is using Customer Service (Napili) template

We also have got a page layout for Partner Community Profile and org defaul Lightning Record Page (which defines path, tabs etc.) The users can see all fields etc as defined in the page layout. However can't see the sales path at the top of the Opportunity page. In Salesforce, users can.

User-added image

I reckon the lightning record page is different for Community than one in Salesforce. 

Is there any way we can show sales path in Community?

Thanks and regards,
Anindya

 
Hi there:

I am very new to the concept of Salesforce Community and Salesforce overall. But getting used to it gradually.

I have got a Partner Community Portal where self-sign is enabled. Everything works well -
  • users can sign up
  • users get assigned to a business account as contact
  • users get assigned to Partner Community User profile (which has got Partner Community license)
  • users can sign in and see the following as landing page.
landing page
Strange enough users can't see the Home tab and the Lead Home acts as the landing page !! However users can navigate to Default Home using the following explicit URL: /home/home.jsp

home page

Any help will be much appreciated. For the profile Partner Community User, I have got Standard Tab of Home as Default On.

Thanks and regards,
Anindya
Hi there:

I am pretty new to Process Builder and Salesforce overall. Just got confused about some basic principles of Process Builder.

Suppose I have got 3 Process Builder flows which run on Update of Opportunity and also update Opportunity object. For example flow 1 runs on update of Opportunity and updates field 1 of Opportunity. Flow 2 runs on update of Opportunity and updates field 2 of Opportunity. Flow 3 runs on update of Opportunity and updates field 3 of Opportunity. Am I going to hit an infinite loop of update in this scenario?

Thanks and regards,
Anindya

Hi All:

I am trying to implement Bitly with a custom field in Opportunity. I am successful in getting the Bitly Url for the Opportunity field. However I am having trouble in getting test cases set up for the same. I followed the following article:

https://douglascayers.com/2015/10/21/salesforce-create-short-urls-with-bitly-process-builder-and-apex/
https://gist.github.com/DouglasCAyers/de978590b97e235a96fc

However my test method fails in static void test_shorten() in BitlyShortenURLInvocableTest, where it throws the following error:

System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out
Class.BitlyService.getAccessToken: line 56, column 1
Class.BitlyService.: line 12, column 1
Class.BitlyShortenURLInvocable.shortenAsync: line 25, column 1


I have got a process builder that calls the method shorten of BitlyShortenURLInvocable, on creation/update of Opportunity. My code in test_shorten is given below.
 

    Test.startTest();
    Test.setMock( HttpCalloutMock.class, new MockHttpResponse() );
    
    Opportunity job = new Opportunity();
    job.Name = 'Test Job';
    job.StageName = 'Not yet started';
    job.CloseDate = System.today() ; 
    insert job;
    Test.stopTest();
      
      
    job  = [ SELECT id, Shortened_Url__c FROM Opportunity WHERE id = :job.id LIMIT 1 ];
    
    System.assert( String.isNotBlank( job.Shortened_Url__c ) );
Any help will be much appreciated.

Regards,
Anindya


 

Hi there:

I am really new to this big Salesforce world. One of the requirement for us is to create Salesforce entites remotely from our WordPress site. The only way I can think of right now is to use JavaScript.

Can anyone please tell me how to do it using REST API? I found some documentation on https://github.com/developerforce/Force.com-JavaScript-REST-Toolkit. However I am not sure how to approach here. What values do I need to supply for var clientId , var redirectUri and var proxyUrl? Is there any other way?

Any help will be much appreciated.

Thanks
Anindya
Hi :

We have got a requirement to send SMS and email using Process Builder. Email can easily be achieved by using email template/email alert.
Wondering what's the best way to do that for SMS?

We have got a subscription for Twilio. However as per other posts, it involves writing Apex code to send SMS using Twilio from Salesforce. That is probably possible when you have an interactive form to choose an user and sens SMS. However not sure if that's gonna work from Process Builder. 

Any help will be much appreciated.

Regards,
Anindya

Hi All:

Just wondering whether it is possible at all to deploy changes for Standard Value Set using Force.com IDE.

We have changed the values of Stage in our Opportunity object and trying to deploy that from one Ssandbox to another one. However I am getting the following error:

# Deploy Results:
   File Name:    objects/Opportunity.object
   Full Name:  Opportunity.StageName
   Action:  NO ACTION
   Result:  FAILED
   Problem: To modify a Standard Picklist, use Standard Value Set instead.

   File Name:    objects/Opportunity.object
   Full Name:  Opportunity.Purchase
   Action:  NO ACTION
   Result:  FAILED
   Problem: Picklist value: Order Certificates not found

   File Name:    objects/Opportunity.object
   Full Name:  Opportunity.Sale
   Action:  NO ACTION
   Result:  FAILED
   Problem: Picklist value: Sale not found

Does it mean I have to first create Stage picklist values using Salesforce UI and then deploy the other changes using Force.com Metadata API?

I have seen contradictory info when I googled for it. Any help will be much appreciated.

Regards,
Anindya
 

Hi all:

I am a newbie to Salesforce and gradually getting the hang of it. One thing that I need to make use of soon is Batch Apex

We have got several opportunities on which we need to make calls to third party API to get back some result. This already works for individual Opportunity where we have got a button and with the click of the button, it calls the third party API for that Opportunity.

However we have now got a requirement where we can select several Opportunities together to make calls to third party API and get back the result for each. Batch Apex sounds like a good way to solve this problem. However being new to the Salesforce paltform, wondering what's the best way to achieve this.

Logically the steps are:

1. Select Opportunities which you need to process. May be build a collection of those Opprtunities.
2. Execute Batch Apex with the collection of Opportunities that have been built.

Just wondering what's the technical way to achieve this. In the start method of Batch Apex, I need to build the object scope with the selected Opportunities. How to achieve that?

Also when I am done with writing the Batch Apex class, how do I trigger the following:
Database.executeBatch(new <Class name>(), batch size);

to execute my Batch Apex?

Any help will be much appreciated.

Thanks
Anindya

Hi there:

I have got a developer sandbox and my Force.com IDE is connected to that. Any change to Apex class that I do using the IDE, gets saved in developer sandbox without any problem.

However When I try to 'Deploy to Server', I get the following error:

error in deploy

I am pretty sure the credential is all good as I can save my changes. Is it because we can only deploy to Full/Partial sandbox?

Any help will be much appreciated.

Thanks and regards,
Anindya

Hi All:

I am very new to Salesforce development (just really started this week) and am trying to set up a dev environment for the same.

I have installed Eclipse IDE for Java Developers Version: Mars.2 Release (4.5.2) along with JRE1.8.0_77. I can sign into my Salesforce DEVELOPER EDITION from Eclipse using Force Perspective. However on the 'Choose Initial Project Content' page, I can't see anything. It is completely empty. A screenshot is given below:

Empty Project Content

Just wondering if I can get some help. The tutorial I am trying to do is a basic one as follows:

https://developer.salesforce.com/docs/atlas.en-us.eclipse.meta/eclipse/eclipse_quickstart.htm

Any help will be much appreciated.

Thanks and regards,
Anindya



 
Hi there:

I am very new to the concept of Salesforce Community and Salesforce overall. But getting used to it gradually.

I have got a Partner Community Portal where self-sign is enabled. Everything works well -
  • users can sign up
  • users get assigned to a business account as contact
  • users get assigned to Partner Community User profile (which has got Partner Community license)
  • users can sign in and see the following as landing page.
landing page
Strange enough users can't see the Home tab and the Lead Home acts as the landing page !! However users can navigate to Default Home using the following explicit URL: /home/home.jsp

home page

Any help will be much appreciated. For the profile Partner Community User, I have got Standard Tab of Home as Default On.

Thanks and regards,
Anindya

Hi All:

I am trying to implement Bitly with a custom field in Opportunity. I am successful in getting the Bitly Url for the Opportunity field. However I am having trouble in getting test cases set up for the same. I followed the following article:

https://douglascayers.com/2015/10/21/salesforce-create-short-urls-with-bitly-process-builder-and-apex/
https://gist.github.com/DouglasCAyers/de978590b97e235a96fc

However my test method fails in static void test_shorten() in BitlyShortenURLInvocableTest, where it throws the following error:

System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out
Class.BitlyService.getAccessToken: line 56, column 1
Class.BitlyService.: line 12, column 1
Class.BitlyShortenURLInvocable.shortenAsync: line 25, column 1


I have got a process builder that calls the method shorten of BitlyShortenURLInvocable, on creation/update of Opportunity. My code in test_shorten is given below.
 

    Test.startTest();
    Test.setMock( HttpCalloutMock.class, new MockHttpResponse() );
    
    Opportunity job = new Opportunity();
    job.Name = 'Test Job';
    job.StageName = 'Not yet started';
    job.CloseDate = System.today() ; 
    insert job;
    Test.stopTest();
      
      
    job  = [ SELECT id, Shortened_Url__c FROM Opportunity WHERE id = :job.id LIMIT 1 ];
    
    System.assert( String.isNotBlank( job.Shortened_Url__c ) );
Any help will be much appreciated.

Regards,
Anindya


 

Hi there:

I am really new to this big Salesforce world. One of the requirement for us is to create Salesforce entites remotely from our WordPress site. The only way I can think of right now is to use JavaScript.

Can anyone please tell me how to do it using REST API? I found some documentation on https://github.com/developerforce/Force.com-JavaScript-REST-Toolkit. However I am not sure how to approach here. What values do I need to supply for var clientId , var redirectUri and var proxyUrl? Is there any other way?

Any help will be much appreciated.

Thanks
Anindya
Hi :

We have got a requirement to send SMS and email using Process Builder. Email can easily be achieved by using email template/email alert.
Wondering what's the best way to do that for SMS?

We have got a subscription for Twilio. However as per other posts, it involves writing Apex code to send SMS using Twilio from Salesforce. That is probably possible when you have an interactive form to choose an user and sens SMS. However not sure if that's gonna work from Process Builder. 

Any help will be much appreciated.

Regards,
Anindya

Hi All:

Just wondering whether it is possible at all to deploy changes for Standard Value Set using Force.com IDE.

We have changed the values of Stage in our Opportunity object and trying to deploy that from one Ssandbox to another one. However I am getting the following error:

# Deploy Results:
   File Name:    objects/Opportunity.object
   Full Name:  Opportunity.StageName
   Action:  NO ACTION
   Result:  FAILED
   Problem: To modify a Standard Picklist, use Standard Value Set instead.

   File Name:    objects/Opportunity.object
   Full Name:  Opportunity.Purchase
   Action:  NO ACTION
   Result:  FAILED
   Problem: Picklist value: Order Certificates not found

   File Name:    objects/Opportunity.object
   Full Name:  Opportunity.Sale
   Action:  NO ACTION
   Result:  FAILED
   Problem: Picklist value: Sale not found

Does it mean I have to first create Stage picklist values using Salesforce UI and then deploy the other changes using Force.com Metadata API?

I have seen contradictory info when I googled for it. Any help will be much appreciated.

Regards,
Anindya
 

Hi all:

I am a newbie to Salesforce and gradually getting the hang of it. One thing that I need to make use of soon is Batch Apex

We have got several opportunities on which we need to make calls to third party API to get back some result. This already works for individual Opportunity where we have got a button and with the click of the button, it calls the third party API for that Opportunity.

However we have now got a requirement where we can select several Opportunities together to make calls to third party API and get back the result for each. Batch Apex sounds like a good way to solve this problem. However being new to the Salesforce paltform, wondering what's the best way to achieve this.

Logically the steps are:

1. Select Opportunities which you need to process. May be build a collection of those Opprtunities.
2. Execute Batch Apex with the collection of Opportunities that have been built.

Just wondering what's the technical way to achieve this. In the start method of Batch Apex, I need to build the object scope with the selected Opportunities. How to achieve that?

Also when I am done with writing the Batch Apex class, how do I trigger the following:
Database.executeBatch(new <Class name>(), batch size);

to execute my Batch Apex?

Any help will be much appreciated.

Thanks
Anindya

Hi there:

I have got a developer sandbox and my Force.com IDE is connected to that. Any change to Apex class that I do using the IDE, gets saved in developer sandbox without any problem.

However When I try to 'Deploy to Server', I get the following error:

error in deploy

I am pretty sure the credential is all good as I can save my changes. Is it because we can only deploy to Full/Partial sandbox?

Any help will be much appreciated.

Thanks and regards,
Anindya

Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details. Error ID: 969321508-14233 (357396811).

Above is the error i am getting when i am trying to activate the process in process builder.
Below is the screenshot of my process in process builder.

User-added image

I dont know what is wrong with it. Please Help.

Thanks
  • December 13, 2016
  • Like
  • 0
Hi All:

I am very new to Salesforce development (just really started this week) and am trying to set up a dev environment for the same.

I have installed Eclipse IDE for Java Developers Version: Mars.2 Release (4.5.2) along with JRE1.8.0_77. I can sign into my Salesforce DEVELOPER EDITION from Eclipse using Force Perspective. However on the 'Choose Initial Project Content' page, I can't see anything. It is completely empty. A screenshot is given below:

Empty Project Content

Just wondering if I can get some help. The tutorial I am trying to do is a basic one as follows:

https://developer.salesforce.com/docs/atlas.en-us.eclipse.meta/eclipse/eclipse_quickstart.htm

Any help will be much appreciated.

Thanks and regards,
Anindya



 
I have install the "twilio" api in salesforce and I have register twilio phone number. How to receive the SMS details and how revert back the conformation.Which class should be call and where should I give the accoutsid,authosid and twilio phone number in Installed Package from Sandbox .