• m_a_sridhar
  • NEWBIE
  • 5 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 6
    Replies
Hi all,

Is there supposed to be the ability to page through all the questions in this forum? When I access the forum at this URL https://developer.salesforce.com/forums/#!/feedtype=RECENT&dc=General_Development&criteria=ALLQUESTIONS in either Firefox or Google Chrome, I only see about 20 questions, and there doesn't seem to be a paging ribbon or any other way to page through all the questions in a particular topic. I hope I am missing something obvious!

Thanks,
Sridhar
 
Hello,

We have an AppExchange app (apsona) that relies heavily on the JavaScript "save as" functionality using blobs (see this StackOverflow article, for example). Our users make heavy use of this functionality with the current Salesforce Classic interface. With the new Lightning pages, though, attempting to use the save-as functionality produces this popup under Firefox:

User-added image

It looks like this is because of a Content Security Policy header that forbids blob: URLs within embedded pages, so it completely breaks this functionality. This is scary, because there is no replacement technique (that I know of) that provides as responsive a user experience. I'd greatly appreciate any feedback.

Thanks in advance.
Sridhar
 

I'm trying to create a report via a single SOQL query from which I can retrieve fields from a parent object and two or more child objects. For example, suppose I want a report that gets me the account name, the number of assets attached to that account, the number of contacts for that account and the number of opportunities for that account. 

 

If I only want the account name and contact count, I could use

 

select count(Id), Account.Name from Contact group by Account.Name

 

And similarly I could get individual counts for the other objects. But this approach is not quite desirable: It needs multiple queries, it doesn't get me accounts that have no contacts, and it requires me to stitch together the results of multiple queries to make my report.

 

But if I try this, along the lines ot traditional SQL:

 

select Name, (select count(Id) from Contact), (select count(Id) from Asset), (select count(Id) from Opportunity)

 

then we have an invalid SOQL query, because SOQL does not support aggregate functions in child objects.

 

Any ideas? Perhaps I am missing something?

 

Thanks in advance.

Sridhar

Apsona.com

 

 

Hello,

 

I'm familiar with the describeSObject call, which gives me the list of fields, and it gives me the list of picklist values for the picklist fields. But if the object has associated record types, I'd like to know which picklist values apply to a given record type. Within the salesforce UI, when I edit a record, the picklist fields for that record show only the picklist values applicable to that record's record type. How would I obtain that information via Apex calls? I know I can query the RecordType object to obtain the applicable record types for a given Salesforce object, but I'm unable to go beyond that.

 

Thanks in advance for any help.

Sridhar

http://apsona.com/salesforce

 

Hello,

We have an AppExchange app (apsona) that relies heavily on the JavaScript "save as" functionality using blobs (see this StackOverflow article, for example). Our users make heavy use of this functionality with the current Salesforce Classic interface. With the new Lightning pages, though, attempting to use the save-as functionality produces this popup under Firefox:

User-added image

It looks like this is because of a Content Security Policy header that forbids blob: URLs within embedded pages, so it completely breaks this functionality. This is scary, because there is no replacement technique (that I know of) that provides as responsive a user experience. I'd greatly appreciate any feedback.

Thanks in advance.
Sridhar
 
Hi,

When Iam trying to pass a string which contains & (Jhonson & Jhonson) in xml Request, Iam getiing Unexpected Character Issue.

Any suggestions to overcome this would be helpful!
 

As per release winter 16 release notes: http://releasenotes.docs.salesforce.com/en-us/winter16/release-notes/salesforce_release_notes.htm
 

REQUIRESCRIPT no longer executes JavaScript on Page Load.

We use the REQUIRESCRIPT function in several custom buttons on our lead page.  When the Winter 16 features were released into our sandbox, our buttons started returning an error Reference $ Undefined.

I reached out to salesforce support, and they told me to use the code in the following article which removed the REQUIRESCRIPT function and instead, creates a custom java function.

https://help.salesforce.com/apex/HTViewSolution?urlname=Receiving-error-sforce-apex-is-null-or-not-an-object-1327108329858&language=en_US

I've been messing with the code above to fit it into my button.  I'm stepping through the code through alerts, it stepped all the way through but at the end I get an Object error.  Any help would be appreciated.

function loadScript(url) 

    var request; 
    if (window.XMLHttpRequest) 
    { 
        request = new XMLHttpRequest(); 
    }     
    else if (window.ActiveXObject) 
    { 
        request = new ActiveXObject("Msxml2.XMLHTTP"); 
        if (!request) 
        { 
            request = new ActiveXObject("Microsoft.XMLHTTP"); 
        } 
    
    } 


    var se = document.createElement('script'); 
    se.type = "text/javascript"; 
    //alert("before Request undefined\n");
    request.open("GET", url, false); 
    request.send(null); 
    se.text = request.responseText; 
    document.getElementsByTagName('head')[0].appendChild(se); 
    //alert("end of loadScript\n");


loadScript("/soap/ajax/30.0/connection.js"); 
loadScript("/soap/ajax/30.0/apex.js"); 
loadScript("/resource/jQuery/jquery-1.8.2.min.js"); 
loadScript("/resource/jQuery/ui/jquery-ui-1.9.1.custom.min.js");
loadScript("/resource/jQuery/postmessage/jquery.ba-postmessage.js");
loadScript("/resource/jQuery/bbq/jquery.ba-bbq.min.js");
loadScript("/resource/buttonjs");

try 

    var j$ = jQuery.noConflict(); 
    var newurl= sforce.apex.execute("RegisterMerchant", "getPricingArticleID",{leadID : "{!Lead.Id}"}); 
    newurl1 = String(newurl); 
    alert('Lead ArticleID '+newurl1); 
    if(newurl1.indexOf('error')>-1 ) 

    alert(newurl); 
    document.location.reload(true); 

else 

    alert('Start of Else Statement')
    var strQuery="Select l.of_Pin_Pads__c,l.Id, l.Article_ID__c, l.Processing_Origin__c, l.Company, l.Strategic__c, l.Gift_Only__c, l.Dealer__r.Name, l.Developer__c, l.DLR_Sales__c, l.Name, l.OwnerId from Lead l where Id= '" +'{!Lead.Id}'+"'"; 
    var accFields = sforce.connection.query(strQuery); 
    var records = accFields.getArray("records"); 

    var owner = records[0].OwnerId; 
    var ContactName = records[0].Name; 

    var leadId = records[0].ID; 
    var Dealer = records[0].Dealer__r.Name; 
    var devID = records[0].Developer__c; 
    var Developer = null; 
    var DealerSalesperson = null; 
    if (devID!=null) 
    alert('Developer Record')
    

    var strQuery3 = "SELECT Name from Account where ID='" +devID+"'"; 
    var devField = sforce.connection.query(strQuery3); 
    var devRecord = devField.getArray("records"); 
    Developer = devRecord[0].Name; 
    


var ds = records[0].DLR_Sales__c; 
//if (ds!= null) 
    alert('DLR sales Record1')
//{ 
var strQuery6 = "Select Name from Contact where id = '" +ds+"'"; 
var dlrSalesField = sforce.connection.query(strQuery6); 
var dlrSalesRecord = dlrSalesField.getArray("records"); 
DealerSalesperson = dlrSalesRecord[0].Name; 
//}
alert('Dlr sales Record2') 

var NumberOfPinpads = 0; 
//if(records[0].of_Pin_Pads__c!=null) 
//{ 
NumberOfPinpads = parseInt(records[0].of_Pin_Pads__c); 
//}
alert('Pin Pads') 
var ArticleId = records[0].Article_ID__c; 
var ProcessingOrigin = records[0].Processing_Origin__c; 
var CompanyName = records[0].Company; 
var StrategicAccount= records[0].Strategic__c; 
var GiftOnly = records[0].Gift_Only__c; 
alert('Other stuff') 


// if diff is null, continue, if user clicked cancel, allow them to chg processing origin 
console.log('leadId '+leadId+'--'+Dealer+'--'+Developer+'--'+ArticleId+'--'+DealerSalesperson); 
// next section stolen from Josh, thanks for doing my typing buddy! 
var $articleId = $('<input>', { name: 'ArticleId', type: 'hidden', value: ArticleId }); 
var $processingOrigin = $('<input>', { name: 'ProcessingOrigin', type: 'hidden', value: ProcessingOrigin }); 
var $companyName = $('<input>', { name: 'CompanyName', type: 'hidden', value: CompanyName }); 
var $strategicAccount = $('<input>', { name: 'StrategicAccount', type: 'hidden', value: StrategicAccount }); 
var $giftOnly = $('<input>', { name: 'GiftOnly', type: 'hidden', value: GiftOnly }); 
var $contactName = $('<input>', { name: 'ContactName', type: 'hidden', value: ContactName }); 
var $dealer = $('<input>', { name: 'Dealer', type: 'hidden', value: Dealer }); 
var $developer = $('<input>', { name: 'Developer', type: 'hidden', value: Developer }); 
var $dealerSalesperson = $('<input>', { name: 'DealerSalesperson', type: 'hidden', value: DealerSalesperson }); 
var $numberOfPinpads = $('<input>', { name: 'NumberOfPinpads', type: 'hidden', value: NumberOfPinpads }); 

//alert($articleId.html()); 
var $form = $('<form>', { 
'action': '{!$Label.pricingUI}Invoke', 
'method': 'post', 
'target':'_blank' 
}); 

$form.append($articleId); 
$form.append($processingOrigin); 
$form.append($companyName); 
$form.append($strategicAccount); 
$form.append($giftOnly); 
$form.append($contactName); 
$form.append($dealer); 
$form.append($developer); 
$form.append($dealerSalesperson); 
$form.append($numberOfPinpads); 

$(document.body).append($form); 

$form.submit(); 
// alert('done by me'); 


catch(er) 

alert(er); 
}
 

I imported Accounts using Data Loader. I am trying to import the contact records associated to the accounts that i imported recently. How do i do this?

We are developing a complementary app for Salesforce.  It relies on the API, and as such will only work with EE and higher.

But, we've heard two bits of information that we can't get confirmed:

1.  PE users can get the API enabled (likely for a fee).  I'm talking about regular SFDC subscribers, not partners, here.

2.  Alternately, application developers like us can request an API Token, which will enable the application to work with PE.  We've received the token, but it doesn't seem to do anything.

Can anyone offers us some information and/or clarification?

Thanks,

Steve Harding
Symphonic Source

Hello,

 

I'm familiar with the describeSObject call, which gives me the list of fields, and it gives me the list of picklist values for the picklist fields. But if the object has associated record types, I'd like to know which picklist values apply to a given record type. Within the salesforce UI, when I edit a record, the picklist fields for that record show only the picklist values applicable to that record's record type. How would I obtain that information via Apex calls? I know I can query the RecordType object to obtain the applicable record types for a given Salesforce object, but I'm unable to go beyond that.

 

Thanks in advance for any help.

Sridhar

http://apsona.com/salesforce