• Sfdc wonder
  • NEWBIE
  • 95 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 52
    Questions
  • 17
    Replies
Hi all,


I need to avoid insertion of duplicate Accounts in Managed Package.So i implement the following trigger.Its works in Some clients Orgs,But i got below error in some client  orgs. 
"
Apex trigger NameSpace__Test_AccountSyn caused an unexpected exception, contact your administrator: NameSpace__Test_AccountSyn: execution of BeforeInsert caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. Even if a field is indexed a filter might still not be selective when: 1. The filter value includes null (for instance binding with a list that contains null) 2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times): 
"



trigger Test_AccountSyn on Account(before insert,before update,after insert , after update , after delete) 
{


if((Trigger.isBefore && Trigger.isInsert))
{

List<Account>accList=[select name,phone,website,BillingState,BillingCity,BillingPostalCode from Account where phone!=null ];

for (Account acc: Trigger.New)
{
if(accList.size()>0)
{

for(Account at:accList)
{
if(at.phone==acc.phone&& at.Billingpostalcode==acc.Billingpostalcode && at.website==acc.website && at.BillingCity==acc.BillingCity){

acc.addError(' <font color="blue"> The Account is already exist </br></br>please find below</font></br><a href="/'+at.id+'">'+at.Name+'</a>', FALSE);
}


}
}
}
}


Can any one Help us

Hi,

I need to retrieve installed package(Example:my Managed package name is 'XX' ) version within the Customer Org through PHP.
Based on versions i need to send the Data to Salesforce.


Please guide me how to retrieve this information using PHP and also guide if it is possible in Apex ??

Thanks in Advance.

Hi,
i need to write Apex Soap Service Class with the following features.

a)Third party send Lead info(like name,company,address) to this service.
b)i need to avoid duplicate insertion  of Leads in Salesforce DataBase using Company Name.
c)if there is any duplicate lead exist in SF,i need to send back duplication Lead Info to 3rd party.
d)i need to search entire SF DataBase.

How can i Start,Could you please any one give idea to start.

Note:The main concern is If the SF dataBase having lacs of data.
Hi,

we are about to submit our package to Security Review.presently our package version is 2.1.Due to some issue we need to do patch work  for  2.1 version.

can we submit patch release version(i.e,2.1.1) to security review ?

we linked our build org to APO.For the patch release do we need to link patch org to APO??

can any one help us
Hi,
User-added image


we were developed an managed App.we used two Permission sets (API names like XXXXX_Admin,XXXXXX_User ).when we installing this app in Partner enterprise edition ,it is working fine.But we got the above error while installing in Enterprise Edition (Both Sandbox and Production)


Can Any one Help us...!!!
Hi,

can you give me any idea how to know State and country picklist values are enable or not in ORG through coding not UI.

i need to write validation on Address fields(country,state on Lead) in trigger.if it is text field my validations working fine.
But the org may be enable state and country picklist values its not working,i filled state and country picklist values also but it shows validations.

once state and country picklist values are enabled in ORG,the fields like Statecode and countrycode fields are appear.

we have to developed an app so i need to write my validation on both scenarios i.e,state and country enable or disable
can any one help us the best approach...

thanks



Hi,
we have developed one salesforce app which is syncing to our web application(used to PHP technology),for that we have to create some soap web service apex classes.
we were using OAuth Authentication,when we are calling to this custom webservices from php we got the following error.

INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session key: 00Do0000000KoV6!AQUAQCtee76J4OeKpviDwrwQZ9ZI2QeWeTx9aogt4gVCX65h6i1pDArJt9C0x8V.7fjKto.wXSHbPi0W6uWGvkA9Ms7JJdj4
This is expected, it can happen if the session has expired and swept away, or if the user logs out, or if its just someone trying to hack in.



Earlier it's working fine.but now its the above error

its working in Package Org(Build Org),when we install the same package in other Enterprice Org its get above error.

can any one help us....
Hi,
we have developed one salesforce app which is syncing to our web application(used to PHP technology),for that we have to create some soap web service apex classes.
when we are calling to this custom webservices from php we got the following error

INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session key: 00Do0000000KoV6!AQUAQCtee76J4OeKpviDwrwQZ9ZI2QeWeTx9aogt4gVCX65h6i1pDArJt9C0x8V.7fjKto.wXSHbPi0W6uWGvkA9Ms7JJdj4
This is expected, it can happen if the session has expired and swept away, or if the user logs out, or if its just someone trying to hack in.


Earlier it's working fine.but now its the above error

can any one help us....


Hi,

I need to stop the trigger from API calls to avoid duplication insertion in third party.

could give me any one possible solution for this.

i have one option

  a)set one hidden field like checkbox,based on this field i can control the trigger.

   any other option.

Hi,

i want to develop web service class which is take opportunity id and List of products as input.

from that list of products i have to create opportunity products.

for this requirement i have to take care the following actions

a)avoid duplicates of products(i have to check the incomming products with existing products based on some fields like Productid__c,if it is exist its updated if it is not dere insert and finally add to opportunity products)

b)used to Standard pricebook id

c)create pricebook entry

d)OpportunityLineItem

please suggest me how i achieve this functionality......


global class BB_productservicenew{

    // A class to accept an array of input records (e.g. product/amount combinations)
    global class productInfo{
        webservice String productName;
        webservice String productCode;
        webservice Double UnitPrice;
        webservice Double Quantity;

      
    }
   
    // A class to send back as an output to PHP
    global class myOutputs{
        webservice String errorMessage;
        webservice Boolean success;
        webservice List<productInfo> inputs;
        webservice Id OpportunityId;
    }

webservice static myOutputs initiateService(Id OppId, List<productInfo> inputs)
 
    {
     List<String>pidlist=new List<String>();
     for(BB_productservicenew.productInfo ps:inputs)
     {
       pidlist.add(ps.productCode);
   
     }
    
        List<Product2>plist2=[select id,name,productCode,ProductId__c from Product2];
      
       List<Product2> plist = new List<Product2>();
      
      
      
        for(Product2 pd:plist2){
      
         for(Integer i=0;i<inputs.size();i++){
       
       
         if(pd.ProductId__c==inputs[i].productCode){

                  Pd.Name=inputs[i].productName;
                  pd.ProductId__c=inputs[i].productCode;
                  pd.Quantity__c=inputs[i].Quantity;
                  pd.UnitPrice__c=inputs[i].UnitPrice;
                  pd.IsActive=true;
                  plist.add(pd);

         }


         }

        }
      
    if(plist.size()>0){
                
                  update plist;
       
          Pricebook2 pbid=[select id from Pricebook2 where IsStandard = true limit 1];

                
          List<PricebookEntry> pentrylist=new List<PricebookEntry>();
                    
           List<PricebookEntry>pentrylist2=[select id,Pricebook2Id,Product2Id,UnitPrice,UseStandardPrice,IsActive from PricebookEntry where Product2Id     in:plist];         
                   
                     for(Product2 p:plist){
                   
                      //PricebookEntry pentry=new PricebookEntry();
                   
                       for(integer i=0;i<pentrylist2.size();i++){
                     
                       if(p.id==pentrylist2[i].Product2Id){

                     // pentrylist2[i].Pricebook2Id=pbid.id;
                  
                      //pentrylist2[i].Product2Id=p.id;
                    
                   
                   
                      pentrylist2[i].UnitPrice=p.UnitPrice__c;
                    
                     // pentry.Quantity__c=p.Quantity__c;
                      pentrylist2[i].UseStandardPrice=false;
                      pentrylist2[i].IsActive=true;
                    
                      pentrylist.add(pentrylist2[i]);
                    
                      }
                    
                      }
                     }
                   
                     update pentrylist;
                    
                    
                      List<OpportunityLineItem> opitemlist=new List<OpportunityLineItem>();

List<PricebookEntry> pbeIds =[Select Id,UnitPrice, Product2.Name,Product2.Quantity__c,Product2.UnitPrice__c From PricebookEntry where Id in:pentrylist];
 
                      for(PricebookEntry pb:pbeIds)
                      {
                    
                    
                      OpportunityLineItem opitem=new OpportunityLineItem();


                      opitem.OpportunityId=OppId;
                      opitem.PricebookEntryId=pb.id;
                      opitem.Quantity=pb.Product2.Quantity__c;
                  
                      opitem.TotalPrice=pb.UnitPrice * opitem.Quantity ;
                      opitemlist.add(opitem);
                    
                    
                      }
                    
                      insert opitemlist;

         }
            myOutputs output = new myOutputs();
            output.errorMessage = 'No errors here.';
            output.success = true;
            output.inputs = inputs;
            output.OpportunityId= OppId;
      
        return output;
       
    }
}
Hi,

i want to develop web service class which is take opportunity id and List of products as input.

from that list of products i have to create opportunity products.

for this requirement i have to take care the following actions

a)avoid duplicates of products(i have to check the incomming products with existing products based on some fields like Productid__c,if it is exist its updated if it is not dere insert and finally add to opportunity products)

b)used to Standard pricebook id

c)create pricebook entry

d)OpportunityLineItem

please suggest me how i achieve this functionality......


global class BB_productservicenew{

    // A class to accept an array of input records (e.g. product/amount combinations)
    global class productInfo{
        webservice String productName;
        webservice String productCode;
        webservice Double UnitPrice;
        webservice Double Quantity;

       
    }
    
    // A class to send back as an output to PHP
    global class myOutputs{
        webservice String errorMessage;
        webservice Boolean success;
        webservice List<productInfo> inputs;
        webservice Id OpportunityId;
    }

 webservice static myOutputs initiateService(Id OppId, List<productInfo> inputs)
  
    {
     List<String>pidlist=new List<String>();
     for(BB_productservicenew.productInfo ps:inputs)
     {
       pidlist.add(ps.productCode);
    
     }
     
        List<Product2>plist2=[select id,name,productCode,ProductId__c from Product2];
       
       List<Product2> plist = new List<Product2>();
       
       
       
        for(Product2 pd:plist2){
       
         for(Integer i=0;i<inputs.size();i++){
        
        
         if(pd.ProductId__c==inputs[i].productCode){
 
                  Pd.Name=inputs[i].productName;
                  pd.ProductId__c=inputs[i].productCode;
                  pd.Quantity__c=inputs[i].Quantity;
                  pd.UnitPrice__c=inputs[i].UnitPrice;
                  pd.IsActive=true;
                  plist.add(pd);

         }


         }

        }
       
    if(plist.size()>0){
                 
                  update plist;
        
          Pricebook2 pbid=[select id from Pricebook2 where IsStandard = true limit 1];

                 
          List<PricebookEntry> pentrylist=new List<PricebookEntry>();
                     
           List<PricebookEntry>pentrylist2=[select id,Pricebook2Id,Product2Id,UnitPrice,UseStandardPrice,IsActive from PricebookEntry where Product2Id     in:plist];          
                    
                     for(Product2 p:plist){
                    
                      //PricebookEntry pentry=new PricebookEntry();
                    
                       for(integer i=0;i<pentrylist2.size();i++){
                      
                       if(p.id==pentrylist2[i].Product2Id){
 
                     // pentrylist2[i].Pricebook2Id=pbid.id;
                   
                      //pentrylist2[i].Product2Id=p.id;
                     
                    
                    
                      pentrylist2[i].UnitPrice=p.UnitPrice__c;
                     
                     // pentry.Quantity__c=p.Quantity__c;
                      pentrylist2[i].UseStandardPrice=false;
                      pentrylist2[i].IsActive=true;
                     
                      pentrylist.add(pentrylist2[i]);
                     
                      }
                     
                      }
                     }
                    
                     update pentrylist;
                     
                     
                      List<OpportunityLineItem> opitemlist=new List<OpportunityLineItem>();

List<PricebookEntry> pbeIds =[Select Id,UnitPrice, Product2.Name,Product2.Quantity__c,Product2.UnitPrice__c From PricebookEntry where Id in:pentrylist];
  
                      for(PricebookEntry pb:pbeIds)
                      {
                     
                     
                      OpportunityLineItem opitem=new OpportunityLineItem();
 
 
                      opitem.OpportunityId=OppId;
                      opitem.PricebookEntryId=pb.id;
                      opitem.Quantity=pb.Product2.Quantity__c;
                   
                      opitem.TotalPrice=pb.UnitPrice * opitem.Quantity ;
                      opitemlist.add(opitem);
                     
                     
                      }
                     
                      insert opitemlist;

         }
            myOutputs output = new myOutputs();
            output.errorMessage = 'No errors here.';
            output.success = true;
            output.inputs = inputs;
            output.OpportunityId= OppId;
       
        return output;
        
    }
}
Hi,

i have one requirement regarding avoid duplicates of products in salesforce.i.e,any new Product with same info like Name,Productcode matches with existing product record,the old one can be deleted and new one will be inserted.

can any one suggest me how to achieve this....
Hi,

i have one requirement regarding avoid duplicates of products in salesforce.i.e,any new Product with same info like Name,Productcode matches with existing product record,the old one can be deleted and new one will be inserted.

can any one suggest me how to achieve this....



Hi,

i was developed one visualforce page with using JQuery vertical Tabs.its working fine but i little worried about use two forms in that single visualforce page. Is it fine to use two form in single VF page ??



I have alternative to use <apex:include> for including VF page in another VF page !!

Please suggest us which one is better .....

Hi,

i was developed one visualforce page with using JQuery vertical Tabs.its working fine but i little worried about use two forms in that single visualforce page. Is it fine to use two form in single VF page ??

 

I have alternative to use <apex:include> for including VF page in another VF page !!

Please suggest us which one is better .....

Hi,
i developed one Detail Page Button through OnClick JavaScript in Lead.when i click this button the Lead can be synced with 3rd party.For this i have to call web service Class(usin Http callouts) from this JavaScript Button.every thing working fine but the button i have to created using OnClick JavaScript is not display in Salesforce1 platform.
Please any one suggest me how to enable OnClick JavaScript Buttons in Salesforce1 platform.
Hi,
i developed one Detail Page Button through OnClick JavaScript in Lead.when i click this button the Lead can be synced with 3rd party.For this i have to call web service Class(usin Http callouts) from this JavaScript Button.every thing working fine but the button i have to created using OnClick JavaScript is not display in Salesforce1 platform.
Please any one suggest me how to enable OnClick JavaScript Buttons in Salesforce1 platform.
Hi,

i was implemented send email functionality  with attachments through apex.In this end user enter email address,name,Body,Subject,selecting Attachments.Every thing working fine but i have to enhance the functionality like adding cc and Bcc inputfields with User lookups like salesforce Standard send an Email functionality.

can any one suggest me how to achieve thease User lookups in Visualforce Page.
Hi,

i was implemented send email functionality  with attachments through apex.In this end user enter email address,name,Body,Subject,selecting Attachments.Every thing working fine but i have to enhance the functionality like adding cc and Bcc inputfields with User lookups like salesforce Standard send an Email functionality.

can any one suggest me how to achieve thease User lookups in Visualforce Page.
we have a requirement,we developing one App which is  intigrated By 3rd party(Web Application).we need to push all the Video/audio files to salesforce from web application.Can any one suggest me which is best Sobject to store these files in SFDC.
i have some options in my mind
       a)files
       b)Content Version
       c)Attachment

how can play these imported videos without download in salesforce?any video playes are needed or we need to write any code for that

i think no option are available in salesforce for playing videos with out Download to local system.
we have a requirement,we developing one App which is  intigrated By 3rd party(Web Application).we need to push all the Video/audio files to salesforce from web application.Can any one suggest me which is best Sobject to store these files in SFDC.
i have some options in my mind
       a)files
       b)Content Version
       c)Attachment

how can play these imported videos without download in salesforce?any video playes are needed or we need to write any code for that

i think no option are available in salesforce for playing videos with out Download to local system.
Hi,

I hav one requirement.we developing one App which is integrated to 3rd party,here intigrations involve both ways of Leads syncing.
Here my 3rd party having Monthly limit of new Leads by user wise.so i need to achieve same functionality in Salesforce side.
i wrote total syncing code in Future callouts.Here whenever monthly limit reached ,3rd party sent a response as 'Your limit reached'.

i get the response but struct at displaying response Message through triggger(by using addError method).

i done some ways:

1)In my future class,insert response in temp object .and get that  Present response in trigger after calling future Method and display the message using addError method.

But i fail,may be the reason is trigger is not waitng for resopnse.


can any one Help Me for this

Hi,
My Lead having Notes&Attachments in related list.i want to send multiple attachment to mail at a time by selecting attachments .
any one give me idea how i acheive this...

thanks in advance
Hi,

I need to retrieve installed package(Example:my Managed package name is 'XX' ) version within the Customer Org through PHP.
Based on versions i need to send the Data to Salesforce.


Please guide me how to retrieve this information using PHP and also guide if it is possible in Apex ??

Thanks in Advance.

Hi,
User-added image


we were developed an managed App.we used two Permission sets (API names like XXXXX_Admin,XXXXXX_User ).when we installing this app in Partner enterprise edition ,it is working fine.But we got the above error while installing in Enterprise Edition (Both Sandbox and Production)


Can Any one Help us...!!!
Hi,
i developed one Detail Page Button through OnClick JavaScript in Lead.when i click this button the Lead can be synced with 3rd party.For this i have to call web service Class(usin Http callouts) from this JavaScript Button.every thing working fine but the button i have to created using OnClick JavaScript is not display in Salesforce1 platform.
Please any one suggest me how to enable OnClick JavaScript Buttons in Salesforce1 platform.
Hi,

i was implemented send email functionality  with attachments through apex.In this end user enter email address,name,Body,Subject,selecting Attachments.Every thing working fine but i have to enhance the functionality like adding cc and Bcc inputfields with User lookups like salesforce Standard send an Email functionality.

can any one suggest me how to achieve thease User lookups in Visualforce Page.
Hi,

we have a requirement,we developing one App which is  intigrated By 3rd party(Web Application).we need to push all the Video/audio files to salesforce from web application.Can any one suggest me which is best Sobject to store these files in SFDC.
i have some options in my mind
       a)files
       b)Content Version
       c)Attachment

how can play these imported videos without download in salesforce?any video playes are needed or we need to write any code for that

i think no option are available in salesforce for playing videos with out Download to local system.


Hi,

I hav one requirement.we developing one App which is integrated to 3rd party,here intigrations involve both ways of Leads syncing.
Here my 3rd party having Monthly limit of new Leads by user wise.so i need to achieve same functionality in Salesforce side.
i wrote total syncing code in Future callouts.Here whenever monthly limit reached ,3rd party sent a response as 'Your limit reached'.

i get the response but struct at displaying response Message through triggger(by using addError method).

i done some ways:

1)In my future class,insert response in temp object .and get that  Present response in trigger after calling future Method and display the message using addError method.

But i fail,may be the reason is trigger is not waitng for resopnse.


can any one Help Me for this
Hi,
some one help me!!!!

what is the difference b/n APO and Business-Org.who are given thease org's,i mean salesforce or ISV

we developed one managed package.we want to move our app into AppExchange.my app is free.

we followed ISV guide(https://na15.salesforce.com/help/pdfs/en/salesforce_packaging_guide.pdf)

let me know it is neccessary of getting Business-Org to move our app into Appexchange.
how we get Business-Org?

thanks
Hi,

when iam approach to My ISV AE regarding Business Org(APO) for uploading my APP to AppExchange.

i got a reply from him as

"I manage ISV Partners in the Tri-state area. Are you looking to be in the program? Is your application an API-only or Managed Package"

im confuse with his reply so can any one make it clear and what is difference b/n  API-only or Managed Package?
Hi,

im write one page for send emails of attachments from Lead Page,here user enter email address and select attachments and finally click 'send' button.
im succeed with my vfpage and Apex,but in my test class
im getting 'Methods defined as TestMethod do not support Web service callouts, test skipped' in my test class.
any one help me.
give me some example test class for sending emails from apex
Hi,
My Lead having Notes&Attachments in related list.i want to send multiple attachment to mail at a time by selecting attachments .
any one give me idea how i acheive this...

thanks in advance
Hi,
I am the Partner Of salesforce, Partner registration, How to become ISVForce or OEM partner?