• Sureka
  • SMARTIE
  • 959 Points
  • Member since 2009

  • Chatter
    Feed
  • 37
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 39
    Questions
  • 330
    Replies

Hi Everyone, when I faced the too many queries error, then I realize how important this article is 

http://wiki.developerforce.com/page/Apex_Code_Best_Practices

 

And I update all my code, use List for sObject, and put all queries out of loop. \

But it doesn't tell how to Where the update

 

Now I put update into the loop, because I have conditional statement.

 

Is there some method could check if List is changed or not? then update it? 

Hi,

 

Here im trying to create vf page to create  multiple object records in a single VF page.Im able to display the records in the page .In VF page i have created section for account,account qualification ,contact,opportunity and task.It is working fine

 

 

Im trying to implement one more functionality says there is a checkbox in all sections.if i checkbox is true then it should display next section

eg: In account if  the checkbox is true then only account qualification section will display.I know it is possible through apex:actionsupport .Suggest me how can i use it here

 

Below mentioned is VF page and Controller

<apex:page controller="multirecords" tabStyle="Account">
<apex:form>
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Enter Account Information">

<apex:inputField value="{!A.Name}"/>
<apex:inputField value="{!A.Phone}"/>

</apex:pageBlockSection>
<apex:pageBlockSection title="Enter Account Qualification">
<!--<apex:inputField value="{!AQ.name}" required="false"/>-->
<apex:inputField value="{!AQ.Product__c}" required="false"/>
<apex:inputField value="{!AQ.Status__c}" required="false"/>
<apex:inputField value="{!AQ.Sub_Status__c}" required="false"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Enter Contact Information">
<apex:inputField value="{!c.lastname}" required="false"/>
<apex:inputField value="{!c.firstname}" required="false"/>
<apex:inputField value="{!c.email}" required="false"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Enter Opportunity Information">
<apex:inputField value="{!O.name}" required="false"/>
<apex:inputField value="{!O.closedate}" required="false"/>
<apex:inputField value="{!O.stagename}" required="false"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Enter Activities">
<apex:inputField value="{!t.Type}" required="false"/>
<apex:inputField value="{!t.Subject}" required="false"/>
<apex:inputField value="{!t.Status}" required="false"/>
<!--<apex:inputField value="{!t.WhoId}" required="false"/>
<apex:inputField value="{!t.WhatId}" required="false"/>-->
<apex:inputField value="{!t.Description}" required="false"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

public class multirecords {

public Account A {get; set;}
Public Contact C {get; set;}
Public Opportunity O {get; set;}
Public Account_Qualification__c AQ{get;set;}
public Task t{get;set;}
public multirecords()
{
A = new account();
C = new contact();
O = new opportunity();
AQ = new Account_Qualification__c();
t = new Task();
}

public PageReference Save()
{
insert A;

C.Accountid = A.id;


AQ.Account__c=A.Id;
insert AQ;
O.Accountid = A.id;

If (O.name != NULL || C.lastname != NULL)
{
insert O;
insert C;
}
t.WhoId=C.id;
t.WhatId=O.id;
insert t;
return new PageReference('/'+A.id);
}

public static testmethod void multirecords()
{
multirecords M = new multirecords();

Account A = new account(name = 'Test');
insert A;

Contact C = new contact(lastname = 'test', AccountId = A.id);
insert C;

}
}

 Any help would be greatly appreciated

 

Thanks

 

 

  • February 16, 2013
  • Like
  • 0

Hi,

 

I have created a custom field and when am exposing through visual force page it is not visible.

But standard fields are displaying. I check all the sharing settings every thing is fine.

 

Can anybody tell me why it is not?

 

Thanks,

Bujji

  • February 14, 2013
  • Like
  • 0

 

hi

 

I am writing a trigger that updates a customer portal user when the associated contact is updated.  I have the class but only want to run the trigger when the contact has an associated cust portal user - I can't seem to find reference to this at all. y Trigger would be something like

 

trigger UpdateUserfromContact on Contact (after update) {

 

        Contact c =  Trigger.new[0];

        

        //And only if the contact has a related Customer Portal User associated

        

            UpdatePortalUserfromContact.updateUser(c.Id);

      

}

 

thanks

Hi there,

 

I created a page.

But when I click in the button to save. Tha page didn't save.

 

<apex:page standardController="case">
    <apex:form>
        <apex:sectionHeader title="Novo Chamado"/>
        <apex:pageBlock mode="edit">
<apex:pageBlockButtons location="bottom"> <apex:commandButton value="Criar Chamado" action="{!Save}"/> <apex:commandButton value="Cancelar" action="{!Cancel}" immediate="true"/> </apex:pageBlockButtons> <apex:pageBlockButtons location="top"> <apex:commandButton value="Criar Chamado" action="{!Save}"/> <apex:commandButton value="Cancelar" action="{!Cancel}" immediate="true"/> </apex:pageBlockButtons>
<apex:pageBlockSection columns="2" id="tipoderegistro" > <apex:pageBlockSectionItem > <apex:outputLabel value="Tipo de Registro"/> <apex:actionRegion > <apex:inputField value="{!case.RecordTypeId}"> <apex:actionSupport event="onchange" rerender="tipoderegistro"/> </apex:inputField> </apex:actionRegion> </apex:pageBlockSectionItem> <apex:outputLabel value="Motivo"> <apex:actionRegion > <apex:inputField value="{!case.motivo__c}"> <apex:actionSupport event="onchange" reRender="dados" /> </apex:inputField> </apex:actionRegion> </apex:outputLabel> </apex:pageBlockSection>
<apex:outputPanel id="dados"> <apex:pageBlockSection title="Cheque devolvido" rendered="{!case.motivo__c == 'Cheque devolvido'}"> <apex:inputfield value="{!case.dados_de_retorno__c}" required="true"/> </apex:pageBlockSection> </apex:outputPanel>
</apex:pageBlock> </apex:form> </apex:page>

 

I'm putting the entire code, cause I don't have any idea why my page didn't save.

If someone know how I do this, or a topic, a blog. Will be a great help for me.

 

Thanks,

Hello,

 

I have an object representing an entry in a visitor log. That object has a few custom fields, Brought_by_Employee__c, Checking_In__c, Contact__c, Escort__c, Time_In__c, Time_Out__c, Title__c and Visitor_Name__c. Thus far, I've built a VisualForce page that has inputText components so that the user can type in their name, the name of the company they work for, their title in the company, etc. The page is using a custom controller that I've written with the visitor's name stored as a String. I wanted to make it easier for my users to check in if they've checked in previously and the best way to do that seemed to be to use inputFields instead because they give you a lookup button next to the inputField. At first it seemed like I would have to rewrite my custom controller to be used as an extension to the Contact standard controller in order to get the inputField working right. Then I tried just creating an empty visitor log entry, because it has a contact field so I thought that perhaps that would correclty bring up the lookup list. It did, but now I can't think of a way to get just the name of the contact they selected. Even though all it seems to be doing is filling in the inputField with the name of the contact, it looks like it's really storing the contact record itself. I need the name of the contact sent back to the controller so that the rest of the logic can be executed. I tried referencing the "phantom" log entry's Contact field to see if that was where the selected record on the VF page had been stored, but this yields the error "Error: You must enter a value" underneath the inputField. Not to mention that another inputField that was previously only required if a check box was selected also gives this error if it is not filled in. Is it possible to get this to work without rewriting my controller as an extension or is my attempt to get lookup buttons working a lost cause?

 

The first line in the constructor of the controller sets the String visitorName to testLog.Contact__r.Name. This was my test to see if the selected contact had been stored in the phantom record I had created in order to access the existing contact records. 

 

I greatly thank anyone that can give me some insight here.

Hi,

I am using Field set to display the transpose table. In the field set I am having 10 fields, among them I have to apply style to the particular field. Eg,.3rd field. How to do this,Guide me to resolve this issue.

  • January 30, 2013
  • Like
  • 0

I need to create a form for a refer-a-friend email campaign which captures 6 names and email addresses and converts them to leads. The six new leads also need to be linked to the person who referred them. My concern is how can I use one web to form to capture multiple leads.

 

Any help will be really really appreciated

 

Thanks

Jedd

Hi, i rewrote this post because I realized I wasnt being clear enough. Heres what im trying to do: when a lead is converted the parent account in lead needs to go over to the parent account in accounts. I found quickly that standard and custom fields cant be mapped together, but that a trigger could pull the data on conversion. I found a trigger here that I've attempted to use and I dont get any syntax errors with it, but when a lead is converted the parent account in accounts is left blank. Any help or suggestions would be appreciated, thanks!

heres the trigger:

 

trigger populateParentAccount on Account (before Insert){
  List<Lead> convertedLeads=[SELECT Id, ConvertedAccountID, Parent_Account__c
  FROM Lead WHERE IsConverted=True AND ConvertedAccountId IN :trigger.new];
  Map<ID,ID> acctParentMap=new Map<ID,ID>();
  for (lead l: convertedleads){
    acctParentMap.put(l.ConvertedAccountId,l.Parent_Account__c);
  }
  for (account a:trigger.new){
   if (acctParentMap.containsKey(a.Id)){
      a.ParentID=acctParentMap.get(a.Id);
      
   }
  }
}

 

  • January 16, 2013
  • Like
  • 0

Hi everyone,

Is there a lastmodifiedby and lastmodifieddate for list views? If yes, where can we see that?

 

Thanks,

Anoop

Hi,

 

I want to create a clone button which will clone the record in edit mode and user want can change some value and save the record.

 

But i have status field in cloned record which should be new and user can submit for approval after the status will be approved then i need to change the status of the record from which we are cloning this record to change to completed automatically.

 

Means based on cloned record status, i need to change the status of the rcord from which we r cloning new record and it should be automatically.how i can achieve this.

 

Thanks in advance!!!!!!

 

Thanks

 

  • April 11, 2012
  • Like
  • 0

Class is use override view record. I can open but Test Class not work ! 

 

public class genMembershipConditionsPDF{

    public genMembershipConditionsPDF(ApexPages.StandardController controller) {
             gotoPDFPage();
    }
    
   
    public Pagereference gotoPDFPage()
        {
            return new Pagereference('/apex/MembershipConditionsPDF?Id='+Apexpages.Currentpage().getParameters().get('Id'));  
        }
}

 

@isTest
private class test_genMembershipConditionsPDF 
{
    static testMethod void myUnitTest() {
    
        Account Acc = new Account();
        Acc.name = 'Test';
        insert Acc;
         
        Membership_Conditions__c MC = new Membership_Conditions__c();
        MC.Copy_of_organisational_structure__c = True;
        MC.OrganizationsID__c = Acc.id;
        MC.Designation__c = 'Test';
        insert MC;
    
        ApexPages.StandardSetController controller = new ApexPages.StandardSetController(MC);
        genMembershipConditionsPDF sc = new genMembershipConditionsPDF();
        PageReference S = sc.gotoPDFPage();

    }
}

 

Thank you so much.

I have some Rich Text Fields and instead of displaying the Rich Text they seem to be displaying the mark-up instead.

 

How do I properly display a Rich Text Field on a VisualForce page?

Hi all, Any hints on how to get person accounts made available?

 

From the documentation I've read it looks like I need to request it from SF directly, but for the life of me I can't seem to locate a method to make that request.

 

Thanks

-M

Hi,

 

I am facing problem in making Reports visible to Partner Portal user.After logging in as partner when I click on Report tab I get the error message as: Insufficient privilages.

 

I have given permission for Report tab in my Partner user profile.However I am not able to customize the permission for certain custom objects in Partner user profile.

 

Please anyone can suggest how can I make reports visible to Partner.

 

 

Thanks,

Srilakshmi B

 

Hi,

 

I have created one custom object and in that object's page layout i need to create a lookup field i.e. for another standard object. On the custom object's page layout i have four another fields ( from the standard object) in read only form. And all these four fields value will get populated based on the lookup field's selected value.

 

I hope i am able to make you understand my issue.

 

Please help me as i am a fresher and new to this technology. I am desperate to learn this and somehow i come to know that i may get solution over here. Thanks

Hi,

I have the following custom objects:
1. Purchase Order(master) and Purchase_order_lines(detail)
2.Purchase_Order_Receipt(master) and Purchase_Order_ Receipt_lines(detail).

Purchase_Order_Receipt has a lookup relationship with Purchase Order(not able to create a master detail :"You cannot convert this field to a master-detail relationship because this would exceed the maximum depth of a master-detail relationship")

Whenever a new Purchase Order Receipt is created,a trigger should create Purchase_order_receipt_lines and populate them with the purchase order lines.

I have tried writing the following trigger:



trigger rec on Purchase_Order_Receipt__c (after insert)
{

Purchase_Order_Receipt__c to=trigger.new[0];
 
Purchase_Order__c p=[select id from Purchase_Order__c where id=:to.Purchase_Order__c];

list<Purchase_Order_Line__c> pl=[select id,Quantity__c,Unit_Cost__c,Product__c,purchase_order__c  from Purchase_Order_Line__c where Purchase_Order__c=:p.id ];


for(Purchase_Order_Line__c pli:pl)

{

Purchase_Order_Receipt_Lines__c rl=new Purchase_Order_Receipt_Lines__c();


rl.Product__c=pli.Product__c;
rl.Purchase_Order__c=pli.purchase_order__c;


insert rl;
}
}

But this is erroring out :
"Apex trigger rec caused an unexpected exception, contact your administrator: rec: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Purchase Order Receipt]: [Purchase Order Receipt]: Trigger.rec: line 25, column 1".


Please help.

I'm a little confused on how much we can customize in the softphone layout so I'm hoping someone could help shed some light.

 

We are in the process of deploying a CTI adapter (custom build) for OUTBOUND calling.

 

The default soft phone layout has the fields Subject, Name and comments in it and we'd like to add more fields.

 

Is this possible?- I 've read elsewhere that currently this is not configurable. Please advise

 

 

 

 

 

We want to start doing an auto-numbering of our opportunities but want to customize the convention.

 

We have different types of agreements - Contracts(CON, Subsequent product orders (SPO), Amendments (AMD) and would like to have the numbering be prefaced with the agreement type 3 letter code.

 

I figure the code can be a custom field that is determined by the Agreement type selected. But then I want to concatenate that three letter code with an auto-numbering.

 

I really do not care about the numbers, as long as the end result is unique -  not repeated.

 

So it could be CON00000000001, SPO00000000002, CON00000000003, AMD00000000004   and so on.....

 

Thanks for your ideas.

 

Jane

 

 

Hey folks,

 

New to Salesforce and the community; I'd appreciate help on a cross object formula field problem.

 

I've set up a custom field in my Opportunities area as a name lookup to link the opportunity to a specific contact at the target company.  I'd like that lookup to also pull the mailing address, phone number and email for the contact into the opportunity record.

 

I was able to use simple cross object formula fields to pull the phone and the email by using the format ("custom lookup field name"__r.Phone) and ("custom lookup field name"__r.Email), but I can't see to get it to work for ("custom lookup field name"__r.MailingAddress).

 

I've tried various iterations of the MailingAddress (Mailing Address; Mailing; Address; Mailing_Address) but all deliver syntax errors.

 

Anyone know what I'm doing wrong?

 

Thanks for your help.

Hi,

I am trying to refresh a case record tab from an inline VF page in Case. I am fetching the corresponding case tab Id using "enclosingPrimaryTab" and trying to refresh the corresponding case record tab. "refreshPrimaryTabById" not working in this case. 

Has anyone tried using "refreshPrimaryTabById"? Please provide your suggestion. 

Thanks
Sureka
  • August 04, 2015
  • Like
  • 0
Hi All,

I have enabled "Opportunity Revenue" and "Overlay Splits" forecasts in my org. 

Opportunity Revenue Forecasts shows up the list of Opportunities I own. Overlay Splits forecasts only shows the list of Opportunities where I have Overlay Split % contribution. It does not show up the list of Opportunities I own. 

Is it possible to show up the List of Opportunities I own + Opportunities where I have Overlay Split Contribution in one view?

Thanks
Sureka
  • January 22, 2015
  • Like
  • 0
Hi All, 

I am trying to update Profile using Metadata API in Apex Class:

MetadataService.IReadResult resultValue = service.readMetadata(metadataType,new List<String>{'ContractManager'});   
                    for(MetadataService.Metadata md: resultValue.getRecords())
                    {
                    MetadataService.Profile pr = new MetadataService.Profile();
                    pr = (MetadataService.Profile)md;

                    for(MetadataService.ProfileApexClassAccess pop: pr.classAccesses)
                    {
                        if(pop.apexClass == 'TestApexClass')
                            pop.enabled = true;
                    }
                    for(MetadataService.ProfileApplicationVisibility pvp: pr.applicationVisibilities)
                    {
                        if(pvp.application== 'TestApplication')
                            pvp.visible= true;
                    }

MetadataService.Saveresult[] results = service.updateMetadata(new MetadataService.Metadata[] {pr});

Above saveResult is not returning any error. But the "success" variable is showing false. Am I missing anything in the above code?
Is it possible to make Profile updates via Metadata API?

Thanks
Sureka
  • December 11, 2014
  • Like
  • 0
Hi All,

I am trying to insert members into OpporutnitySplit with Apex Class:

OpportunitySplit opptySplit= new OpportunitySplit();               
opptySplit.OpportunityId = Id of Opportunity;
opptySplit.SplitPercentage = 100;
opptySplit.SplitTypeId = Id of Overlay Split ;
opptySplit.SplitOwnerId =Id of User;
insert opptySplit;

Getting the following error:

Invalid field SplitTypeId for SObject OpportunitySplit

Thanks
Sureka
  • November 12, 2014
  • Like
  • 0
Hi,

I am getting the following exception while making "listMetadata" API Call.

Web service callout failed: WebService returned a SOAP Fault: INVALID_SESSION_ID: This session is not valid for use with the API faultcode=sf:INVALID_SESSION_ID faultactor=

the same code was working fine in other sandbox. While moving to another sandbox, I got the above error. 

Any suggestions?

Thanks

Hi,

I am reading the Metadata of Validation Rules using the following:

MetadataService.ReadResult resultValue = service.readMetadata('ValidationRule',fullNames);

The above statement works fine and returns the results. 

Now how do I get to read the individual validation rules? If I try to parse(MetadataService.ValidationRule vr = (MetadataService.ValidationRule)md;), it is giving the following exception:

Invalid conversion from runtime type MetadataService.Metadata to MetadataService.ValidationRule

Any Idea?? 
Thanks
Hi All,

I am using the following code to read the details of 10 validation Rules. Following is the code:

             MetadataService.MetadataPort service = createService();           
            List<MetadataService.ListMetadataQuery> queries = new List<MetadataService.ListMetadataQuery>();      
            MetadataService.ListMetadataQuery queryLayout = new MetadataService.ListMetadataQuery();
            queryLayout.type_x = 'ValidationRule';
            queries.add(queryLayout);   
            if(Limits.getHeapSize()<3000000)
            {
            MetadataService.FileProperties[] fileProperties = service.listMetadata(queries, 30);
            List<String> fullNames = new List<String>();
            if(fileProperties!=null)
            {
                for(MetadataService.FileProperties fileProperty : fileProperties)
                {
                    if(fullNames.size()<10 && fileProperty.fullName!=null && fileProperty.ManageableState == 'unmanaged')
                    {
                        fullNames.add(fileProperty.fullName);
                    }
                }
            }

            MetadataService.ReadResult resultValue = service.readMetadata('ValidationRule',fullNames);
-- Error: Web service callout failed: Unable to parse callout response. Apex type not found for element active

Let me know what is wrong in the above call.

Thanks

Hi,

I am trying to query CustomLabels using Metadata API. I am using the following code:

MetadataService.MetadataPort service = createService();           
            List<MetadataService.ListMetadataQuery> queries = new List<MetadataService.ListMetadataQuery>();      
            MetadataService.ListMetadataQuery queryLayout = new MetadataService.ListMetadataQuery();
            queryLayout.type_x = 'CustomLabel';
            queries.add(queryLayout);     
            MetadataService.FileProperties[] fileProperties = service.listMetadata(queries, 30);


The above code is giving the following exception:

IO Exception: Exceeded max size limit of 3000000

I don't have any other code in my controller. Is there a way to limit the no of custom labels? Let me know

Thanks
Hi,

I am trying to query CustomLabels using Metadata API. I am using the following code: 

MetadataService.MetadataPort service = createService();            
            List<
MetadataService.ListMetadataQuery> queries = new List<MetadataService.ListMetadataQuery>();       
            
MetadataService.ListMetadataQuery queryLayout = new MetadataService.ListMetadataQuery();
            queryLayout.type_x = 'CustomLabel';
            queries.add(queryLayout);      
            
MetadataService.FileProperties[] fileProperties = service.listMetadata(queries, 10);

The above code is giving the following exception:

Web service callout failed: WebService returned a SOAP Fault: INVALID_TYPE: Cannot use: CustomLabel in this version faultcode=sf:INVALID_TYPE faultactor=  Error

In the documentation it is mentioned that we can query the custom label. Please let me know if there is something wrong in the above code.

Thanks
Hi All,

I want to get the list of columns/Fields for Reports using Metadata/Tooling API. Please let me know how to do it. 

Thanks

Hi,

 

I am facing a strange issue in Building a URL:

 

I have the following URL - where I have two Ids - 00NA0000009yWHr & 00NA0000009yWHR. These are different fields. 

 

But when the fields are rendered in UI, it is just changed to one id . Please help me in resolving the issue.

 

/a6i/e?00NA0000009yWHr=Created+in+error&00NA0000009yWHR=RKI+Account&retURL=%2F001J000000ZaCxGIAV
/a6i/e?00NA0000009yWHR=RKI+Account&retURL=%2F001J000000ZaCxGIAV

Hi,

I have a requirement to disable the Session Time out for Partner Portal Users. ie. Partner Portal User should never be logged out even if the session is inactive. Is it possible? If Yes, Please let me know how to implement it.

Thanks
Bhuvana

  • March 29, 2013
  • Like
  • 0

Hi,

I have the following code in my controller & VF page.


<apex:page controller="testing">
    <apex:form >
          <apex:pageBlockSection title="Dimensions">
          <apex:repeat var="mp" value="{!listMap}">
          <apex:repeat value="{!listMap[mp]}" var="mp1">
              <apex:repeat value="{!mp1.getfields}" var="fldSet">
                  <apex:inputField value="{!acc[fldSet]}"/>    - Null pointer exception here
              </apex:repeat>
              </apex:repeat>
              </apex:repeat>
          </apex:pageBlockSection>
 
        </apex:pageBlock>

    </apex:form> 
</apex:page>


public  class testing
{

    public testing()
    {
    }

    public Account acc { get; set; }
   
    public class WrClass
    {
        public List<Schema.FieldSetMember> getFields{get;set;}
    }
   
    public Map<Integer, WrClass> listMap
    {
        get
        {
            listMap = new Map<Integer, WrClass>();
     WrClass ff  =new WrClass();
            ff.getFields = SObjectType.Account.FieldSets.Bhu_Managed_Pac__asdfasdf.getFields();
            listMap.put(1, ff);
            return listMap;
        }
        set;
    }   
   
}

When I am trying to save the VF page, I am getting the following error:

 

Error: Java.lang.NullPointerException
Error: null

 

This exception occurs only when a map is used. The code is working fine if List<WrClass> is used instead of Map<Integer, WrClass>

 

Any Idea?

 

Thanks
Sureka

Hi,

 

I have the following code inside the repeat variable in the VF page:

<apex:repeat value="{!qa.getFieldsSetMemb}" var="ff" >         
<apex:outputField value="{!acc[ff.fieldPath]}"/>
</apex:repeat>

 where "qa.getFieldsSetMemb" returns "List<Schema.FieldSetMember>" 

acc is the name of the account variable.

 

I am trying to dynamically display a field set in the above code.

 

While saving the VF page, I m getting the following error:

 



 

Error: java.lang.NullPointerException

Error: null



Any Idea?

 

Thanks

Bhuvana

Hi All,

 

I have written an apex class to display history related list of Lead record. I am using the following code to cover the test method:
             

LeadHistory leadHist1 = new LeadHistory(LeadId =lead.Id,Field='Created');
insert leadHist1;
LeadHistory leadHist2 = new LeadHistory(LeadId = lead.Id,Field='status');
insert leadHist2;   

 

 But, I am not able to cover few lines ie. value change in the lead object(oldValue & newValue). Because, oldValue & newValue fields of History object are not writable. Please let me know, if you have any idea on this.

 

Thanks

Bhuvana

  • August 16, 2011
  • Like
  • 0

Hi All,

 

I have a try catch block in my apex class.

 

try

{

///Webservice call

}

catch(CallOutException e)

{

}

 

As webservice call will not be made in test methods, i need to throw CalloutException explicitly in test class.

 

Has anyone tried throwing System defined Exception?

 

Thanks

Sureka

Hi All,

 

I am displaying History Related lists in Visualforce using the below code:

 

 

<apex:dataTable value="{!Object.histories}" var="history" rowClasses="odd,even" cellspacing="15" width="100%">
            <apex:column >
                <apex:facet name="header"></apex:facet>
                <apex:facet name="footer"></apex:facet>
                <apex:outputText value="{0,date,MM/dd/yyyy HH:mm }">
                <apex:param value="{!history.createddate}" />
                </apex:outputText>
            </apex:column>
            <apex:column >
                <apex:facet name="header">Field</apex:facet>
                <apex:facet name="footer"></apex:facet>
                <b> <apex:outputText value="{!history.field}"/></b>
                </apex:column>
            <apex:column >
                <apex:facet name="header">Editied By</apex:facet>
                <apex:facet name="footer"></apex:facet>
                <apex:outputText value="{!history.createdby.name}"/>
            </apex:column>
            <apex:column >
                <apex:facet name="header">Old Value</apex:facet>
                <apex:facet name="footer"></apex:facet>
                <apex:outputText value="{!history.oldvalue}"/>
            </apex:column>
            <apex:column >
                <apex:facet name="header">New Value</apex:facet>
                <apex:facet name="footer"></apex:facet>
                <apex:outputText value="{!history.newvalue}"/>
            </apex:column>
        </apex:datatable>

 

 

The history table is appearing in the ascending order(ie, "Created" is coming first, followed by the other field trackings).

 

But I need to display descendingly (by Created Date).

 

Any Suggestions?

 

Thanks

Bhuvana

  • February 09, 2011
  • Like
  • 0

Hi All,

 

I m querying the NotesAndAttachments using this query, "Select Id, IsNote, Parent.Type,Parent.Name, Title, OwnerId, CreatedDate, CreatedById,  CreatedBy.Name,LastModifiedDate, LastModifiedById From NotesAndAttachments". I am trying to display Parent.Type in the visualforce. I encountered the below error:

 

Validation Errors While Saving Record(s) There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Type: value not of required type: Project Information(db=a0Z,api=RIT_ProjectInformation__c)".

 

Any Suggestions?

 

Thanks

 

  • January 31, 2011
  • Like
  • 0

Hi All,

 

I am displaying a VF page, inline with standard pagelayout, to display a field labe and value. But the alignment of the page changes when the side bar is expanded or collpased, as shown in the below screenshot:

 

Eg.

 

1.  Sidebar expanded

 

abclabel    abcvalue

vflabel        vfvalue

 

2. Sidebar collpased

 

abclabel    abcvalue

             vflabel        vfvalue

 

 

vflabel & Vfvalue is the inline visualforce page. Thus the alignment of the page changes, when the sidebar is expanded & collapsed. I found this is nothing to do with the parameters in VF page.

 

Possible solution would be to check whether the sidebar is expanded or collpased & to set VF page styleclass accordingly. I am not sure, how to check whether the sidebar is expanded or collapsed.

 

Please suggest if there are other alternatives.

 

Thanks

Bhuvana

  • January 26, 2011
  • Like
  • 0

Hi All,

 

I am using the below code to display History related lists in visualforce.

<apex:dataTable value="{!Object.histories}" var="history" rowClasses="odd,even" cellspacing="15" width="100%">
<apex:column >
<apex:facet name="header"></apex:facet>
<apex:facet name="footer"></apex:facet>
<apex:outputText value="{0,date,MM/dd/yyyy HH:mm }">
<apex:param value="{!history.createddate}" />
</apex:outputText>
</apex:column>
<apex:column >
<apex:facet name="header">Field</apex:facet>
<apex:facet name="footer"></apex:facet>
<b> <apex:outputText value="{!history.field}"/></b>
</apex:column>
<apex:column >
<apex:facet name="header">Editied By</apex:facet>
<apex:facet name="footer"></apex:facet>
<apex:outputText value="{!history.createdby.name}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Old Value</apex:facet>
<apex:facet name="footer"></apex:facet>
<apex:outputText value="{!history.oldvalue}"/>
</apex:column>
<apex:column >
<apex:facet name="header">New Value</apex:facet>
<apex:facet name="footer"></apex:facet>
<apex:outputText value="{!history.newvalue}"/>
</apex:column>
</apex:datatable>

But in "Field" column, its displaying API name of the field. Is there a way to display field label instead of API Name?

 

Or can u suggest any other way to display History related lists with standard controller(without Apex).

 

Thanks

Sureka

 

 

  • January 14, 2011
  • Like
  • 0
Hi All,

I am using the following code to read the details of 10 validation Rules. Following is the code:

             MetadataService.MetadataPort service = createService();           
            List<MetadataService.ListMetadataQuery> queries = new List<MetadataService.ListMetadataQuery>();      
            MetadataService.ListMetadataQuery queryLayout = new MetadataService.ListMetadataQuery();
            queryLayout.type_x = 'ValidationRule';
            queries.add(queryLayout);   
            if(Limits.getHeapSize()<3000000)
            {
            MetadataService.FileProperties[] fileProperties = service.listMetadata(queries, 30);
            List<String> fullNames = new List<String>();
            if(fileProperties!=null)
            {
                for(MetadataService.FileProperties fileProperty : fileProperties)
                {
                    if(fullNames.size()<10 && fileProperty.fullName!=null && fileProperty.ManageableState == 'unmanaged')
                    {
                        fullNames.add(fileProperty.fullName);
                    }
                }
            }

            MetadataService.ReadResult resultValue = service.readMetadata('ValidationRule',fullNames);
-- Error: Web service callout failed: Unable to parse callout response. Apex type not found for element active

Let me know what is wrong in the above call.

Thanks

Hi,

I am trying to refresh a case record tab from an inline VF page in Case. I am fetching the corresponding case tab Id using "enclosingPrimaryTab" and trying to refresh the corresponding case record tab. "refreshPrimaryTabById" not working in this case. 

Has anyone tried using "refreshPrimaryTabById"? Please provide your suggestion. 

Thanks
Sureka
  • August 04, 2015
  • Like
  • 0
Hi All,

I have enabled "Opportunity Revenue" and "Overlay Splits" forecasts in my org. 

Opportunity Revenue Forecasts shows up the list of Opportunities I own. Overlay Splits forecasts only shows the list of Opportunities where I have Overlay Split % contribution. It does not show up the list of Opportunities I own. 

Is it possible to show up the List of Opportunities I own + Opportunities where I have Overlay Split Contribution in one view?

Thanks
Sureka
  • January 22, 2015
  • Like
  • 0
Hi,

I am getting the following exception while making "listMetadata" API Call.

Web service callout failed: WebService returned a SOAP Fault: INVALID_SESSION_ID: This session is not valid for use with the API faultcode=sf:INVALID_SESSION_ID faultactor=

the same code was working fine in other sandbox. While moving to another sandbox, I got the above error. 

Any suggestions?

Thanks

Hi All,

I am using Metadata API to get information about org. I want to retrieve all custom fields present in my org. I am using listMetadata() method which returns list of components. Below is my code:

MetadataService.MetadataPort service = createService();            
        List<MetadataService.ListMetadataQuery> queries = new List<MetadataService.ListMetadataQuery>();       
        MetadataService.ListMetadataQuery queryLayout = new MetadataService.ListMetadataQuery();
        //queryLayout.folder = MetaDataFolder;
        queryLayout.type_x ='CustomField';
        queries.add(queryLayout);      
        MetadataService.FileProperties[] fileProperties; 
        try{    
         fileProperties= service.listMetadata(queries, 29); //here 29 is api version
        }catch(exception e){
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info,e.getMessage()));
        }

I am get exception as "IO Exception: Exceeded max size limit of 3000000". I know that number of custom fields present in my org is to much and the response that I am getting exceeding the allowed limit of 3MB. I want to list all custom fields present in my org. Same exception is coming when I am retrieving few other metadata(like all profile). Above mentioned code works fine in my developer org but in sandbox, its not working as number of metadata components is too much in my sandbox. 

I tried retrieving the components using Workbench which also uses metadata api. Workbench retrieved all components successfully. So there will be some mechanism in metadata API through which I can retrieve large number of components. I saw few post where people says to retrieve info in different chunks by spliting single request in 2 or 3 different request. But in my case, I am not able to split my request as I want all custom fields.

Can anyone help me on this .

Thanks in advance.

Regards,
Sunil kumar

My use case is to retrieve the list of all email alerts in my org with their name, description, sender-address, recipients, & CC'ed recipients. For this I have come up with the below code which I execute from the anonymous exec in dev console.

<pre>
MetadataService.MetadataPort service = MetadataService.createService();

List<MetadataService.ListMetadataQuery> queries = new List<MetadataService.ListMetadataQuery>();
MetadataService.ListMetadataQuery queryEmailAlert = new MetadataService.ListMetadataQuery();
queryEmailAlert.type_x = 'WorkflowAlert';
queries.add(queryEmailAlert);

//get metadatalist
MetadataService.FileProperties[] properties = service.ListMetaData(queries,30);
for(MetadataService.FileProperties emailalert:properties){
        system.debug('Email Alert Name:::'+emailalert.fullname);

       //read metadata
       MetadataService.Metadata[] mdInfo = service.readMetadata('WorkflowAlert',new String[]{emailalert.fullname}).records;
        for(MetadataService.Metadata md:mdInfo){
            MetadataService.WorkflowAlert alert = (MetadataService.WorkflowAlert)md;
            system.debug('description:::'+alert.description);
            system.debug('From:::'+alert.senderAddress);
        }
}
</pre>

But the execution stops with the error:
<pre>
"incompatible types since an instance of MetadataService.Metadata is never an instance of MetadataService.WorkflowAlert"
</pre>

I believe it doesn't allow Metadata to be Typecast to WorkflowAlert. But I am not sure if the results can be achieved without doing that.
Can you please help letting me know where I am going wrong here?
Greatly appreciate your help! Many Thanks!

Note:
Since the class generated by the MetadataAPI wsdl exceeds my Apex Limit, I have cut it short to contain only what is required to achieve the required use case. Below is my short version of the MetadataService class used here for additional info, in case you like to have a look.

<pre>
//Generated by wsdl2apex
public class MetadataService {
    public class MetadataPort {
        public String endpoint_x = 'https://cs30.salesforce.com/services/Soap/m/30.0';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        public MetadataService.SessionHeader_element SessionHeader;
        public MetadataService.DebuggingInfo_element DebuggingInfo;
        public MetadataService.CallOptions_element CallOptions;
        public MetadataService.DebuggingHeader_element DebuggingHeader;
        private String SessionHeader_hns = 'SessionHeader=http://soap.sforce.com/2006/04/metadata';
        private String DebuggingInfo_hns = 'DebuggingInfo=http://soap.sforce.com/2006/04/metadata';
        private String CallOptions_hns = 'CallOptions=http://soap.sforce.com/2006/04/metadata';
        private String DebuggingHeader_hns = 'DebuggingHeader=http://soap.sforce.com/2006/04/metadata';
        private String[] ns_map_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata', 'MetadataService'};
        public MetadataService.FileProperties[] listMetadata(MetadataService.ListMetadataQuery[] queries,Double asOfVersion) {
            MetadataService.listMetadata_element request_x = new MetadataService.listMetadata_element();
            MetadataService.listMetadataResponse_element response_x;
            request_x.queries = queries;
            request_x.asOfVersion = asOfVersion;
            Map<String, MetadataService.listMetadataResponse_element> response_map_x = new Map<String, MetadataService.listMetadataResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://soap.sforce.com/2006/04/metadata',
              'listMetadata',
              'http://soap.sforce.com/2006/04/metadata',
              'listMetadataResponse',
              'MetadataService.listMetadataResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.result;
        }
        public MetadataService.ReadResult readMetadata(String type_x,String[] fullNames) {
            MetadataService.readMetadata_element request_x = new MetadataService.readMetadata_element();
            MetadataService.readMetadataResponse_element response_x;
            request_x.type_x = type_x;
            request_x.fullNames = fullNames;
            Map<String, MetadataService.readMetadataResponse_element> response_map_x = new Map<String, MetadataService.readMetadataResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://soap.sforce.com/2006/04/metadata',
              'readMetadata',
              'http://soap.sforce.com/2006/04/metadata',
              'readMetadataResponse',
              'MetadataService.readMetadataResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.result;
        }
    }
    public class ReadResult {
        public MetadataService.Metadata[] records;
        private String[] records_type_info = new String[]{'records','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'};
        private String[] field_order_type_info = new String[]{'records'};
    }
    public class Metadata {
        public String fullName;
        private String[] fullName_type_info = new String[]{'fullName','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'};
        private String[] field_order_type_info = new String[]{'fullName'};
    }
    public class WorkflowEmailRecipient {
        public String field;
        public String recipient;
        public String type_x;
        private String[] field_type_info = new String[]{'field','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'};
        private String[] recipient_type_info = new String[]{'recipient','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'};
        private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'};
        private String[] field_order_type_info = new String[]{'field','recipient','type_x'};
    }
    public class WorkflowAlert {
        public String[] ccEmails;
        public String description;
        public Boolean protected_x;
        public MetadataService.WorkflowEmailRecipient[] recipients;
        public String senderAddress;
        public String senderType;
        public String template;
        private String[] ccEmails_type_info = new String[]{'ccEmails','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'};
        private String[] description_type_info = new String[]{'description','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] protected_x_type_info = new String[]{'protected','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] recipients_type_info = new String[]{'recipients','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'};
        private String[] senderAddress_type_info = new String[]{'senderAddress','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'};
        private String[] senderType_type_info = new String[]{'senderType','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'};
        private String[] template_type_info = new String[]{'template','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'};
        private String[] field_order_type_info = new String[]{'ccEmails','description','protected_x','recipients','senderAddress','senderType','template'};
    }
    public class DebuggingInfo_element {
        public String debugLog;
        private String[] debugLog_type_info = new String[]{'debugLog','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'};
        private String[] field_order_type_info = new String[]{'debugLog'};
    }
    public class CallOptions_element {
        public String client;
        private String[] client_type_info = new String[]{'client','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'};
        private String[] field_order_type_info = new String[]{'client'};
    }
    public class DebuggingHeader_element {
        public MetadataService.LogInfo[] categories;
        public String debugLevel;
        private String[] categories_type_info = new String[]{'categories','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'};
        private String[] debugLevel_type_info = new String[]{'debugLevel','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'};
        private String[] field_order_type_info = new String[]{'categories','debugLevel'};
    }
    public class SessionHeader_element {
        public String sessionId;
        private String[] sessionId_type_info = new String[]{'sessionId','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'};
        private String[] field_order_type_info = new String[]{'sessionId'};
    }
    public class LogInfo {
        public String category;
        public String level;
        private String[] category_type_info = new String[]{'category','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] level_type_info = new String[]{'level','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'};
        private String[] field_order_type_info = new String[]{'category','level'};
    }
    public class listMetadataResponse_element {
        public MetadataService.FileProperties[] result;
        private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'};
        private String[] field_order_type_info = new String[]{'result'};
    }
    public class ListMetadataQuery {
        public String folder;
        public String type_x;
        private String[] folder_type_info = new String[]{'folder','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'};
        private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'};
        private String[] field_order_type_info = new String[]{'folder','type_x'};
    }
    public class FileProperties {
        public String createdById;
        public String createdByName;
        public DateTime createdDate;
        public String fileName;
        public String fullName;
        public String id;
        public String lastModifiedById;
        public String lastModifiedByName;
        public DateTime lastModifiedDate;
        public String manageableState;
        public String namespacePrefix;
        public String type_x;
        private String[] createdById_type_info = new String[]{'createdById','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] createdByName_type_info = new String[]{'createdByName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] createdDate_type_info = new String[]{'createdDate','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] fileName_type_info = new String[]{'fileName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] fullName_type_info = new String[]{'fullName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] id_type_info = new String[]{'id','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] lastModifiedById_type_info = new String[]{'lastModifiedById','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] lastModifiedByName_type_info = new String[]{'lastModifiedByName','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] lastModifiedDate_type_info = new String[]{'lastModifiedDate','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] manageableState_type_info = new String[]{'manageableState','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'};
        private String[] namespacePrefix_type_info = new String[]{'namespacePrefix','http://soap.sforce.com/2006/04/metadata',null,'0','1','false'};
        private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'};
        private String[] field_order_type_info = new String[]{'createdById','createdByName','createdDate','fileName','fullName','id','lastModifiedById','lastModifiedByName','lastModifiedDate','manageableState','namespacePrefix','type_x'};
    }
    public class listMetadata_element {
        public MetadataService.ListMetadataQuery[] queries;
        public Double asOfVersion;
        private String[] queries_type_info = new String[]{'queries','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'};
        private String[] asOfVersion_type_info = new String[]{'asOfVersion','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'};
        private String[] field_order_type_info = new String[]{'queries','asOfVersion'};
    }
    public class readMetadata_element {
        public String type_x;
        public String[] fullNames;
        private String[] type_x_type_info = new String[]{'type','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] fullNames_type_info = new String[]{'fullNames','http://soap.sforce.com/2006/04/metadata',null,'0','-1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'};
        private String[] field_order_type_info = new String[]{'type_x','fullNames'};
    }
    public class readMetadataResponse_element {
        public MetadataService.ReadResult result;
        private String[] result_type_info = new String[]{'result','http://soap.sforce.com/2006/04/metadata',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soap.sforce.com/2006/04/metadata','true','false'};
        private String[] field_order_type_info = new String[]{'result'};
    }
    public static MetadataService.MetadataPort createService() {
        partnerSoapSforceCom.Soap sp = new partnerSoapSforceCom.Soap();
//        system.debug('loging in...');
        partnerSoapSforceCom.LoginResult loginResult = sp.login('uid','pwd');
//        system.debug('Login Result:::' +loginResult);

        MetadataService.MetadataPort service = new MetadataService.MetadataPort();
        service.SessionHeader = new MetadataService.SessionHeader_element();
        service.SessionHeader.sessionId = loginResult.sessionId;
//      service.SessionHeader.sessionId = UserInfo.getSessionId();
        return service;   
    }
}
</pre>

I have a picklist field Status on account.There are 3 values One,Two,Other.

IF Other is selected i need a text field to show so that user can enter some information.I know thats not possible on standard layout.

Is it possible i can make that text field non-editable if Other value is selected..?

Can someone suggest me a possible workaround for this.??

Thanks

Hi,

 

I created section in account calls 'RelSci',and assiged visualforce page on that section,Rendering section only who has permission to use 'RelSci' function.When Visualforce page make rendered = 'False',In account view,RelSci visualforce page disapper but leaving white space,Any idea to remove white space?

Hi,

 

I am facing a strange issue in Building a URL:

 

I have the following URL - where I have two Ids - 00NA0000009yWHr & 00NA0000009yWHR. These are different fields. 

 

But when the fields are rendered in UI, it is just changed to one id . Please help me in resolving the issue.

 

/a6i/e?00NA0000009yWHr=Created+in+error&00NA0000009yWHR=RKI+Account&retURL=%2F001J000000ZaCxGIAV
/a6i/e?00NA0000009yWHR=RKI+Account&retURL=%2F001J000000ZaCxGIAV

Hi Everyone, when I faced the too many queries error, then I realize how important this article is 

http://wiki.developerforce.com/page/Apex_Code_Best_Practices

 

And I update all my code, use List for sObject, and put all queries out of loop. \

But it doesn't tell how to Where the update

 

Now I put update into the loop, because I have conditional statement.

 

Is there some method could check if List is changed or not? then update it? 

Hi,

 

I have a "New Account" button on Account object.

this new Account button redirects to another visualforce page.

 

Now, i want When a user clicks the "New Account" button on the Account Page Layout and they do not have the "Create" permission on their user profile or granted through permission sets, the following error message is displayed: "You have insufficient privileges to create Accounts".

  • May 21, 2013
  • Like
  • 0

Hi All,

   In Opportunity object Can a textbox be enabled (made visible) after a certain value from a picklist is selected, such as "Other"?  This will allow the user to define a reason for this value.  If so, how would I accomplish this? Im using PE