Forum Replies Created

  • Bhavesh

    Member
    January 29, 2020 at 6:52 am in reply to: What is the difference between Salesforce Batches and Queueable Apex?

    Can i replace my Queueable class to batch class?  It there any example how can i convert my Queueable class to batch?

  • You can get a list of active user sessions (i.e. logged in users) via <Your Name> Setup> Security Controls> Session Management or the API.

  • using this option you can use live data for unit test case

  • Bhavesh

    Member
    January 11, 2017 at 8:20 am in reply to: Error while making callout in salesforce

    It is the issue of certification. that website have security certification. you have to submit that in salesforce options.

  • Bhavesh

    Member
    January 11, 2017 at 8:11 am in reply to: Debug Log statement - system.debug - in production in Salesforce

    We can not see the debug logs in production.

    If you wrote some debug logs in your code and now you created one managed package of that code.

    That managed package is install on customer org. Now whatever logs you wrote in managed package, you can not see those.

    So it is better to delete those system.debug logs from managed package.

    If you have this type of requirement, let me know I have one solution for that.

  • Bhavesh

    Member
    January 3, 2017 at 2:40 pm in reply to: Sorting based on column value in salesforce

    If you have apex page like:

     

    <apex:commandButton value="Sort Table" action="{!sortMethod}" reRender="pgblcktbl"/>

    you are callilng sortMethod:

     

    ublic void sortMethod(){
    if(selectedField == 'Name')
    accList = [select name,accountnumber,annualrevenue from account where id IN:accList order by Name limit 100 ];
    else if(selectedField == 'AccountNumber')
    accList = [select name,accountnumber,annualrevenue from account where id IN:accList order by AccountNumber limit 100 ];
    else if(selectedField == 'Annualrevenue')
    accList = [select name,accountnumber,annualrevenue from account where id IN:accList order by Annualrevenue desc limit 100 ];
    }

     

    Something like this you can do that

  • Hello Pranav,

    You can do like this:

    List<String> stdProNames= new List<String>{'System Administrator','Standard User','Read Only','Solution Manager','Marketing User','Contract Manager'};
    Profile[] customProfiles = [Select Id, Name from Profile where Name NOT IN :stdProNames];
    System.debug(customProfiles);

  • Bhavesh

    Member
    September 8, 2016 at 8:46 am in reply to: Post Install Script in Salesforce for deleting custom object data

    Hello Surabhi,

    Thanks for quick reply.

    I am doing another operation also in post install script. Please check below whole code of my post install script.

    public class TaxNowPostInstall implements InstallHandler
    {
    public void onInstall(InstallContext context)
    {
    if(context.previousVersion() == null) // first install - create a new TaxNow Settings Record
    {
    //Insert some data when package install
    TaxNowSetting__c tns = new TaxNowSetting__c(Name='AvaTax',Active_Setting__c=true,
    Service_URL__c = 'https://avatax.avalara.net',TriggerLimit__c = 1);
    insert(tns);
    //Searching prodcut 'Tax Refund' from product catlog if it is not there, we are inserting it.
    List<List<Product2 >>searchList = [FIND :'Tax Refund' RETURNING Product2 ];
    Product2 pr = new Product2();
    PriceBook2 customPriceBook = new PriceBook2();
    if(searchList.size() == 0)
    {

    pr.Name='Tax Refund';
    pr.isActive=true;
    pr.ProductCode = 'Tax Refund';
    insert pr;

    // Insert Pricebook

    customPriceBook.Name='Tax Refund';
    customPriceBook.IsActive=true;
    insert customPriceBook;
    }
    // Insert Product
    List<EntityUse__c> initialCodes = new List<EntityUse__c>
    {
    new EntityUse__c(Description__c='Non-resident (Canada)', Name ='R'),
    new EntityUse__c(Description__c='Commercial Fishery (Canada)', Name ='Q'),
    new EntityUse__c(Description__c='Commercial aquaculture (Canada)', Name ='P'),
    new EntityUse__c(Description__c='Other (requires Exempt Reason Desc) (both)', Name ='L'),
    new EntityUse__c(Description__c='Direct mail (United States)', Name ='K'),
    new EntityUse__c(Description__c='Direct pay permit (United States)', Name ='J'),
    new EntityUse__c(Description__c='Industrial production / manufacturer (both)', Name ='I'),
    new EntityUse__c(Description__c='Commercial agricultural production (both)', Name ='H'),
    new EntityUse__c(Description__c='Resale (both)', Name ='G'),
    new EntityUse__c(Description__c='Religious or educational org (both)', Name ='F'),
    new EntityUse__c(Description__c='Charitable or benevolent org (both)', Name ='E'),
    new EntityUse__c(Description__c='Foreign diplomat (both)', Name ='D'),
    new EntityUse__c(Description__c='Tribe / Status Indian / Indian Band (both)', Name ='C'),
    new EntityUse__c(Description__c='State government (United States)', Name ='B'),
    new EntityUse__c(Description__c='Federal government (United States)',Name='A')
    };
    insert initialCodes;
    List<Shipping_Codes__c> initialsCodes = new List<Shipping_Codes__c>
    {
    new Shipping_Codes__c(Description__c='Delivery by company vehicle before passage of title', Name ='FR010000'),
    new Shipping_Codes__c(Description__c='After passage of title', Name ='FR010100'),
    new Shipping_Codes__c(Description__c='Shipping Only (Not paid directly to common carrier)', Name ='FR010200'),
    new Shipping_Codes__c(Description__c='Common carrier - FOB destination', Name ='FR020000'),
    new Shipping_Codes__c(Description__c='Common carrier - FOB origin', Name ='FR020100'),
    new Shipping_Codes__c(Description__c='Common carrier - FOB unknown', Name ='FR020200'),
    new Shipping_Codes__c(Description__c='Non-common carrier - FOB destination', Name ='FR020300'),
    new Shipping_Codes__c(Description__c='Non-common carrier - FOB origin', Name ='FR020400'),
    new Shipping_Codes__c(Description__c='Non-common carrier - FOB unknown', Name ='FR020500'),
    new Shipping_Codes__c(Description__c='Direct Mail-printed material for mass audience delivery', Name ='FR020600'),
    new Shipping_Codes__c(Description__c='Charges that exceed the actual cost of delivery', Name ='FR020700'),
    new Shipping_Codes__c(Description__c='Charges that exceed reasonable and prevailing rates', Name ='FR020800'),
    new Shipping_Codes__c(Description__c='Shipping And Handling Combined', Name ='FR020900'),
    new Shipping_Codes__c(Description__c='Common carrier - FOB destination', Name ='FR030000'),
    new Shipping_Codes__c(Description__c='Common carrier - FOB origin',Name='FR030100'),
    new Shipping_Codes__c(Description__c='Common carrier - FOB unknown', Name ='FR030200'),
    new Shipping_Codes__c(Description__c='Non-common carrier - FOB destination', Name ='FR030300'),
    new Shipping_Codes__c(Description__c='Non-common carrier - FOB origin', Name ='FR030400'),
    new Shipping_Codes__c(Description__c='Non-common carrier - FOB unknown', Name ='FR030500'),
    new Shipping_Codes__c(Description__c='Direct Mail-printed material for mass audience delivery', Name ='FR030600'),
    new Shipping_Codes__c(Description__c='Charges that exceed the actual cost of delivery', Name ='FR030700'),
    new Shipping_Codes__c(Description__c='Charges that exceed reasonable and prevailing rates', Name ='FR030800'),
    new Shipping_Codes__c(Description__c='Electronically Delivered', Name ='FR030900'),
    new Shipping_Codes__c(Description__c='Temporary Unmapped Freight SKU - taxable default', Name ='FR040000'),
    new Shipping_Codes__c(Description__c='Miscellaneous', Name ='FR999999')
    };
    insert initialsCodes;
    }
    else // upgrade - make sure all TaxNowSettings have a value in TriggerLimit
    {
    for(TaxNowSetting__c tns : [select TriggerLimit__c from TaxNowSetting__c])
    {
    //once avalara package install, we insert TriggerLimit == 1 by default.
    if(tns.TriggerLimit__c == null)
    {
    tns.TriggerLimit__c = 1;
    update(tns);
    }
    }
    }

    }
    }

    Where should i wrote batch function in this script. Please suggest me. If possible please modify it and send me again.

  • Bhavesh

    Member
    June 22, 2016 at 11:14 am in reply to: How to use encodeURI in Salesforce Apex?

    Hello Abhinav,

     

    I used this yesterday but actually result of this EncodingUtil.URLENCODE  is like 'bhavesh+jogi'

    Actually, result should be 'bhavesh%20jogi'.

    Let me know if other solution is in Salesforce.

  • Bhavesh

    Member
    June 18, 2016 at 3:59 pm in reply to: Want to put my app in AppExchange, getting third party url error

    Hello Abhinav,

    How can i get burp license? Is there any tool?

  • Bhavesh

    Member
    April 28, 2016 at 3:58 am in reply to: Enable Quotes and Order using Post install Script

    I think enable quotes or order manually or do like @abhinav told both are same. So It is not different.

  • Bhavesh

    Member
    April 26, 2016 at 5:52 am in reply to: Enable Quotes and Order using Post install Script

    @Abhinav, Where should i write above code then? So I enable Quotes when customer installs my package?

    Do you have any idea where should i write?

  • Bhavesh

    Member
    April 11, 2016 at 11:37 am in reply to: Enable Quotes and Order using Post install Script

    @Abhinav,

    Should I write above code in post install script?

  • Bhavesh

    Member
    April 11, 2016 at 6:02 am in reply to: Enable Quotes and Order using Post install Script

    Hi naman,

    I have managed package in which Opportunity, Quotes and Order I have. Now when customer is installing it at that time it is giving the error that please enable quotes.

    I want that when customer installed this managed package at that time if Quotes is not enable , enable it by some code without knowing to customer.

     

    Is it possible?