When is the AccountId field not available as a merge field for JS buttons












3















May be a basic question but I could not find specific documentation and I need to find out all objects where:



The accountid field is NOT available as a merge field is a javascript button.



In these cases one would have to use {!Account.Id}.



The two that I know of so far where it is NOT allowed are (although it is available via SOQL and describe):




  1. Contact

  2. Order


It IS allowed on the opportunity though.



Bonus Is there a way to programatically tell in the describe information if the field is not available for a JS merge field and needs to be transformed to Account.Id



Also any links to documentation would be helpful.










share|improve this question





























    3















    May be a basic question but I could not find specific documentation and I need to find out all objects where:



    The accountid field is NOT available as a merge field is a javascript button.



    In these cases one would have to use {!Account.Id}.



    The two that I know of so far where it is NOT allowed are (although it is available via SOQL and describe):




    1. Contact

    2. Order


    It IS allowed on the opportunity though.



    Bonus Is there a way to programatically tell in the describe information if the field is not available for a JS merge field and needs to be transformed to Account.Id



    Also any links to documentation would be helpful.










    share|improve this question



























      3












      3








      3








      May be a basic question but I could not find specific documentation and I need to find out all objects where:



      The accountid field is NOT available as a merge field is a javascript button.



      In these cases one would have to use {!Account.Id}.



      The two that I know of so far where it is NOT allowed are (although it is available via SOQL and describe):




      1. Contact

      2. Order


      It IS allowed on the opportunity though.



      Bonus Is there a way to programatically tell in the describe information if the field is not available for a JS merge field and needs to be transformed to Account.Id



      Also any links to documentation would be helpful.










      share|improve this question
















      May be a basic question but I could not find specific documentation and I need to find out all objects where:



      The accountid field is NOT available as a merge field is a javascript button.



      In these cases one would have to use {!Account.Id}.



      The two that I know of so far where it is NOT allowed are (although it is available via SOQL and describe):




      1. Contact

      2. Order


      It IS allowed on the opportunity though.



      Bonus Is there a way to programatically tell in the describe information if the field is not available for a JS merge field and needs to be transformed to Account.Id



      Also any links to documentation would be helpful.







      custom-button describefieldresult






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 49 mins ago







      Eric

















      asked 2 hours ago









      EricEric

      44.9k750120




      44.9k750120






















          1 Answer
          1






          active

          oldest

          votes


















          3















          May be a basic question but I could not find specific documentation
          and I need to find out all objects where:



          The accountid field is NOT available as a merge field is a javascript
          button.




          Task, Event, Quote, Contact, and Order.




          Bonus Is there a way to programatically tell in the describe
          information if the field is not available for a JS merge field and
          needs to be transformed to Account.Id




          No. They describe like any other field, and don't have any special flags that indicate anything's different.




          Also any links to documentation would be helpful.




          I agree. However, as far as I can tell, there is not, and never has been. If it did exist, I have not found it. I believe it has to do with a limitation in the merge syntax for URLs. Unlike newer technology in Salesforce, you can't go across relationship names, so salesforce.com implemented a bunch of convenience fields.



          For example, you can't say {!Case.Account.Name} because of the no-relationship rule, but instead Salesforce allows you to write {!Account.Name}. You'll also notice other oddities, like instead of {!Case.Owner.FirstName} you can write {!Case.OwnerFirstName}. Unfortunately, the best I can say is that you have to use the UI to know for certain if a field will be recognized.






          share|improve this answer


























          • AccountId works on case. Thanks for the Event and Task.

            – Eric
            55 mins ago











          • @Eric Oh, I just assumed you'd checked it. I'll amend that then. It's a very small list of magic fields.

            – sfdcfox
            51 mins ago











          • Ahh, mistype in my question, it should be contact not case. I'll fix it. Glad to know it is a small list. One of those things you just need to be aware of I guess.

            – Eric
            49 mins ago













          • @Eric I knew it was one of those "C" objects, at any rate. Hopefully no more of them will appear (I checked WorkOrder, thinking it might not have it, but it does), so that should be the entire list.

            – sfdcfox
            42 mins ago











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "459"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f248435%2fwhen-is-the-accountid-field-not-available-as-a-merge-field-for-js-buttons%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3















          May be a basic question but I could not find specific documentation
          and I need to find out all objects where:



          The accountid field is NOT available as a merge field is a javascript
          button.




          Task, Event, Quote, Contact, and Order.




          Bonus Is there a way to programatically tell in the describe
          information if the field is not available for a JS merge field and
          needs to be transformed to Account.Id




          No. They describe like any other field, and don't have any special flags that indicate anything's different.




          Also any links to documentation would be helpful.




          I agree. However, as far as I can tell, there is not, and never has been. If it did exist, I have not found it. I believe it has to do with a limitation in the merge syntax for URLs. Unlike newer technology in Salesforce, you can't go across relationship names, so salesforce.com implemented a bunch of convenience fields.



          For example, you can't say {!Case.Account.Name} because of the no-relationship rule, but instead Salesforce allows you to write {!Account.Name}. You'll also notice other oddities, like instead of {!Case.Owner.FirstName} you can write {!Case.OwnerFirstName}. Unfortunately, the best I can say is that you have to use the UI to know for certain if a field will be recognized.






          share|improve this answer


























          • AccountId works on case. Thanks for the Event and Task.

            – Eric
            55 mins ago











          • @Eric Oh, I just assumed you'd checked it. I'll amend that then. It's a very small list of magic fields.

            – sfdcfox
            51 mins ago











          • Ahh, mistype in my question, it should be contact not case. I'll fix it. Glad to know it is a small list. One of those things you just need to be aware of I guess.

            – Eric
            49 mins ago













          • @Eric I knew it was one of those "C" objects, at any rate. Hopefully no more of them will appear (I checked WorkOrder, thinking it might not have it, but it does), so that should be the entire list.

            – sfdcfox
            42 mins ago
















          3















          May be a basic question but I could not find specific documentation
          and I need to find out all objects where:



          The accountid field is NOT available as a merge field is a javascript
          button.




          Task, Event, Quote, Contact, and Order.




          Bonus Is there a way to programatically tell in the describe
          information if the field is not available for a JS merge field and
          needs to be transformed to Account.Id




          No. They describe like any other field, and don't have any special flags that indicate anything's different.




          Also any links to documentation would be helpful.




          I agree. However, as far as I can tell, there is not, and never has been. If it did exist, I have not found it. I believe it has to do with a limitation in the merge syntax for URLs. Unlike newer technology in Salesforce, you can't go across relationship names, so salesforce.com implemented a bunch of convenience fields.



          For example, you can't say {!Case.Account.Name} because of the no-relationship rule, but instead Salesforce allows you to write {!Account.Name}. You'll also notice other oddities, like instead of {!Case.Owner.FirstName} you can write {!Case.OwnerFirstName}. Unfortunately, the best I can say is that you have to use the UI to know for certain if a field will be recognized.






          share|improve this answer


























          • AccountId works on case. Thanks for the Event and Task.

            – Eric
            55 mins ago











          • @Eric Oh, I just assumed you'd checked it. I'll amend that then. It's a very small list of magic fields.

            – sfdcfox
            51 mins ago











          • Ahh, mistype in my question, it should be contact not case. I'll fix it. Glad to know it is a small list. One of those things you just need to be aware of I guess.

            – Eric
            49 mins ago













          • @Eric I knew it was one of those "C" objects, at any rate. Hopefully no more of them will appear (I checked WorkOrder, thinking it might not have it, but it does), so that should be the entire list.

            – sfdcfox
            42 mins ago














          3












          3








          3








          May be a basic question but I could not find specific documentation
          and I need to find out all objects where:



          The accountid field is NOT available as a merge field is a javascript
          button.




          Task, Event, Quote, Contact, and Order.




          Bonus Is there a way to programatically tell in the describe
          information if the field is not available for a JS merge field and
          needs to be transformed to Account.Id




          No. They describe like any other field, and don't have any special flags that indicate anything's different.




          Also any links to documentation would be helpful.




          I agree. However, as far as I can tell, there is not, and never has been. If it did exist, I have not found it. I believe it has to do with a limitation in the merge syntax for URLs. Unlike newer technology in Salesforce, you can't go across relationship names, so salesforce.com implemented a bunch of convenience fields.



          For example, you can't say {!Case.Account.Name} because of the no-relationship rule, but instead Salesforce allows you to write {!Account.Name}. You'll also notice other oddities, like instead of {!Case.Owner.FirstName} you can write {!Case.OwnerFirstName}. Unfortunately, the best I can say is that you have to use the UI to know for certain if a field will be recognized.






          share|improve this answer
















          May be a basic question but I could not find specific documentation
          and I need to find out all objects where:



          The accountid field is NOT available as a merge field is a javascript
          button.




          Task, Event, Quote, Contact, and Order.




          Bonus Is there a way to programatically tell in the describe
          information if the field is not available for a JS merge field and
          needs to be transformed to Account.Id




          No. They describe like any other field, and don't have any special flags that indicate anything's different.




          Also any links to documentation would be helpful.




          I agree. However, as far as I can tell, there is not, and never has been. If it did exist, I have not found it. I believe it has to do with a limitation in the merge syntax for URLs. Unlike newer technology in Salesforce, you can't go across relationship names, so salesforce.com implemented a bunch of convenience fields.



          For example, you can't say {!Case.Account.Name} because of the no-relationship rule, but instead Salesforce allows you to write {!Account.Name}. You'll also notice other oddities, like instead of {!Case.Owner.FirstName} you can write {!Case.OwnerFirstName}. Unfortunately, the best I can say is that you have to use the UI to know for certain if a field will be recognized.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 43 mins ago

























          answered 59 mins ago









          sfdcfoxsfdcfox

          252k11194433




          252k11194433













          • AccountId works on case. Thanks for the Event and Task.

            – Eric
            55 mins ago











          • @Eric Oh, I just assumed you'd checked it. I'll amend that then. It's a very small list of magic fields.

            – sfdcfox
            51 mins ago











          • Ahh, mistype in my question, it should be contact not case. I'll fix it. Glad to know it is a small list. One of those things you just need to be aware of I guess.

            – Eric
            49 mins ago













          • @Eric I knew it was one of those "C" objects, at any rate. Hopefully no more of them will appear (I checked WorkOrder, thinking it might not have it, but it does), so that should be the entire list.

            – sfdcfox
            42 mins ago



















          • AccountId works on case. Thanks for the Event and Task.

            – Eric
            55 mins ago











          • @Eric Oh, I just assumed you'd checked it. I'll amend that then. It's a very small list of magic fields.

            – sfdcfox
            51 mins ago











          • Ahh, mistype in my question, it should be contact not case. I'll fix it. Glad to know it is a small list. One of those things you just need to be aware of I guess.

            – Eric
            49 mins ago













          • @Eric I knew it was one of those "C" objects, at any rate. Hopefully no more of them will appear (I checked WorkOrder, thinking it might not have it, but it does), so that should be the entire list.

            – sfdcfox
            42 mins ago

















          AccountId works on case. Thanks for the Event and Task.

          – Eric
          55 mins ago





          AccountId works on case. Thanks for the Event and Task.

          – Eric
          55 mins ago













          @Eric Oh, I just assumed you'd checked it. I'll amend that then. It's a very small list of magic fields.

          – sfdcfox
          51 mins ago





          @Eric Oh, I just assumed you'd checked it. I'll amend that then. It's a very small list of magic fields.

          – sfdcfox
          51 mins ago













          Ahh, mistype in my question, it should be contact not case. I'll fix it. Glad to know it is a small list. One of those things you just need to be aware of I guess.

          – Eric
          49 mins ago







          Ahh, mistype in my question, it should be contact not case. I'll fix it. Glad to know it is a small list. One of those things you just need to be aware of I guess.

          – Eric
          49 mins ago















          @Eric I knew it was one of those "C" objects, at any rate. Hopefully no more of them will appear (I checked WorkOrder, thinking it might not have it, but it does), so that should be the entire list.

          – sfdcfox
          42 mins ago





          @Eric I knew it was one of those "C" objects, at any rate. Hopefully no more of them will appear (I checked WorkOrder, thinking it might not have it, but it does), so that should be the entire list.

          – sfdcfox
          42 mins ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Salesforce Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f248435%2fwhen-is-the-accountid-field-not-available-as-a-merge-field-for-js-buttons%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

          Calculate evaluation metrics using cross_val_predict sklearn

          Insert data from modal to MySQL (multiple modal on website)