• staging server
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies

I have this query:

SELECT Account.Id, Account.Name, Account.Industry, Account.Sales_Abteilung__c, Id, Owner.Name, CloseDate, StageName, Type, TotalOpportunityQuantity, Amount, Einzelpreis__c, Owner.UserRole.Name, Angebotsnr__c FROM Opportunity

And for the column 'Owner.UserRole.Name' the query returns [object Object]

I found this Stack Exchange question:

https://salesforce.stackexchange.com/questions/41833/owner-userrole-name-is-not-accessible

where one of the comments suggest this could be a bug in the developer's console? I am pretty sure I am calling the object reference correctly - according to other questions on Salesforce forums I've seen. 

Hello, I have implemented a web-to-lead on a form on my client's website via an AJAX request and the name and email fields are getting generated correctly in Salesforce, but the custom field I've implemented is not. 

This is the html code:
<input type="hidden" name="00Nw00000090NEa" value="{{reference.salesforce_title | strip_html}}" id="00Nw00000090NEa">
This is my javascript:
$(document).ready(function() {
  $('#js-case-study-submit').on("click", function(e){
     e.preventDefault();

    var firstName = $('#case-study-form').find('#first_name').val();
    var lastName = $('#case-study-form').find('#name').val();
    var email = $('#case-study-form').find('#email').val();
    var caseStudyName = $('#case-study-form').find('#00Nw00000090NEa').val();

    var formData = {};
    formData.first_name = firstName
    formData.last_name = lastName
    formData.email = email
    formData.oid = "00Dw0000000mDvD"
    formData.case_study_name = caseStudyName

    $.ajax({
      type: "POST",
      url: "https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8",
      data: formData
    });
    $('#case-study-form').submit();
  });
});

And I can see that the values are getting passed correctly to the field, when I click on edit, they are there in the dropdown, but I do not know why I cannot display these values. See screenshot:

User-added image

 

Thank you!!