+ Start a Discussion
Charlotte Gibson 10Charlotte Gibson 10 
Hi all,

We're thinking about activating Dev Hub in our production org, but I see that once it's been enabled, it can't be disabled. Is there any downside to enabling Dev Hub? Will we still have access to our old sandbox system? There's a lot of in-flight development in the current sandboxes and we don't want to change the way we work yet, we just want to explore Dev Hub and see it working in a practical environment.

Is there anything else we might need to bear in mind when activating Dev Hub? The documentation is a bit patchy on this subject.

Thanks!
Best Answer chosen by Charlotte Gibson 10
Ashish KumarAshish Kumar
Hi Denys,

Since By documentation, Salesforce claims that 
Enabling Dev Hub in a production or business org is completely safe and won’t cause any performance or customer issues. The Dev Hub is comprised of objects with permissions that allow admins to control the level of access available to a user and an org.

But Dev Hub is still in Beta Version. So now the question or let me say the solution is knowing how far you want to go with this. 
If you really want to give it a try in your sandboxes you should go ahead with that. There are no side effects of enabling Dev Hub but you can give it a lil bit more time untill things get settled down to stable releases as there could be more enhancements / modifications down the line, Untill then you can try out the trail period versions to go with the complex situations.

At last "It is your call, If you really want to try it in sandbox then you must Go Ahead There is completely no harm in that."

Best Regards,
Ashish Kr.
crop1645crop1645 

Problem statement:

 

When APEX inserting OpportunityShare records, you get DML Exception: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY

 

Why does this happen?

 

The obvious reasons are:

 

  • OpportunityShare.OpportunityId is for an invalid Opportunity (or not an opportunity at all)
  • Running user doesn't have access to the Opportunity in OpportunityId



But if neither of these are the case...what else could it be?

 

ANSWER:

 

You can not insert OpportunityShare records for the current owner of the record.  You'll need to modify the Apex code to see if the current owner is the same as OpportunityShare.UserOrGroupId.  If it is, then don't insert.  You can still create OpportunityTeamMember records for that user but not OpportunityShare.  Who the current user is will depend if you are doing the OpportunityShare Dml statement in a before trigger, after trigger, VF controller, or API.

 

Although I haven't tested this, I presume the above applies to AccountShare and CaseShare objects as well.

Best Answer chosen by Admin (Salesforce Developers) 
crop1645crop1645
post to mark as Solved
Brock NortonBrock Norton 
I keep getting the following error when trying to check my challenge on "Routing Records with Approvals" on Admin Trail - Intermediate.

Challenge not yet complete... here's what's wrong: 
The process did not set the correct Type value on submitting for approval

User-added image

I'm not sure why it isn't approving.  Please help!

User-added image
User-added image
User-added image
User-added image




 
Best Answer chosen by Brock Norton
Himanshu ParasharHimanshu Parashar
Hi Brock,

Here is mine version of that Approval process which worked perfectly.

User-added image

You will notice that in Approval steps I don't have any rejection step which is marked as red bold in your Approval process. remove that criteria and it should work.


Thanks,
Himanshu
Tien Le 488Tien Le 488 
Hi,

I'm trying to complete the trailhead "" and encountering a challenge.  If anyone has any feedback for me on this, I'd appreciate very much.  

Added VerifyDate.apxc as I did with TemperatureConverter.apxc.  Added TestVerifyDate.apxc (even with VerifyDateTest.apxc) as I did with TemperatureConverterTest.apxc.  I verified that those classes exist per screenshot1 below:
User-added image

I'm supposed to be able to go to Test, select New Run, then with Select Tests pop-up, I'm supposed to see the TestVerifyDate (and/or VerifyDateTest) classes to select and run; however, I'm not seeing those test classes.  Why?  Even with "[All Namespaces]", they still don't show.  

Workaround for now is to run the test suite per instructions earlier in the trailhead.  

Reference screenshot2 below:
User-added image

Thanks in advance for your help.
Tien





 
Best Answer chosen by Tien Le 488
Tien Le 488Tien Le 488
User-added image
Emma BindiEmma Bindi 
When parsing WSDL file into Apex we needed to change the header item (user/password) into complex type for Salesforce to accept it. 

Now unfortunately, the Apex class is sending the complex type information whereas the external system is expecting a string only. 

Ie, External System format requires:
<soapenv:Header>
 <web:SessionType>none</web:SessionType>
 <web:PasswordText>topsecret</web:PasswordText>
 <web:UsernameToken>BROKER</web:UsernameToken>
 </soapenv:Header>
However Salesforce is sending: 
<env:Header>
        <PasswordText
            xmlns="http://siebel.com/webservices">
            <inputParam>topsecret</inputParam>
        </PasswordText>
        <SessionType
            xmlns="http://siebel.com/webservices">
            <inputParam>none</inputParam>
        </SessionType>
        <UsernameToken
            xmlns="http://siebel.com/webservices">
            <inputParam>BROKER</inputParam>
        </UsernameToken>
    </env:Header>

This is what WSDL2Apex generated:
//Generated by wsdl2apex

public class AFGFlexWebservices {
    public class SessionType_element {
        public String inputParam;
        private String[] inputParam_type_info = new String[]{'inputParam','http://siebel.com/webservices',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://siebel.com/webservices','true','false'};
        private String[] field_order_type_info = new String[]{'inputParam'};
    }
    public class PasswordText_element {
        public String inputParam;
        private String[] inputParam_type_info = new String[]{'inputParam','http://siebel.com/webservices',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://siebel.com/webservices','true','false'};
        private String[] field_order_type_info = new String[]{'inputParam'};
    }
    public class UsernameToken_element {
        public String inputParam;
        private String[] inputParam_type_info = new String[]{'inputParam','http://siebel.com/webservices',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://siebel.com/webservices','true','false'};
        private String[] field_order_type_info = new String[]{'inputParam'};
    }
}

Does anyone have any ideas how I can instead send through just a string  for each header item rather than all the extra details? 
Best Answer chosen by Emma Bindi
Emma BindiEmma Bindi
So! Resolution:
For those who encounter same issue, we went with the Plan B using a REST post callout with manually created XML request body to resolve this. (only had a couple fields to send/receive from external system)
Tips, SOAPaction was required in the headers along with text/xml content type. Then parsed response with Document & XML classes 
Jiahao Zheng 33Jiahao Zheng 33 
Hi Trailblazers, I have a custom field called CNO/RNO__c on the standard Account object and I want to customize this CNO/RNO__c field to auto generate 6 digit number wheneven a new Account object is created. Is it possible to do it using Formula? Or we need to apply Apex code here? 
 
Best Answer chosen by Jiahao Zheng 33
VinayVinay (Salesforce Developers) 
You can create account record not an account object.  You can generate random number once you set the start value.  Eg. Salesforce-0001,  Salesforce-0002 etc based on your prefix or only number.

User-added image

Let me know if you have any additional questions

Please mark as Best Answer if above information was helpful so that it can help others in the future.

Thanks,
Hemant Gothwal 1Hemant Gothwal 1 
My issue seems to be very strange. I have created this process and when I test it, it is updating the sales price to deposit amount as said in the requirement. But when the chellenge is checked it gives me error message:
Challenge Not yet complete... here's what's wrong: 
The Fulfillment Cancellation Automation process does not appear to be working properly. Make sure that a cancelled Fulfillment updates the Adventure Package correctly.


Chose the fullfillment object
have proper conditions:
User-added image

and update the adventure package
User-added image

I tested it and it seems to be updating the sales price to the diposit amount correctly:
User-added image

but still on checking Chellenge I get the error:
User-added image

completedly stumped!!! please let me know if anybody faced the same issue. any help.
 
Best Answer chosen by Hemant Gothwal 1
NagendraNagendra (Salesforce Developers) 
Hi Hemant Gothwal,

Please doble check the steps. Especially Field Update Filter condition : 
Line Item ID  equals Formula [FullFillment__c].AdventurePackageId__c.

Also check debug logs when you check the challenge.
Refer this post to check what the trialhead doing to test our work in background :
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000kIudIAE

So you can check where their test is failing.

Please make sure to mark this post as solved if it helps you.

Best Regards,
Nagendra.P
Travis Lee 1Travis Lee 1 
When checking this challenge, I get an error stating that the quickContact Lightning Component could not be found. Including screenshots of the steps I took thus far. Any advice would be appreciated!

1. The Lightning component must be named quickContact (this comes as part of the package, confirmed in picture below)
User-added image

2. Create a new action with Label Quick Contact and Name Quick_Contact on the Account object that invokes the quickContact component. (confirmed in picture below)
User-added image
3. Add the appropriate interfaces to the quickContact component. (Hint: there are two.) (used the implements force:lightningquickaction AND the force:hasrecordid on line 1, confirmed in picture below)
User-added image

4. Add the action to the Account Layout page layout. (added in picture below)
User-added image
Best Answer chosen by Travis Lee 1
SandhyaSandhya (Salesforce Developers) 
Hi,

Please check if you have connected to same DE org where you have done  your work in the trailhead.To do this click on" launch your hands on  org" and select the DE org or trailhead playground where you have your work and then check challenge.

 OR

Go to Trailhead Profile -- settings -- make the DE org which you have worked as default then check the challenge.

Please refer below link how to take challenges in trailhead.

https://force.desk.com/customer/portal/articles/2643793-trailhead-profile-signup-login-faq?b_id=13478

Hope this helps you!

Please mark it as Best Answer if my reply was helpful. It will make it available for other as the proper solution.
 
Thanks and Regards
Sandhya

 
Nihar ANihar A 
If something goes wrong in lightning component and I go back to component bundle and mofidy the logic there and save and comeback to browser and refresh the page and execute the component , But the component is sometimes displaying the same old logic. Is it because the Javascript handler code is being cached in browser or any other reason. I am able to look at the new logic in browser after making three or four refreshes.
Best Answer chosen by Nihar A
Nihar ANihar A
Hello Everyone,

This workaround/ setting fixed the Issue.

1. Go to Setup.
2. Under "Administration Setup", go to Security Controls -> Session Settings.
3. Disable the "Enable secure and persistent browser caching to improve performance" option under Caching section and click on Save. 

Thanks,
Nihar.
Roman RauerRoman Rauer 
Hi there :)

i'm currently working on an native Android app for my company and ran into some problems with Salesforce lately.

I hope i can find some help here.

What i want to achieve:
The company has a lot of Accounts in Salesforce with 3 important fields for the app: Name, Business (Workshop or Parts Dealer) and location(latitude, longitude)
I would like to show those Accounts(Workshops/Parts Dealers) as markers on a google map in my Android app based on a radius around the user's current location. So it would be more than sufficient to get the data as JSON or XML(i read about sObjects, which would be nice too)

The app will be freely available on Google Play Store and every user should be able to see all the Workshops/Parts dealers around the world.

The problem i'm facing is that i can't find a way to fetch the data inside my app without authenticating every user with a Salesforce-Login. 
Which API is the best to use in this case?

It would be so awsome if anybody could help me with this problem.

What i tried so far: 
- SalesforceMobileSDK: If i extend SalesForceApplication i always end up with the Salesforce-Login Screen.
It seems that every client has to be authenticated for API-calls to work. I tried using the method "peekUnauthenticatedRestClient", but this method only works on full path URL's(e.g. "https://api.spotify.com/v1/search?q=James%20Brown&type=artist"), which isn't really practically for my Use-case.

- I feel like i read nearly all docs about salesforce api, but can't quite get my head around how to solve this problem, although it seems like to be a pretty common use-case.  

- would a salesforce-apex method which would select all records inside a set radius around the user's location be accessable without authentication?

Thanks for your help in advance!

Roman
Best Answer chosen by Roman Rauer
Santosh Bompally 8Santosh Bompally 8
Follow this -> 
1) Write a Restservice to expose your data. 
@RestResource(urlMapping='/Account')
global with sharing class MyRestResource {

 
    @HttpGet
    global static List<Account> doGet() {
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
       List< Account>  result = [SELECT Id, Name, Business,Location FROM Account ];
        return result;
    }
  
}

2)  Create a Community and provide access to apex class and account object to the Guest user profile. 
    Samplecommunity url -> https://somedomain.cs16.force.com/communityname

3) Go to workbench and test your API using rest explorer 
    relative url ->  /services/apexrest/Account
4) Your public url will now be   https://somedomain.cs16.force.com/communityname/services/apexrest/Account 

Mark as Best Answer if it helps. 

Thanks, 
Santosh