• piyush parmar
  • NEWBIE
  • 93 Points
  • Member since 2011


  • Chatter
    Feed
  • 3
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 11
    Questions
  • 45
    Replies
hi all,
          I have two custopm objects.EmployeeDb(master) and EmployeeAdd(child).when ever a parent record is insert ,then automatically inasert a new child record.any one can help me out on this.thanks in advance.

Regards
vijay
I am trying to build a table that shows leads and contacts... so I created a custom obj class personObject and I am able to instantiate them just fine... 

but when I try to but them into a datatable in visualforce I am running into Error: 'OpportunityExt.personObject.Id'    

Visualforce Page: 
<apex:page standardController="Opportunity" extensions="OpportunityExt"  >

 Raw: {!RelatedPeople}
        <apex:dataTable styleClass="list" width="100%" style="height: 10px;" value="{!RelatedPeople}" var="per">
            <apex:column headerValue="Name" styleClass="dataRow">
                <apex:outputLink value="/per.id" target="_parent">{!per.firstName} {!per.lastName}</apex:outputLink> 
            </apex:column>  
            <apex:column value="{!per.email}" headerValue="Email"/>
            <apex:column value="{!per.Title}" headerValue="Title"/>
            <apex:column value="{!per.Company}" headerValue="Company"/>
            <apex:column value="{!per.Status}" headerValue="Lead Status"/>
        </apex:dataTable>
   

    
    <!-- for soql call -->
<apex:outputField rendered="FALSE" value="{!opportunity.account.website}" />
<apex:outputField rendered="FALSE" value="{!opportunity.account.name}" />

</apex:page>



I can display the raw output just fine: 
[personObject:[Id=0031700000NtXdEAAV, company=McLaren, email=null, firstName=Kevin, lastName=Magnussen, status=Contact Record, title=Chairman and Chief Executive Officer], personObject:[ Id=0031700000NtXRHAA3, company=McLaren, email=ron@mclaren.com, firstName=Ron, lastName=Dennis, status=Contact Record, title=CEO], personObject:Id=0031700000NtXWRAA3, company=McLaren, email=eric@mclaren.com, firstName=Eric, lastName=Boullier, status=Contact Record, title=Racing Director]]




Class: 
public class OpportunityExt {

    private final Opportunity opp;
    
    public OpportunityExt(ApexPages.StandardController stdController) {
        this.opp = (opportunity)stdController.getRecord();
    }
    
    public class personObject {
    // custom constructor
        string firstName; 
        string lastName;
        string email;
        string title;
        string company;
        string Id; 
        string status;
    }    
        

    public List<personObject> getRelatedPeople(){ 
        list<personObject> relatedPeople = new List<personObject>();
        List<Lead> relatedLeads = [SELECT Id, Name, status, email, Title, Company, Website  FROM Lead WHERE  (website = :opp.account.website AND website != null AND isConverted = FALSE)OR (Company LIKE  :opp.account.Name AND isConverted = FALSE)   ORDER BY HG_Focus_User__c DESC, Name ASC LIMIT 1000];
        for(lead ld :relatedLeads){
            personObject person = new personObject();
            person.firstname = ld.firstName;
            person.lastName = ld.lastName;
            person.email = ld.email; 
            person.title = ld.title;
            person.company = ld.company; 
            person.status = ld.status;
            person.Id = ld.id;
            relatedPeople.add(person);
        }
        
        List<Contact> relatedContacts = [SELECT Id, firstName, lastName, email, Title, account.name, account.website, HG_Focus_User__c, HG_Focus_Sign_Up_Date__c FROM Contact WHERE account.id = :opp.account.id];
        for(contact ctc :relatedContacts){
            personObject person = new personObject();
            person.firstname = ctc.firstName;
            person.lastName = ctc.lastName;
            person.email = ctc.email; 
            person.title = ctc.title;
            person.company = ctc.account.name; 
            person.status = 'Contact Record';
            person.Id = ctc.id;
            relatedPeople.add(person);
        }
        
        
        return relatedPeople;
    }

    
}

 

HI,

I need ur help !!

I am getting error INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id:[] Trigger.ShareOperatingUnits:  when test code covereag.

 

Test class ::

private class TestNewWorkOrder {

    static testMethod void myUnitTest() {
        User usr1 = [select id, Name, ProfileId  from User where Profile.Name = 'System Administrator' limit 1 ];
        System.runAs(usr1) {  
        Object__c ou = new Object__c();
        ou.Branch_Manager__c = UserInfo.getUserId();
        ou.Name = 'Test';
        insert ou;
     }

}

 

After insert Trigger::

trigger ShareOperatingUnits on Object__c (after insert, after update) {
    List<Object__Share> ouShareList = new List<Object__Share>();

    for(Object__c ou: Trigger.New) {
        Object__Share ouShare = new Object__Share();
        ouShare.ParentId  = ou.Id;
        ouShare.UserOrGroupId = ou.Branch_Manager__c;
        ouShare.AccessLevel = 'Read';
        ouShareList.add(ouShare);
        allOUids.add(ou.id);
    }

   insert ouShareList;   // HERE I M GETTING ERROR

}

 

Please tell me what i done wrong .

I think i need to make some changes on object side my trigger is working fine but getting prblm for test coverage .

Please help me !!

 

Many Thnks In Advance

 

Piyush

HI,

I need ur help !!

I am getting error INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id:[] Trigger.ShareOperatingUnits:  when test code covereag.

 

Test class ::

private class TestNewWorkOrder {

    static testMethod void myUnitTest() {
        User usr1 = [select id, Name, ProfileId  from User where Profile.Name = 'System Administrator' limit 1 ];
        System.runAs(usr1) {  
        Object__c ou = new Object__c();
        ou.Branch_Manager__c = UserInfo.getUserId();
        ou.Name = 'Test';
        insert ou;
     }

}

 

After insert Trigger::

trigger ShareOperatingUnits on Object__c (after insert, after update) {
    List<Object__Share> ouShareList = new List<Object__Share>();

    for(Object__c ou: Trigger.New) {
        Object__Share ouShare = new Object__Share();
        ouShare.ParentId  = ou.Id;
        ouShare.UserOrGroupId = ou.Branch_Manager__c;
        ouShare.AccessLevel = 'Read';
        ouShareList.add(ouShare);
        allOUids.add(ou.id);
    }

   insert ouShareList;   // HERE I M GETTING ERROR

}

 

Please tell me what i done wrong .

I think i need to make some changes on object side my trigger is working fine but getting prblm for test coverage .

Please help me !!

 

Many Thnks In Advance

 

Piyush

Hi, All

 

I have create trigger for  chatter notification on attachment  when file is upload

but getting error like

Error: Apex trigger ChatterNotification caused an unexpected exception, contact your administrator: ChatterNotification: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, Feed Item Type: bad value for restricted picklist field: file:

 

Plaese suggest me any idea !! or otherr way to chatter notification when attach file !!

Please Help me ASAP

Thank you,

Piyush Parmar

Hi All,

 

I  created  trigger(after insert) on OpportunityLineItem  to mergr same product .

But a\ i am getting System.NullPointerException: Attempt to de-reference a null object: .

 

 

Map<Id,OpportunityLineItem> oppIdAndLineItems = new Map<Id,OpportunityLineItem>();

 


for(OpportunityLineItem  ol:trigger.new) {
        lineId.add(ol.Id);
        oppIdAndLineItems.put(ol.PricebookEntry.Product2Id, ol);
        
    }
    for( OpportunityLineItem oli : [select Id,PricebookEntry.Product2Id,Quantity,ListPrice,TotalPrice from OpportunityLineItem  where  Id in: lineId] ) {
        productIds.add(oli.PricebookEntry.Product2Id);
       
    }
    List<OpportunityLineItem> toBeDeleted = new List<OpportunityLineItem>();
    List < OpportunityLineItem > toBeUpdated = new List < OpportunityLineItem >();
    for( OpportunityLineItem oli : [select Id,PricebookEntry.Product2Id,Quantity,ListPrice,TotalPrice from OpportunityLineItem  where PricebookEntry.Product2Id in: productIds and Id not in: lineId] ) {
     
        OpportunityLineItem newlyAdded  = oppIdAndLineItems.get(oli.PricebookEntry.Product2Id);
        System.debug('newlyAdded.Quantity-->'+newlyAdded.Quantity);
      
        newlyAdded.Quantity = newlyAdded.Quantity + oli.Quantity;
        toBeDeleted.add(oli);
        toBeUpdated.add(newlyAdded);
       
    }

 

i have highlight line when i am getting this error .

Plz give me some idea what i am doing  wrong !!

 

Thank You,

piyush

 

Hi all..
I am able to connect salesforce using PHP toolkit in sandbox.
But when i am try to connect production org i am getting this type of error.
Fatal error: Uncaught SoapFault exception: [INVALID_LOGIN] INVALID_LOGIN: Invalid username, password, security token; or user locked out. in /home/sites/public_html/sales/soapclient/SforceBaseClient.php:155 Stack trace: #0 [internal function]: SoapClient->__call('login', Array) #1 /home/sites//public_html/sales/soapclient/SforceBaseClient.php(155): SoapClient->login(Array) #2 /home/sites/public_html/sales/Upload.php(33): SforceBaseClient->login('username.', 'password+token') #3 {main} thrown in /home/sites/public_html/sales/soapclient/SforceBaseClient.php on line 155
here my username , password and security tokan is correct ,
than why i am getting this type of error ??
please reply me its urgent ..
Thank you 
piyush

Hi all..

 

I am able to connect salesforce using PHP toolkit in sandbox.

But when i am try to connect production org i am getting this type of error.

 

Fatal error: Uncaught SoapFault exception: [INVALID_LOGIN] INVALID_LOGIN: Invalid username, password, security token; or user locked out. in /home/sites/public_html/sales/soapclient/SforceBaseClient.php:155 Stack trace: #0 [internal function]: SoapClient->__call('login', Array) #1 /home/sites//public_html/sales/soapclient/SforceBaseClient.php(155): SoapClient->login(Array) #2 /home/sites/public_html/sales/Upload.php(33): SforceBaseClient->login('username.', 'password+token') #3 {main} thrown in /home/sites/public_html/sales/soapclient/SforceBaseClient.php on line 155

 

 

here my username , password and security tokan is correct ,

than why i am getting this type of error ??

please reply me its urgent ..

 

Thank you 

piyush

I am fairly new using PHP with Salesforce, I'm not  able to creat successfully connection.

Here is the code:

 

   ini_set("soap.wsdl_cache_enabled", "0");
    // Include the PHP Toolkit
    require_once('soapclient/SforcePartnerClient.php');
    //require_once('SforceHeaderOptions.php');
 
    // Login
    $sfdc = new SforcePartnerClient();
    $SoapClient = $sfdc->createConnection('Partner.wsdl.xml');
    $loginResult = false;
    $loginResult = $sfdc->login('test@g.com', 'test1234.tokan' );
 
    // Define constants for the web service. We'll use these later
    $parsedURL = parse_url($sfdc->getLocation());
    define ("_SFDC_SERVER_", substr($parsedURL['host'],0,strpos($parsedURL['host'], '.')));
    define ("_WS_NAME_", 'LeadWebService');
    define ("_WS_WSDL_", _WS_NAME_ . '.xml');
    define ("_WS_ENDPOINT_", 'https://' . _SFDC_SERVER_ . '.salesforce.com/services/wsdl/class/' . _WS_NAME_);
    define ("_WS_NAMESPACE_", 'http://soap.sforce.com/schemas/class/' . _WS_NAME_);
    echo "_WS_WSDL_". _WS_NAME_;
    // SOAP Client for Web Service
    $client = new SoapClient(_WS_WSDL_);
    $sforce_header = new SoapHeader(_WS_NAMESPACE_, "SessionHeader", array("sessionId" => $sfdc->getSessionId()));
    $client->__setSoapHeaders(array($sforce_header));
    // data to send into the web service

 

 

NOte:here all file at correct path.

 

Please let me know if wrong,

Or other way than also post ,

 

 

Thx

piyush

hi,

How to know our org is  Enterprise Edition, Unlimited Edition or Developer Edition ?

In salesforce any facility to found which org we r using . ??

 

Thax,

piyush parmar

how to undeploying a workflow and Email Template  via migration tool Or

howwrite package.xml for workflow and Email Template

 

 

In Standard Object , why can't set picklist as required field ?

 

Hi all..
I am able to connect salesforce using PHP toolkit in sandbox.
But when i am try to connect production org i am getting this type of error.
Fatal error: Uncaught SoapFault exception: [INVALID_LOGIN] INVALID_LOGIN: Invalid username, password, security token; or user locked out. in /home/sites/public_html/sales/soapclient/SforceBaseClient.php:155 Stack trace: #0 [internal function]: SoapClient->__call('login', Array) #1 /home/sites//public_html/sales/soapclient/SforceBaseClient.php(155): SoapClient->login(Array) #2 /home/sites/public_html/sales/Upload.php(33): SforceBaseClient->login('username.', 'password+token') #3 {main} thrown in /home/sites/public_html/sales/soapclient/SforceBaseClient.php on line 155
here my username , password and security tokan is correct ,
than why i am getting this type of error ??
please reply me its urgent ..
Thank you 
piyush
Hi everyone,

Can anyone help me in how can I apply pagination To lightning component that is in Aura:iteration records list.

Thanks in advance.
hi all,
          I have two custopm objects.EmployeeDb(master) and EmployeeAdd(child).when ever a parent record is insert ,then automatically inasert a new child record.any one can help me out on this.thanks in advance.

Regards
vijay
i want to use apex sharing on my 'projects' object which is a custom object  i went through the document:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_bulk_sharing_creating_with_apex.html
They have Asked to create MyCustomObject__Share
do ineed to create new Object as projects__Share or edit the existing object...can anyone tell me the steps for the __Share object creation 
Hi
I am understading the basics of metadata of fetching account info.
below is the code 
public class selectAllSOQLExampleController
{
    String SobjectApiName = 'Account';
   
    List<Account> accList=new List<Account>();
   
    public String query{get;set;}

    public List<Account> getAccList() 
    {
       Map<String,Schema.SObjectType> schemaMap=Schema.getGlobalDescribe();
          
       Map<String, Schema.SObjectField> fieldMap = schemaMap.get(SobjectApiName).getDescribe().fields.getMap();
     
       String commaSeparatedFields = '';
     
       for(String fieldName : fieldMap.keyset())
       {
            if(commaSeparatedFields == null || commaSeparatedFields == '')
            {
                commaSeparatedFields = fieldName;
            }
            else
            {
                commaSeparatedFields = commaSeparatedFields + ', ' + fieldName;
            }
       }
 
       query = 'select ' + commaSeparatedFields + ' from ' + SobjectApiName + ' Limit 10 ';
   
       accList = Database.query(query);
     
       return accList;
 
    }
}

<apex:page controller="selectAllSOQLExampleController">
  
   <apex:form>
        <apex:pageBlock>
                       
            <apex:pageBlockSection title="Account table" 
                                                     columns="1" 
                                                     collapsible="false">
                                   
                <apex:pageBlockTable value="{!accList}" 
                                                      var="acc">

                    <apex:column value="{!acc.name}"/>
                    <apex:column value="{!acc.phone}"/>
                    <apex:column value="{!acc.rating}"/>
                    <apex:column value="{!acc.industry}"/>
                    <apex:column value="{!acc.accountnumber}"/>
                    
                </apex:pageBlockTable>
 
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>
My requirement is I want to display custom fields also.
Pls help me in tweeking my code.


pooja
Hi,

I have one situation in my code where i need a list or Map of records as well as sum of a fields from them. What is the best way to achieve this? i can think 2 ways
1) Use 1 SOQL query to get the Map of records and 1 aggregate query to get the sum of field OR
2) Use 1 SOQL query only to get the record, the loop through them and get the some of field using some variable

In approach first, i think i will have to use 1 extra query and in 2nd approrach, if number of records are more, i could take longer time. 
I am confused which approach i should use. Any suggestions would be great. 

Thanks,
I am trying to build a table that shows leads and contacts... so I created a custom obj class personObject and I am able to instantiate them just fine... 

but when I try to but them into a datatable in visualforce I am running into Error: 'OpportunityExt.personObject.Id'    

Visualforce Page: 
<apex:page standardController="Opportunity" extensions="OpportunityExt"  >

 Raw: {!RelatedPeople}
        <apex:dataTable styleClass="list" width="100%" style="height: 10px;" value="{!RelatedPeople}" var="per">
            <apex:column headerValue="Name" styleClass="dataRow">
                <apex:outputLink value="/per.id" target="_parent">{!per.firstName} {!per.lastName}</apex:outputLink> 
            </apex:column>  
            <apex:column value="{!per.email}" headerValue="Email"/>
            <apex:column value="{!per.Title}" headerValue="Title"/>
            <apex:column value="{!per.Company}" headerValue="Company"/>
            <apex:column value="{!per.Status}" headerValue="Lead Status"/>
        </apex:dataTable>
   

    
    <!-- for soql call -->
<apex:outputField rendered="FALSE" value="{!opportunity.account.website}" />
<apex:outputField rendered="FALSE" value="{!opportunity.account.name}" />

</apex:page>



I can display the raw output just fine: 
[personObject:[Id=0031700000NtXdEAAV, company=McLaren, email=null, firstName=Kevin, lastName=Magnussen, status=Contact Record, title=Chairman and Chief Executive Officer], personObject:[ Id=0031700000NtXRHAA3, company=McLaren, email=ron@mclaren.com, firstName=Ron, lastName=Dennis, status=Contact Record, title=CEO], personObject:Id=0031700000NtXWRAA3, company=McLaren, email=eric@mclaren.com, firstName=Eric, lastName=Boullier, status=Contact Record, title=Racing Director]]




Class: 
public class OpportunityExt {

    private final Opportunity opp;
    
    public OpportunityExt(ApexPages.StandardController stdController) {
        this.opp = (opportunity)stdController.getRecord();
    }
    
    public class personObject {
    // custom constructor
        string firstName; 
        string lastName;
        string email;
        string title;
        string company;
        string Id; 
        string status;
    }    
        

    public List<personObject> getRelatedPeople(){ 
        list<personObject> relatedPeople = new List<personObject>();
        List<Lead> relatedLeads = [SELECT Id, Name, status, email, Title, Company, Website  FROM Lead WHERE  (website = :opp.account.website AND website != null AND isConverted = FALSE)OR (Company LIKE  :opp.account.Name AND isConverted = FALSE)   ORDER BY HG_Focus_User__c DESC, Name ASC LIMIT 1000];
        for(lead ld :relatedLeads){
            personObject person = new personObject();
            person.firstname = ld.firstName;
            person.lastName = ld.lastName;
            person.email = ld.email; 
            person.title = ld.title;
            person.company = ld.company; 
            person.status = ld.status;
            person.Id = ld.id;
            relatedPeople.add(person);
        }
        
        List<Contact> relatedContacts = [SELECT Id, firstName, lastName, email, Title, account.name, account.website, HG_Focus_User__c, HG_Focus_Sign_Up_Date__c FROM Contact WHERE account.id = :opp.account.id];
        for(contact ctc :relatedContacts){
            personObject person = new personObject();
            person.firstname = ctc.firstName;
            person.lastName = ctc.lastName;
            person.email = ctc.email; 
            person.title = ctc.title;
            person.company = ctc.account.name; 
            person.status = 'Contact Record';
            person.Id = ctc.id;
            relatedPeople.add(person);
        }
        
        
        return relatedPeople;
    }

    
}

 
Can anyone please help me to implement pagination using lightning component?
Hello!

I created my own Lightning app and Ligthnng Component. Also I use Lightning Desigh System.
I placed table in the component. And it has a lot of records. I would like to display records by pages and I would like to navigate between pages. How can I do pagination for my table? May be using Lightning Design System.

Thank you in advice!
Hi can anyone provide me sample code how to paginte in lightning components .Suppose if i have to show 10 records of account each time and i have 100 records in total . So how to paginate this in lightning
Im unable to save this code but it works well with contact or account sobject the error im getting is "attcon Compile Error: Dynamic SOQL loop variable must be an SObject or SObject list (concrete or generic) at line 27 column 32" Did i miss anything here?

public pagereference search(){
        if(searchResults==null){
        searchResults=new list<AttachmentWrapper>();//initiate searchresults if the value is null
            }
        else{
        searchResults.clear();//clear out the current results if the values pre exist
            }
        //dynamic SOQL query to fetch the attachments
                String qry = 'Select Name, Id From attachment Where Name LIKE \'%'+searchText+'%\' Order By Name';
                for(attachment att:database.query(qry)){
               
                }

    return null;
    }
I have created custom object.when error will generate ,it has to logged into the custom object with excsption message and record Id. kindly help me.

trigger  countNoOfContact on Contact (after insert,after update,after delete,after undelete) {
  
HandllingError__c errObj=new HandllingError__c();
    try
    {  
Set<ID> setAccId=new Set<ID>();
   
    if((trigger.IsInsert)||(trigger.IsUndelete)||(trigger.IsUpdate))
    {
  for(Contact con1:trigger.new)
        {   
   if(con1.AccountId!=null)
            {
                setAccId.add(con1.AccountId);
            }
       } 
    }
   
    if((trigger.IsDelete)||(trigger.IsUpdate))
    {       
  for(Contact con1:trigger.new)   // error will generate here, delete operation deals with trigger.old. Problem is :erroris not logged into object.
        {   
   if(con1.AccountId!=null)
            {
    setAccId.add(con1.AccountId);
            }
       }    
    }
   
Map<ID,Account> mapToAccount=new Map<ID,Account>([select id,No_Of_Contacts__c,(select id from Contacts) from Account where id in:setAccId ]);
   
    for(ID accId:mapToAccount.keySet())
    {
        Account acc=mapToAccount.get(accId);
  acc.No_Of_Contacts__c=acc.Contacts.size();
    }    
   
    update mapToAccount.values();
}

catch(DMLException excp)
{
        errObj.Exception_Message__c=excp.getMessage();
        errObj.Line_Number__c=excp.getLineNumber();
        //errObj.Name=excp.getTypeName();
        insert errObj;
    }
}
How to avoid Too Many Future callouts!!!!!!Help me
I want to send contact info of particler lead to my 3rd party...
dis code will fine for 9-records



my trigger is

trigger conupdater on Contact(after insert,after update,before delete)
{
    list <lead> l=[Select id,name,lastname,firstname from lead];
    BuzzBoard_Setting__c bb=[select id,Name,Partner_key__c from BuzzBoard_Setting__c Order by CreatedDate DESC LIMIT 1];
    public String mymethod;
    public String type='Contact'; 
    Map<id,id> contMap=new Map<id,id>();
  
    if(Trigger.isAfter)
    {
      for(contact cont:Trigger.new){     
         if(cont.ContactLead__c!=null){
             contMap.put(cont.id,cont.ContactLead__c);
         }
    }
 
    }  
    if((Trigger.isAfter && Trigger.isInsert))
    {
    for(contact c:Trigger.New){
        mymethod='INSERT';
        if(contMap.containsKey(c.id)){
            LeadChildsUpdater_bb.updatenotes(c.id,contMap.get(c.id),mymethod,type,bb.Partner_key__c);
        }
      
    }
    }

    if((Trigger.isAfter && Trigger.isUpdate))
    {
    for(contact c:Trigger.New){
        mymethod='UPDATE';
        if(contMap.containsKey(c.id)){
            LeadChildsUpdater_bb.updatenotes(c.id,contMap.get(c.id),mymethod,type,bb.Partner_key__c);
        }
    }
    }

    if((Trigger.isBefore && Trigger.isDelete))
    {
    for(contact cont:Trigger.old){     
         if(cont.ContactLead__c!=null){
             contMap.put(cont.id,cont.ContactLead__c);
         }
    }
    for(contact c:Trigger.Old){
        mymethod='DELETE';
        if(contMap.containsKey(c.id)){
            LeadChildsUpdater_bb.updatenotes(c.id,contMap.get(c.id),mymethod,type,bb.Partner_key__c);
        }
    }
    }
}

My Controller class is ::
 
public class LeadChildsUpdater_bb
{
public static string resmessage;
@Future(callout=true)

  public static void updatenotes(String Id,String Lead_Id,String Action,String Type,String Key)
  {
  
    HttpRequest req = new HttpRequest();
    req.setEndpoint('https://demo.mybuzzboard.com/salesforce/assetsSync.php');
    req.setMethod('POST');
    req.setBody('Id='+EncodingUtil.urlEncode(+Id, 'UTF-8')+'&Lead_Id='+EncodingUtil.urlEncode(+Lead_Id, 'UTF-8')+'&Action='+EncodingUtil.urlEncode(+Action, 'UTF-8')+'&Type='+EncodingUtil.urlEncode(+Type, 'UTF-8')+'&Key='+EncodingUtil.urlEncode(+Key, 'UTF-8'));
    Http http = new Http();
    HttpResponse res = http.send(req);
 
    if (res.getStatusCode() == 200)
    {
          
          
             System.debug('---------------------'+res.getBody());
     }
    else
     {
      System.debug('Callout failed: ' + res);
     }

}
}
Hi All...


Every time my DE edition password going to expiring...
 
  for example i reset the my DE edition password,I loged out my user and closed the my browser and again i opening my browser i am logging DE edition getting below error..Can any please help me for this.

User-added image


Thanks,
Cool Sfdc
  • December 24, 2013
  • Like
  • 0
How to call the controller to VF page with parameter?I have two Visual force pages, and two controllers

VF Page:DEMO
<apex:page standardController="Account" extensions="NewAndExistingController" id="demoId" >
    <apex:pageBlock >
     <br> </br>
<apex:outputField value="{!a.Id}"/> <br> </br>
      </apex:pageBlock>
       <apex:form >
     
          <apex:pageBlock >
               <apex:commandButton value="Call visualforce Page" action="{!click}"/>
          </apex:pageBlock>
     </apex:form>
    
  
</apex:page>

VF page:XYZ

<apex:page standardController="Order__c" extensions="MyOrderPadController" >
    <apex:detail />
        <apex:form >
    
        <apex:pageBlock >
       
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="Save"/>
                <apex:commandButton action="{!edit}" value="Edit"/>
                <apex:commandButton action="{!reset}" value="Cancel" />
            </apex:pageBlockButtons>
           
           
            <apex:pageBlockSection columns="2" title="Order Pad">
            <apex:inputField value="{!Order__c.Order_Description__c}"  />
                    <apex:inputField value="{!Order__c.Creat_Date__c}"  />
                    <apex:inputField value="{!Order__c.Closed_Date__c}"  />
                     <apex:inputField value="{!Order__c.Conformation__c}"  /> 
                  
                     
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
   
</apex:page>

Controller:NewAndExistingController

public class NewAndExistingController {Public Account a{get;set;}public String accId;    public NewAndExistingController(ApexPages.StandardController controller) {    try{    a =[select id,name,accountnumber,annualrevenue from account where id=:controller.getId()];    MyOrderPadController.staticVar =a.Id;    }catch(exception e){}    }         public PageReference click() {        PageReference openvfpage = New Pagereference('/apex'+'/XYZ);     openvfpage.setRedirect(false);  return openvfpage ;        }    public NewAndExistingController() {    }   }

Controller: MyOrderPadController
public class MyOrderPadController {    public Order__c order{ get; private set; }        public static  String staticVar;       public String instanceVar {get; set;}           NewAndExistingController  test = new NewAndExistingController ();           public MyOrderPadController ()       {            instanceVar = staticVar;       }    public MyOrderPadController(ApexPages.StandardController sc) {        order = (Order__c)sc.getRecord();       }public PageReference edit()      {            return null;             }     public PageReference reset()     {          PageReference newpage = new PageReference(System.currentPageReference().getURL());          newpage.setRedirect(true);          return newpage;    }     public PageReference save()      {          TRY          {                             order.Name = 'Demo Test Order '+order.Order_Description__c;               order.Order_Description__c =order.Order_Description__c+':====>'+staticVar ;                order.Account__c = '0019000000NAr7bAAD';//for testing only                            IF(order.Conformation__c == TRUE){                                              INSERT order;                     PageReference newpage = new PageReference(System.currentPageReference().getURL());                    newpage.setRedirect(true);                    return newpage;                         }                                                            }                       catch(System.DMLException e)           {            ApexPages.addMessages(e);            SYSTEM.DEBUG('ERROR ORDER PAD CONTROLLER :'+e);            return null;          }        //  After Save, navigate to the default view page:        //return (new ApexPages.StandardController(order)).view();        return null;             }   }

The  "DEMO" VF page added to Account under the one section ,As of  now I am getting  Account Id in the controller "NewAndExistingController" .This controller again called to the VF page "XYZ" .How to access this Account id in controller "MyOrderPadController".

I want get account id in the "MyOrderPadController" Any idea please share with me.

Regards,
Ramesh

Hi

 

I am trying to display more than 2000 records from a list view using standardsetcontroller but i can only display 2000 how to increase the limit

Today we’re excited to announce the new Salesforce Developers Discussion Forums. We’ve listened to your feedback on how we can improve the forums.  With Chatter Answers, built on the Salesforce1 Platform, we were able to implement an entirely new experience, integrated with the rest of the Salesforce Developers site.  By the way, it’s also mobile-friendly.

We’ve migrated all the existing data, including user accounts. You can use the same Salesforce account you’ve always used to login right away.  You’ll also have a great new user profile page that will highlight your community activity.  Kudos have been replaced by “liking” a post instead and you’ll now be able to filter solved vs unsolved posts.

This is, of course, only the beginning  and because it’s built on the Salesforce1 Platform, we’re going to be able to bring you more features faster than ever before.  Be sure to share any feedback, ideas, or questions you have on this forum post.

Hats off to our development team who has been working tirelessly over the past few months to bring this new experience to our community. And thanks to each of you for helping to build one of the most vibrant and collaborative developer communities ever.