Naman Bhardwaj
IndividualForum Replies Created
-
Naman
MemberApril 14, 2016 at 8:11 am in reply to: Is it possible to use external storage to store Attachments in Salesforce?Yes this is possible but in that case you need to have external server where you can have your files/attachments and give a link of file in salesforce to download that file. When user clicks on that link, you need to perform the authentication and download the file by using external system APIs. Many servers are available to store your files like rackspace, amazon e.t.c. Let me know if you need more info on this.
-
-
Naman
MemberApril 14, 2016 at 8:02 am in reply to: How to stop a trigger of managed package from failing as it is being envoked by Salesforce Batch Apex?We can't restrict/deactivate manage package trigger untill it is not operated with some condition like we have custom setting checkbox checked to initiate the trigger. If you want to still update the accounts, you have to use the Salesforce APIs to update accounts OR you can make custom webservice in Salesforce and call it by authenticating salesforce. By that way the context would get change of both transactions. Let me know if you need more detail.
-
Try using global action to achieve that in lightning.
-
Naman
MemberApril 14, 2016 at 7:48 am in reply to: How can I check if there is an Attachment on an Object from Visualforce page?Use java scripting to query object with inner query for Attachment. Like below
sforce.connection.sessionId = '{!$Api.Session_ID}';
var str='';
var results = sforce.connection.query("SELECT Id,guid__c, (SELECT Id, Name FROM Attachments) FROM Application__c where guid__c ='{!$CurrentPage.parameters.guid}' limit 1");
var records1 = results.getArray("records");(or)
you can query in your controller check if attachment is there on object record, if yes, you can set a boolean to true and use that on page.
-
Naman
MemberApril 14, 2016 at 7:44 am in reply to: Sending an outbound Email from Visualforce- Is it possible to send an outbound email from VisualForce page?Yes that is possible. Try using Salesforce Messaging.SingleEmailMessage functionality.
-
Naman
MemberApril 14, 2016 at 7:38 am in reply to: Can we insert parent and child object record in single DML statement?Try something like below: Note that reference field must be external id field on parent object. Here i have used SLASerialNumber__c as external id field.
Contact con = new Contact(lastName='bhardwaj');
con.Email = '[email protected]';Account accRef = new Account(SLASerialNumber__c='12');
con.Account = accRef;Account acc = new Account(Name='namanTestAcc', SLASerialNumber__c='12');
Database.SaveResult[] results = Database.insert(new SObject[] {acc, con});
for (Integer i = 0; i < results.size(); i++) {
if (results[i].isSuccess()) {
System.debug('Successfully Created ID: '+ results[i].getId());
}
} -
Naman
MemberApril 14, 2016 at 7:27 am in reply to: Asynchronous method call to fetch data at particular time intervalYou can use Action Poller to call action from Controller asynchronously at particular time interval. Also you need to use "enabled" attribute to put some trick there to stop calling action.
-
Naman
MemberApril 4, 2016 at 10:21 am in reply to: Non-selective query against large object type (more than 100000 rows)Above was the one solution that Salesforce support gave initially. After using batch class too, trigger was not able to perform the operations so again contacted with Salesforce support and finally they enabled the custom indexing for some fields(in my case on account fields) which i have to use in my WHERE clause. This made my query run successfully and no more of "Non-selective query" error message come.
-
Naman
MemberApril 1, 2016 at 11:03 am in reply to: Enable Quotes and Order using Post install ScriptHi Bhavesh,
We can only enable the Quotes and Order settings either by point and click or by using Metadata APIs. See the below link -
https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_quotessettings.htm
https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_ordersettings.htmWe can use the above links info in apex class like below
HTTP h = new HTTP();
HTTPRequest req = new HTTPRequest();
req.setMethod('POST');
req.setHeader('Content-Type', 'text/xml');
req.setHeader('SOAPAction', 'create');String b = '';
b += ''; ';
b += 'true ';
b += '
req.setBody(b);
req.setCompressed(false);
req.setEndpoint('https://na12-api.salesforce.com/services/Soap/m/25.0');
HTTPResponse resp = h.send(req);In apex, we can do only simple CRUD operations using Metadata APIs.
-
Hi Satyakam.
You can use typeahead library of jquery in you VF page that can help you achieve the same functionality. Whenever user would select any value from data list, you can get that using typeahead:selected and remove that value from your datalist by writing custom remove function. As needed, you can use the selected value to display it on another div with checkbox and when user checks the checkbox, you can again add the value into the original datalist by using javascript push() function.
$('#the-basics .typeahead').typeahead({
hint: true,
highlight: true,
minLength: 1
},
{
name: 'states',
source: substringMatcher(states)
}).bind("typeahead:selected", function(obj, datum) {
alert('datum '+datum);
states.remove(datum);
//document.getElementById("inputTextTypeahead").value = '';states2.push(datum);
alert('states2 '+states2);
document.getElementById("demo").innerHTML = states2;});
Note: datum is the selected value that user selects from the datalist. States is the data list.
Following is the remove function that will remove the selected value from the original data list.
Array.prototype.remove = function() {
var what, a = arguments, L = a.length, ax;
while (L && this.length) {
what = a[--L];
while ((ax = this.indexOf(what)) !== -1) {
this.splice(ax, 1);
}
}
return this;
}; -
Naman
MemberMarch 28, 2016 at 7:26 am in reply to: Non-selective query against large object type (more than 100000 rows)I have been touch with Salesforce support and also created case regarding the same. When trigger gives an error like above and you have tried almost everything to resolve it, that means your trigger exceeding the CPU time limit so the alternative solution could be a batch class processing the records.