Forum Replies Created

Viewing 51 - 62 of 62 posts
  • Naman

    Member
    April 14, 2016 at 8:11 am

    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

    Member
    April 14, 2016 at 8:05 am
  • Naman

    Member
    April 14, 2016 at 8:02 am

    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.

  • Naman

    Member
    April 14, 2016 at 7:53 am

    Try using global action to achieve that in lightning.

  • Naman

    Member
    April 14, 2016 at 7:48 am

    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

    Member
    April 14, 2016 at 7:44 am

    Yes that is possible. Try using Salesforce Messaging.SingleEmailMessage functionality.

    https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_email_outbound_single.htm

  • Naman

    Member
    April 14, 2016 at 7:38 am

    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

    Member
    April 14, 2016 at 7:27 am

    You 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

    Member
    April 4, 2016 at 10:21 am

    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

    Member
    April 1, 2016 at 11:03 am

    Hi 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.htm

    We 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.

  • Naman

    Member
    March 30, 2016 at 7:35 am

    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

    Member
    March 28, 2016 at 7:26 am

    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.

Viewing 51 - 62 of 62 posts