Wednesday 2 November 2016

Getting Custom Field Id without hardcoding through Tooling API (Without Http Callout also)

Hi,

We can get custom field ids for URL hacking to auto populate through Tooling API as shown below.

Apex Code:

List<FieldDefinition> fieldList =  [SELECT DurableId,QualifiedApiName FROM FieldDefinition WHERE EntityDefinition.QualifiedApiName ='Account'and QualifiedApiName='NoofEmployees__c'];
String NoofEmployeesId = fieldList[0].DurableId.split('\\.')[1];

Visualforce Page (Java Script):

<script type="text/javascript">
            var __sfdcSessionId = '{!GETSESSIONID()}';
</script>
<script src="../../soap/ajax/38.0/connection.js" type="text/javascript"></script>
<script>
var qr = sforce.connection.query("SELECT DurableId,QualifiedApiName FROM FieldDefinition WHERE EntityDefinition.QualifiedApiName ='Account'and QualifiedApiName='NoofEmployees__c'" );
              var NoofEmployeesId = qr.getArray("records")[0].DurableId.split('.')[1];
 </script>


23 comments:

  1. I am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work..

    Salesforce training in chennai

    ReplyDelete
    Replies
    1. Great Article android based projects

      Java Training in Chennai

      Project Center in Chennai

      Java Training in Chennai

      projects for cse

      The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

      Delete
  2. excellent guide its much useful for my students career keep share more things about Salesforce for us. thanks for shared your post. keep it up.
    salesforce training in chennai

    ReplyDelete
  3. can you suggest me the latest technical ideas for custom field id with API tools

    Salesforce Training in Chennai

    ReplyDelete
  4. Nice information about Salesforce Online Training.

    ReplyDelete
  5. Excellent post!!! In this competitive market, customer relationship management plays a significant role in determining a business success. That too, cloud based CRM product offer more flexibility to business owners to main strong relationship with the consumers.

    salesforce training in Chennai

    ReplyDelete
  6. This blog explains the details of most popular technological details. This helps to learn about what are all the different method is there. And the working methods all of that are explained here. Informative blog.
    SAT Training Centre in Chennai

    ReplyDelete
  7. Thanks for sharing a good information about salesforce . .......This article is very useful to learners. Sales force online training

    ReplyDelete
  8. The article provided by you is very nice and it is very helpful to know the more information.keep update with your blogs .I found a article related to you..once you can check it out
    SalesForce online training

    ReplyDelete
  9. Found useful article on what i was aeasearch for saleforce online training

    ReplyDelete
  10. Fantastic work! This is the type of information that should follow collective approximately the web. Embarrassment captivating position Google for not positioning this transmit higher! Enlarge taking place greater than and visit my web situate
    Data Science Training in Indira nagar
    Data Science training in marathahalli
    Data Science Interview questions and answers
    Data Science training in btm layout | Data Science Training in Bangalore
    Data Science Training in BTM Layout | Data Science training in Bangalore
    Data science training in kalyan nagar




    ReplyDelete
  11. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.

    rpa training in chennai |best rpa training in chennai|
    rpa training in bangalore | best rpa training in bangalore

    ReplyDelete


  12. Thanks for sharing the information. It is very useful for my future. keep sharing
    travel trekking tips
    see the link Tent Camping 101 Exploring Smithriver



    ReplyDelete
  13. Attend The Python training in bangalore From ExcelR. Practical Python training in bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Python training in bangalore.
    python training in bangalore

    ReplyDelete
  14. Amazing Article ! I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple Linear Regression
    data science interview questions
    KNN Algorithm
    Logistic Regression explained

    ReplyDelete
  15. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.data science courses

    ReplyDelete
  16. This blog is very interesting. I learned so much and want to thank you for sharing it in the first place. It is really helpful for my future endeavors. Thanks for your efforts and making it available to public
    Java training in chennai

    python training in chennai

    web designing and development training course in chennai

    selenium training in chennai

    digital-marketing seo training in chennai

    ReplyDelete
  17. This blog is very interesting. I learned so much and want to thank you for sharing it in the first place. It is really helpful for my future endeavors. Thanks for your efforts and making it available to public
    IELTS Coaching in chennai

    German Classes in Chennai

    GRE Coaching Classes in Chennai

    TOEFL Coaching in Chennai

    Spoken english classes in chennai | Communication training

    ReplyDelete

How to include a screen flow in a Lightning Web Component

 Hi, Assume  you have a flow called "Quick Contact Creation" and API Name for the same is "Quick_Contact_Creation". To i...