• hisrinu
  • SMARTIE
  • 1344 Points
  • Member since 2008

  • Chatter
    Feed
  • 48
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 57
    Questions
  • 569
    Replies

Hi,

 

Is there a way to extract a matrix of data that illustrates all fields in our org (standard and custom) on all objects (again, standard and custom) and show the Field-Level Security they have in relation to all Profiles?

 

This stems from the fact we have numerous fields that have been created with no field-level access to the System Administrator profile. There is now a requirement that absolutely all fields must be visible by the Sys Admin profile and i wondered if there is an easy way to find this out.

 

Thanks for any help you can provide.

 

Regards,

 

Marco

I created a visualforce page wizard with 3 visualforce pages.That means user first fills the first visualforce page and after that he clicks on next then he fills next visualforce page after that he clicks on next then he fills third visualforce page now he saves the form.

 

    My problem is, when user fills the first visualforce page and when he clicks on next, then the whole page is reloading. I want to reload only page part.

 

Can any one please help me in doing this.

 

Thanks,

Naresh

Hi there,

I need to retrieve the tasks related to an account having the account id.

I am developing a trigger that, when an activity is deleted has to check if there is any other activity for that account in order to update the field "Evolution stage". If the last activity is deleted the evolution stage must go back to "Agency to be contacted".Here is my code:

trigger TaskSumTrigger on Task (after insert,after update,after delete,after undelete) {

    if (Trigger.isDelete){
           List<Task> tasks = new list<task>();
            tasks= Trigger.old;   
            if (tasks.size()== 1){
               List<ID> acctIds = new List<ID>();
                for (Task tk : tasks) {
                    acctIds.add(tk.AccountId);
                }  
               Account account =new Account(Id=acctIds.get(0));

             //HERE I NEED TO CHECK IF IT HAS MORE ACTIVITIES TO DO THE FOLLOWING OR NOT
            task[] rest=[select id from task where AccountId ????????]
            if (rest.size()==0){//IF THERE ARE NO MORE ACTIVITIES DO THE FOLLOWING

                if (account.Evolution_Stage__c=='4 - Bookings done'){
                   No hacer nada    
                }else if (account.Access_codes_sent__c==NULL){
                    account.Evolution_Stage__c='1 - Agency to be contacted';
                    update account;
                }else{
                 /  account.Evolution_Stage__c='2 - Access codes created';
                   update account;
               }
             }           
             }
    }
    else{
    Task[] tasks;

        tasks= Trigger.new;
       
    // creo un conjunto set de ID   
    List<ID> acctIds = new List<ID>();  
    //cargo este set con los id de las cuentas de los eventos  
    for (Task tk : tasks) {
        if ((tk.Status=='Completed') & (tk.BOL_Level_III_Result__c!='')){
            acctIds.add(tk.AccountId);
        }
    }   //ahora acctIds es una lista sin repeticiones de identificadores de cuentas
   
    //Actualizar los evolution stage de las cuentas si cumplen las condiciones
    for(Integer i=0; i< acctIds.size();i++){
        Account account =new Account(Id=acctIds.get(i));
        if (account.Evolution_Stage__c!='4 - Bookings done'){
            account.Evolution_Stage__c='3 - Agency Contacted (Visit / Call)';
            update account;
        }
    }
    }

}

I got completely stucked in the part where I want to check if there is any other activity related to the account. could you please help me?Any ideas??

Thanks a lot for your help!!

Does anyone know how to access checkbox through apex or how to enable it so when you create case through apex case uses active assignment rules? 

I have written a couple of Apex triggers that fire Before Insert on the case and that does sucessfully trigger the assigment rules. Everything is fine.

 

Now I added a trigger that fires when a user adds an attachment to a case. The trigger successfully updates the case status as intended but the case assigment rules are not invoked. Drat!

 

trigger NewAttachment on Attachment (after insert) {
        List<Case> CasesToUpdate = new List<Case>();
            for (Attachment t: Trigger.new){
                try{Case c = new Case(Id = t.ParentId);
                    c.Status='New Case';
                    CasesToUpdate.add(c);
                    }catch (Exception e){
                        }
                        }
                        update CasesToUpdate;
                        }

 

 

 

(I did not write this code myself, only modified it from a post on these forums)

 

As far s I understand, the assignment rules should fire when the cases are updated. But they don't seem to do that.  I have double and triple checked the string 'New Case'

 

Any thoughts?

  • January 21, 2011
  • Like
  • 0

Hi All

 

Maximum amount of code used by all Apex scripts in an organization is 2 MB. Is it possible to extend this limit?

  • January 21, 2011
  • Like
  • 0

Dear All,

 

I am just the beginner on the APEX and I have the problem as I don't know the APEX code in Trigger to capture if user has changed field Stage in Opportunities or not .

 

Could you please advise  and thank you very much in advance for you help.

 

Regards

Anong

 

 

  • December 08, 2010
  • Like
  • 0

Please differ Trigger and Workflow in salesforce..

 

What is the need for triggers when workflow exists?

I have a custom feild Placmnt_Start_Date_Arrive__c from Oppportunity object.

 

    This should check for a condition as 

     Placement Start Dt (Arrival) less than LAST 30 DAYS     

     AND Placement Start Dt (Arrival) equals LAST 60 DAYS   

How can i do this in apex.

 

Thank you

Hi Guys,

                 I Created a trigger on  SalesOrder__c . that should create new record of SalesOrderLine__c when RecordType is ReturnOrder.

 

trigger insertsalesorderline on SalesOrder__c (after insert) {

  for(SalesOrder__c so:Trigger.new)
  {
   if(so.RecordType.Name =='Return_Order')  
    {
    SalesOrderLine__c sol = new SalesOrderLine__c(SalesOrder__c=so.id,Product__c='500PTU',
                                  OrderQuantity__c=3);
                      insert sol;
                      }
                      else
                      {
                      }
                      }
   }

      I am unable to insert salesorder line record

      Appreciate Your Help,

     Thank You

Hi All,

i want to ask about export date field from CSV to salesforce with apex Data Loader. 

 

when we export date datatype using data loader, results on apex explorer(salesforce) always -1 day. I'm using windows 7

 

For example : date (csv) : 15/10/2010. After export to salesforce --> date = 16/10/2010.

 

 

Yulia 

  • November 23, 2010
  • Like
  • 0

Hello All,

 

I needed a bit of assistance from the Salesforce community. I have created a a Custom Object called Productivity Allocations. The purpose of this object is to allow users to add more then 1 sales person to any opportunity and split the revenue associated with this opportunity based on the amount of work each sales person has contributed in closing the deal. 

 

Please bare with me as I am mainly an admin who is trying to do some development work. I have done a lot of research on the boards along with the force.com cookbook to get the correct syntax, etc for this Trigger. However I believe I am doing something incorrectly as the Trigger is not functioning as it should.

 

Relationship:

Opportunity = Master

Productivity Allocations = Detail

 

Functionality:

Every time a new Opportunity is created I need to create a detail Productivity Allocations record with certain fields filled out.

 

Here is what I have so far.

 

 

Trigger Productivity_Allocation_Insert on Opportunity (after insert) {



    list<Productivity_Allocations__c> AddPA = new list<Productivity_Allocations__c>();

    for( Opportunity o : Trigger.new ){
        Productivity_Allocations__c PA = new Productivity_Allocations__c(
            Opportunity_Name__c = o.Id,
            Sales_Associate__c = O.OwnerId,
            Allocation_Percentage__c = 100.00);
            }
        insert AddPA;


}

 

 

 

Any and all input would be appreciated.

 

Regards,

Hammad Shah

 

 

 

Hello.  I need to run unit tests on code that applies to customer portal users.  I tried to create a portal user in code (instantiate User object, assign it to the portal user profile, then insert) but the code fails with an invalid cross-reference ID at the insert.

 

I presume this means I can't create portal users programmatically and instead have to refer to an existing portal user ID instead?

 

Thanks

David

If I already know the id and fields I want to update, do I have to fetch the records first ?

 

I tried just  allocating a obj and populating it with the details: 

 

CustomObj__c = new CustomObj__c();

c.Id = idToUpdate;

c.Field1__c = 'New Value'

 

The problem is that the Id field in not writeable.

 

I want to avoid the Select / Fetch if possbile.  Suggestions ?

 

Thanks,

 

Background: I have a custom Object called Shift. It has lookup field to Contact. Each 'record' of the object Shift is just what you'd expect, it contains a Date and time that a Contact is scheduled to work.

 

Problem: I need to prevent users from scheduling the same contact for two shifts on the same date.

 

If there is a Shift where:  Contact = John Smith; Date = 9/15/2010, I don't want the user to be able to create another shift with those same values. I don't want to double book anybody.

 

I'm not sure of the simplest way to prevent this; or even a possible way. Thanks for any help / advice!

I tried to create a new account at developer.force.com, but when I login and go to setup, I don't see an option to create a sandbox under DataManagement. Also, I don't see sample apps like volunteerforce which I used to see with my previous developer account. Strangely in the apps dropdown list, I see apps like marketing, call center etc.

 

My current developer account has an option to create sandbox. I don't see any difference in the way I created these two accounts. How do I get the sandbox option for this new account?

 

One difference I see is, the new account has the user profile of "system administrator" where as the current account is in the profile "platform system admin". This "platform system admin" profile is not there in the new account's manage users menu

 

Thanks for any help regarding this

Hi,

 

I have a requirement to filter users on the basis of user's license type.

I am able to access profile license type field in apex explorer but while using the same field in system log or apex class, it throws an error "no such fields on prfile"

kindly help

APEX manual says:

 

To generate an Apex class from a WSDL:

  1. In the application, click Setup | Develop | Apex Classes.
  2. Click Generate from WSDL.
  3. Click Browse to navigate to a WSDL document on your local hard drive or network, or type in the full path. This WSDL document is the basis for the Apex class you are creating and must be 1 MB or less.

I don't anything that says Generate From WSDL.... Where is it located?

 

If you have this plase post a screenshot.

 

Thanks,

Rick

I'm new to Salesforce and Apex coding. I'm trying to create a trigger and am getting a null pointer error.

 

I have a custom object, VD_Documents, that has a lookup field to the Account object. I'm trying to update the Account Number field on the custom object with the Account Number field from the Account object when a VD_Document is inserted or updated.

 

I've found some code online that I'm trying to modify to work for me, but am receiving a null pointer exception. Here's my trigger code:

 

trigger UpdateAccountNumber on VD_Documents__c (before insert, before update) {
    // create a set of all the unique accounts
    List<id> accountIds = new List<id>();
    for (VD_Documents__c a : Trigger.new)
        accountIds.add(a.Account__r.id);   
 
    // create a map for a lookup / hash table for the account info
    Map<id, Account> accounts = new Map<id, Account>([Select id, AccountNumber from Account Where Id in:accountIds]);  
 
    // iterate over the list of records being processed in the trigger and set the AccountNumber
    for (VD_Documents__c a : Trigger.new)
        a.Account_Number__c = accounts.get(a.Account__r.Id).AccountNumber;
}

 

The error message is:

Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger UpdateAccountNumber caused an unexpected exception, contact your administrator: UpdateAccountNumber: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.UpdateAccountNumber: line 12, column 61

 

I get the same error when I try to insert or update a record. I've also tried changing the trigger to After Insert and After Update. I would appreciate any help you can give me.

 

Thanks!

I need an <apex:listviews> inside of an <apex:PageBlock> , but I can't  do it because, according with the error message, the <apex:listviews> can't be inside a <apex:form> tab.

 

 

Cheers!

  • September 09, 2010
  • Like
  • 0
Please refer this link for the details and to apply
 
  • Bachelor's Degree in Computer Science, related field, or equivalent experience
  • 6-8 years of professional IT/Engineering experience required with demonstrated development and design experience (Java experience preferred)
  • 5+ years of strong experience in Salesforce.com, Force.com, Visual force and the Apex programming language
  • Must have the knowledge of Sales Cloud and Service Cloud
  • Proven proficiency with Salesforce administrative tasks like creating Profiles, Roles, Users, Territories, Page Layouts, e-mail services, Workflows, Reports, Dashboards and Approval processes.
  • Experience with writing Apex classes and triggers as well as developing Visual Force pages using standard and custom controllers.
  • Must have Production support experience and ability to train end-users
  • SFDC Certifications (Administrator, Advanced Administrator, Developer, etc.) is a plus
  • Understands all aspects of SFDC configuration and technical/functional capabilities, including all changes and potential system implications related to other applications.
  • Apttus CPQ experience is preferred
  • Experience using the Force.com data loader, ETL tools and handling data migration assignments.
  • Proficiency in Java, and understanding of REST and SOAP services.
  • Familiarity with integrated development environments such as Eclipse.

Hi,

 

We have recently enabled system log in our instance and we are getting the below error.


Salesforce System Error:       1363190119-6624 (-2057490973)

 

Can any one help me to understand this error?

Hi,

 

I need consume a WSDL to make a call out to an external system. I'm able to parse the WSDL, in the 3rd step of consuming the wsdl I'm getting the below error.

 

Error: Unable to find schema for element; {http://www.w3.org/2001/XMLSchema}dateTime

 

Can any one help me, why am I getting this error.

 

Any suggestions is highly appreciated.

Hi,

 

I would like to delete duplicate records in Opportunity line items. I am using the below query to delete the records.

 

 List<AggregateResult> OLIdupes = [select count(id),opportunityId, pricebookentryid from opportunitylineitem group by opportunityId, pricebookentryid having count(id)>1];

 

Here I am getting the duplicates, but the problem is I am not able to get the OppLineItemId to delete them.

 

Is there something I am missing here? Any suggestions is highly appreciated.

 

 

Hi,

 

When I am merging three accounts, for the related list of deleted records I have just written a trigger which will update a checkbox in that. When I am merging three accounts then I am getting the debug log in an unreadable format on the UI but the records are getting deleted as expected. I don't want to show that error to the user what could be the problem.......

 

Any thoughts on this....... Thanks in advance for your help.

Hi,

 

We are planning to use force.com sites for my company website.

 

I know we can use the branded URL but my question is can I get the branded URL with https?

 

I need to get the https, suppose if I get the URL with https then do I see any force.com name in the URL like secure.force.com or not?

 

Thanks in advance.

 

 

Hi,

 

The storage space for Apex is 1MB, how do I know how much space I have utilised till now?

Can I get this information from anywhere.......... like how do we get the normal storage space from Data Administratio.

 

Any idea?

Hi,

 

I am trying to display Parent and child records using repeat tag.

I don't know what is the problem with the following code, it is not showing any error in the same way it is not giving the desired output.

 

Can anyone point me to the right direction.

 

 

<apex:repeat value="{!PDFList}" var="p"> <apex:pageblockSection title="{!p.ol.Name}" columns="1"> <apex:repeat value="{!p.APB}" var="a1"> <apex:pageBlock title="TEST"></apex:pageBlock> <apex:outputText value="{!a1.Id}"/> </apex:repeat> <apex:repeat> my Wrapper Class is Public class Order_PDF { Public class pdfclass { Public Order_Line_Item__c Ol{get; set;} Public List<Access_Port_Backup__c> APB{get; set;} public pdfclass(Order_Line_Item__c O, List<Access_Port_Backup__c> A) { ol = o; APB = a; } } }

 

 

 

Hi,

  I am trying to built an lookup functionality using the visualforce. I am able to open a popup window as well as able to display the data on it. whenever I am closing the second page, it is not updating the value to the first page.

 

Here is my code

 

 

Parent Window:

<apex:page controller="popupwindow">
<apex:form >
<apex:inputtext value="{!textval}"/>
<apex:commandLink value="get" onclick="popup('/apex/childwindow')"/><br/>
<script>
function popup(url)
{
newwindow=window.open(url,'name','width=400,height=400,top=0,toolbar=no,personalbar=no,location=no,directories=no,statusbar=no,menubar=no,status=no,re sizable=yes,left=60,screenX=60,top=100,screenY=100');
if (window.focus){newwindow.focus()}
}
</script>

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

 

 

Child Window:

<apex:page controller="popupwindow" sidebar="false">
<apex:form >
<apex:dataTable value="{!accounts}" var="a" cellPadding="4" border="1">
<apex:column headervalue="Account Name">
<apex:commandLink onclick="close1()" action="{!filltextval}">
<apex:param name="name1" value="{!a.Name}"/>
{!a.Name}</apex:commandLink></apex:column>
</apex:dataTable>
<script>
function close1()
{
<!-- parent.window.opener.location.reload(); -->
parent.window.close();
}
</script>
</apex:form>
</apex:page>

 

Controller:

public class popupwindow
{
Public string textval{get;set;}

Public List<Account> getAccounts()
{
List<Account> acclist = [select name from account limit 10];
return acclist;
}

Public void filltextval()
{
textval = apexpages.currentpage().getparameters().get('name1');
}

}

 In the controller I am able to set the value to that particular textfield, but I am not able to display the data in the Parent VF Page. If I reload the parent page entire data is getting lost.

 

Any Suggestions on this will be highly appreciable................

 

 

Message Edited by hisrinu on 02-09-2009 03:57 AM

Hi,

 

 I want to display an error message when a duplicate account has been created.

 Once I shown the error message, still user wants to create new record it has to save.

 

 Any suggestions or thoughts on this?

 

Hi,

 

  In the number1 field user enters the data, whenever user moves out of it number3 column should needs to display the product of number1 and number2.

 

Any suggestions on this.

Message Edited by hisrinu on 02-02-2009 01:10 AM

Hi,

 

 I am trying to retrieve custom object using ant/eclipse but i am getting the following error for some objects.

Any help on this..........

 

Eclipse Error

Severity and Description    Path    Resource    Location    Creation Time    Id
Refresh error: Unable to retrieve file for id 01IR00000004dbr of type CustomObject due to an internal error:1006301207-108 (0)    CRP Instance/src    package.xml    line 1    1232875804187    530

 

 ANT ERROR

[sf:retrieve] package.xml - Unable to retrieve file for id 01IR00000004dWT of ty
pe CustomObject due to an internal error:867802804-56 (-1759967389)

I have a list button, on click of it I am sending the selected records IDs to the apex class by using the s-control.

In that apex class I am getting these rows, I want to display these records in that VF, how can I redirect it to VF.

When I am redirecting using s-control view state is getting refreshed,So I am not getting any records.

If I am trying to return through webservice method it is showing an error like  Invalid return type: System.PageReference

Hi,

 

 I have placed the checkboxes for all the columns in the data table. When I select the header checkbox, it should select all the checkboxes. Any help on this.

 

On click of the header checkbox it should select all the checkboxes in that data table.

Any help on this.........

 

Hi,

 

 I want to use the class member variable in the webservice method.

 

global class test123 { List<Opportunity> selopplist1 = new List<Opportunity>(); WebService static void getFromListPage(String[] IdList) { SelOppList1 = [select Name, Account.Name, Type from opportunity where id in :IdList]; } }

 Here I want to use selopplist1 in the webservice method, but I am getting an error like variable is not declared.

I tried by keeping global as well as webservice keyword before the declaration but still I am getting the same error.

Any help on this highly appreciated

 

 


Hi,

Generally in flex we can develop the code and then with the help of s-control we can get the session id and url of the current user. After that we can place that in an webtab to access inside the salesforce.

Is there anyway like the above one for java, I want to place my swing code in the salesforce.com.
Any thoughts on this? Thanks for your help.

Hi,

 I want to implement some custom components, so where do I get the correct references, I didn't find any good examples regarding custom components. Can someone point me to the right direction...... so that I can start working on it.
 


Message Edited by hisrinu on 01-08-2009 08:00 PM
Hi,

 I want to create nearly 100 fields for one custom object, is there any better way for creating the fields other than going through the all the four steps. Using eclipse? or any other third party?
Code:
public class List1 
{
Public void abc()
{
List<Account> acc = new List<Account>();
List<String> IdList = new List<String>();
List<Contact> ConList = new List<Contact>;
acc = [select Id from Account];
for(Account a : Acc)
{
String temp = '\''+a.Id+'\'';
IdList.add(temp);
}
String s = 'select id from Contact where Account.id in '+IdList;
ConList = Database.query(s);
}
}

While executing the above dynamic SOQL query, I am getting the following error. System.QueryException: unexpected token: .

If my Account  query is returning <= 10 then its working fine, but if it returns more than 10 then I am getting the error.

Any suggestions on this are highly appreciated.


Note: I need to execute this as Dynamic SOQL not the static SOQL.



 



Message Edited by hisrinu on 12-29-2008 04:29 AM
How to display the contact Name in VF page.
Below is the example, I want to display Contact Name in VF_Page.
Any Suggestions.

Code:
<apex:page controller="Relationships">
<apex:dataTable value="{!Accounts}" var="a">
<apex:column headervalue="Name" value="{!a.Id}"/>
<apex:column headervalue="Name" value="{!a.Contact.Name}"/>
</apex:dataTable>
</apex:page>

public class Relationships 
{
    public List<Account> getAccounts()
    {
        List<Account> AL = new List<Account>();
        AL = [SELECT Id, (SELECT Name FROM Contacts WHERE Name != '') FROM Account];
        return AL;
    }
}

 
How to display the contact Name in VF page.
Below is the example, I want to display Contact Name in VF_Page.
Any Suggestions.

Code:
<apex:page controller="Relationships">
<apex:dataTable value="{!Accounts}" var="a">
<apex:column headervalue="Name" value="{!a.Id}"/>
<apex:column headervalue="Name" value="{!a.Contact.Name}"/>
</apex:dataTable>
</apex:page>

public class Relationships 
{
    public List<Account> getAccounts()
    {
        List<Account> AL = new List<Account>();
        AL = [SELECT Id, (SELECT Name FROM Contacts WHERE Name != '') FROM Account];
        return AL;
    }
}

 

Hi Everyone,

We can extend standard controllers and use these extensions in Visualforce pages, and that's great.  But we have batch Apex classes that need to be able to execute our own custom methods on some of our custom objects, so we would like to be able to extend custom object classes by adding our own custom methods without setting up dummy VF pages.

For example, we wish to add a custom method myMethod to the custom object MyCustomObject__c  so that we may use that method in a batch Apex class.  Something like:
 
MyCustomObject__c MyCO = new MyCustomObject__c();
MyCO.myMethod();

Anybody know how to do this?

I would like to try running the Apex REST Basic Code Sample provided on page 238 of the following doc: http://www.salesforce.com/us/developer/docs/apexcode/salesforce_apex_language_reference.pdf

 

At the bottom of page 238, they list the following instructions for running the sample code except I don't know how to find/retrieve the sessionId.

 

2. To call the doGet method from a client, open a command-line window and execute the following cURL command to
retrieve an account by ID:
curl -H "Authorization: OAuth sessionId"
"https://instance.salesforce.com/services/apexrest/Account/accountId"

• Replace sessionId with the <sessionId> element that you noted in the login response.
• Replace instance with your <serverUrl> element.
• Replace accountId with the ID of an account which exists in your organization.

 

Thank you in advance for your help!

  • March 07, 2012
  • Like
  • 0

Can i know what this error indicates. I may hitting governor limits here.

 

Maximum view state size limit (135KB) exceeded. Actual view state size for this page was 138.797KB 

 

System.LimitException: Apex heap size too large: 3000253 

  • March 07, 2012
  • Like
  • 0

Hi,

 

I have a search form whereby i can search by account name and results are displayed from the case object.  I would now like to search using a start date but i cannot get this to work i.e no results are returnedand no ERROR message displayed!!

 

Can someone plz tell me what i might doing wrong?  THANKS in advance!! 

 

<apex:page id="Cas" controller="CaseController9" sidebar="false">

    <apex:form >
    <apex:pageBlock >      

            <apex:pageBlockSection columns="2">
               
                <apex:pageBlockSectionItem >
                    <apex:outputText value="Account Name"/>
                    <apex:inputText id="accountName" value="{!accountName}"/>
                 </apex:pageBlockSectionItem>
                 
                <apex:pageBlockSectionItem >
                    <apex:outputText value="Start  Date"/>
                    <apex:inputText id="startDate" value="{!startDate}"/>
                 </apex:pageBlockSectionItem>
                                       
            </apex:pageBlockSection>
                       
            <p></p>
            <table>
                <tr>
                <td align="bottom" valign="center">
                    <br></br>
                    <apex:commandButton action="{!search}" value="Search" id="searchBtn" status="Searching"/>                    
                 </td>
                 </tr>
             </table>
    
    <apex:pageBlock tabStyle="Case" id="pagin" rendered="{!IF(Result.size > 0 , true , false)}">
     
        <apex:outputPanel layout="block" styleClass="pSearchShowMore" id="otpNav2">
        
        Total Records Found :&nbsp; <apex:outputText rendered="{!IF(Con.resultSize==10000,true,false)}" >10000 +</apex:outputText><apex:outputText rendered="{!IF(Con.resultSize < 10000,true,false)}">{!Con.resultSize}</apex:outputText>
            <apex:image url="/img/search_prevarrow_disabled.gif" styleClass="prevArrow" rendered="{!NOT(Con.HasPrevious)}"/>
            <apex:image url="/img/search_prevarrow.gif" title="Previous Page" styleClass="prevArrow" rendered="{!Con.HasPrevious}"/>

        <apex:commandLink action="{!Previous}" title="Previous Page" value="Previous Page" reRender="pagin" rendered="{!Con.HasPrevious}"/>

        <apex:outputPanel styleClass="pShowLess noLink" style="color:grey" rendered="{!NOT(Con.HasPrevious)}">Previous Page</apex:outputPanel>&nbsp;
        ({!IF(Con.PageNumber == 1,1,((Con.PageNumber -1) * Con.PageSize)+1)}-{!IF(Con.resultSize < Con.PageSize,Con.resultSize,Con.PageNumber * Con.pageSize)})&nbsp;
        <apex:outputPanel styleClass="pShowLess noLink" style="color:grey" rendered="{!NOT(Con.HasNext)}">Next Page</apex:outputPanel>

        <apex:commandLink title="Next Page" value="Next Page" reRender="pagin" rendered="{!Con.HasNext}" action="{!Next}"/>&nbsp;
            <apex:image url="/img/search_nextarrow.gif" title="Next Page" styleClass="nextArrow" rendered="{!Con.HasNext}"/>
            <apex:image url="/img/search_nextarrow_disabled.gif" rendered="{!NOT(Con.HasNext)}"/>

        </apex:outputPanel>
        <br></br>

    <apex:pageBlock mode="edit" id="Results">
        <apex:pageBlockTable value="{!result}" var="cas" id="data">
           
            <apex:column headerValue="Start Date" value="{!cas.CreatedDate}"/>
            <apex:column headerValue="Account Name" value="{!cas.Account.Name}"/>

        </apex:pageBlockTable>
    </apex:pageBlock>    
            </apex:pageBlock>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

Public with Sharing Class CaseController9 {

    public String accountname{get;set;}
    public DateTime startDate{get;set;}        
    
    public List<Case> Result
    {
        get  
        {  
            if(con != null)  
                return (List<Case>)con.getRecords();  
            else 
                return null;  
        }  
        set;
        }        
     
    public PageReference search() {
        
        //Search using field Account Name only
        If (startDate==Null && accountname!='')
        {  
            con = new ApexPages.StandardSetController(Database.getQueryLocator([SELECT account.name, createddate FROM Case WHERE Account.Name LIKE :accountname+'%' limit 100]));
            con.setPageSize(200); 
        }
         //Search using field Start Date only
        If (startDate!=Null && accountname=='')
        {  
            con = new ApexPages.StandardSetController(Database.getQueryLocator([SELECT account.name, createddate FROM Case WHERE CreatedDate = :startDate limit 100]));
            con.setPageSize(200); 
        }
           else
        {    
            con = null;
        }         
            return null;        
    }   
             
        public ApexPages.StandardSetController con { get; set; }
        
        public CaseController9()
        {            
            con = new ApexPages.StandardSetController(Database.getQueryLocator([SELECT CreatedDate, account.name FROM Case Order By account.name]));
        }            
    
    public Boolean hasNext
    {
        get
        { return con.getHasNext(); }
        set;
    }        
    
       public Boolean hasPrevious
    {
        get
        { return con.getHasPrevious(); }
        set;
    }    
    
     public Integer pageNumber  
    {  
        get  
        { return con.getPageNumber(); }  
        set; 
    }    
    
    public void next()
    { con.next(); }

    public void previous()  
    { con.previous(); }    
}

 

  • March 07, 2012
  • Like
  • 0

Hi All,

 

Using the below query we are able to get TimeZone:

 

SELECT ID, TimeZoneSidKey FROM User WHERE ID = :UserInfo.getUserId()

 

For example, on edit user detail, if we pick the Time zone as (GMT-08:00) Pacific Standard Time (America/Los_Angeles) from the pick list then the TimeZoneSidKey will be America/Los_Angeles.

 

Is there any method to get the TimeZoneSidKey's value i.e,  (GMT-08:00) Pacific Standard Time (America/Los_Angeles) ?


Thanks.



Hi,

 

I have a custom object named as 'Journal', it has several feilds, I want to create a visual force page in which i want to show all the details of the Selected Journal same as it is shown in detail page.. How can i achive this?

 

Following is the code for VisualForce page

 

<apex:page controller="Fin_JournalManager" id="JournalPage" tabStyle="Fin_Journal__c" >
<apex:pageBlock title="Journal Information">
<b>Journal {!Journal}.</b>
</apex:pageBlock>
<apex:detail />
</apex:page>

 

Regards,

Meer

  • March 07, 2012
  • Like
  • 0

Hi,

 

I am facing a severe problem while trying to deploy one new APex class and visualforce page from Sandbox/Eclipse to Production account.

 

Test coverage is Ok at developer account. Now from these code base new APex class and VF page I need to add at production account. While trying to do so, then error coming is average test coverage is below 75%.

 

My new APex class has its test coverage and my question is that when I am trying to deploy,how test coverage is being calculated?

 

Actually I can not uninstall and reinstall package at production account because of some necessary reason.So I need to include these classes externally .Either from Eclipse or from Sandbox.

 

It will be great help from your suggestions.

 

Thanks in advance.

I'm trying to use the Force.com Migration Tool to make a Developer Edition org an exact copy of what we've configured and developed in our Production org. Retrieving the metadata hasn't been an issue but I've hit some roadblocks while attempting to deploy everything to the Developer org. From the looks of it, the errors are mostly due to dependencies.

 

Has anyone successfully done this? If so, I'd appreciate it if you could share any tips or lessons learned as it would save me some time trying to figure it out. Let me know if you need additional info from me as well.

 

 

Hi All,

 

Happy New Year ,

 

I have a requirement; under page block table I am displaying all the contacts with the check box.

 

But the problem is I need to allow user to select only one check box.

 

I think this need to be done using JavaScript function, can anyone have help me by sending sample code.

 

Thank you.

  • January 03, 2012
  • Like
  • 0

Hi All

 

Below is a part of code on Pg. 257 of Developer Guide Advanced Programming.

 

<apex:pageBlock>
<apex:pageblockTable
value="{!Position__c.Job_Application__r}" var="JA">
<apex:column value="{!JA.Candidate__r.First_Name__c}">
</apex:column>
<apex:column value="{!JA.Candidate__r.Last_Name__c}">
</apex:column>
<apex:column value="{!JA.Candidate_Qualified__c}">
</apex:column>
</apex:pageblockTable>
</apex:pageBlock>

 

Error recvd while saving on under developer mode.

 

 

Just wanted to know if anyone faced the same problem. All the Objects & Fields are created through Code Share Project. Job_Application is a Custom Object (Junction Object) between Position & Candidate Objects.

 

Any solution, much appreciated.

 

Thanks & regards,

Pri..

 

 

 

  • January 03, 2012
  • Like
  • 0

Hi,



 

This is Venkat. I have addmaterials button , some materials(like pen, paper etc),and a  Conf_items  juntion object(for campain and materials)  when i add materials using add materials button I want to populate   multi select picklist on conf_items with seleted materials .And the client want to select  the items which are there in multi select picklist .I want apex and visual force code for this. reply as soon as posssible.

  • January 03, 2012
  • Like
  • 0

Hi,

 

Is there a way to extract a matrix of data that illustrates all fields in our org (standard and custom) on all objects (again, standard and custom) and show the Field-Level Security they have in relation to all Profiles?

 

This stems from the fact we have numerous fields that have been created with no field-level access to the System Administrator profile. There is now a requirement that absolutely all fields must be visible by the Sys Admin profile and i wondered if there is an easy way to find this out.

 

Thanks for any help you can provide.

 

Regards,

 

Marco

Just to set the context, my use case is: programmatically scheduling Scheduled Apex Jobs from other pieces of Apex code.

 

I know that there is a limit on the number of Scheduled APEX Jobs (i.e. scheduled executions of Apex classes implementing the Schedulable interface), but I'm having trouble figuring out a way to distinguish between APEX Scheduled Jobs and all other Scheduled Jobs (i.e. Scheduled Report/Dashboard Refreshes) using a query on the CronTrigger object. Right now I have the following:

 

public static final Integer MAX_SCHEDULED_APEX_JOBS = 10; 
	
// Determine whether the maximum number of Scheduled APEX Jobs has been reached
public static Boolean MaxScheduledJobsReached() {
   return (GetScheduledJobs().size() >= MAX_SCHEDULED_APEX_JOBS) ;
}
	
// Returns all Scheduled Apex jobs that have not been started yet 
public static List<CronTrigger> GetScheduledJobs() {
   return [select Id, NextFireTime 
	   from CronTrigger 
           where State in ('WAITING','ACQUIRED','EXECUTING')
            or NextFireTime != NULL];
}	

The problem is that this returns Dashboard and Report Refreshes as well. How do I weed-out Report and Dashboard Refresh Jobs from this query?

 

I thought of adopting a naming convention for Jobs, i.e. whenever I programmatically Schedule an Apex Job, I name it something like 'ApexJob__' etc, but if there were other Scheduled Apex Jobs scheduled that I didn't create, this wouldn't work.

 

Looking at the Scheduled Jobs page in the UI (i.e. Administration Setup > Monitoring > Scheduled Jobs), there's a Type field displayed that is not accessible through the CronTrigger API object. If only it was!!! This would be super helpful.

 

Any suggestions???

 

Thanks!

Zach McElrath

Skoodat LLC

 

 

 

I'm getting the following error when updating a list custom setting that's part of a managed package:

 

Update failed. First exception on row 0 with id a0DA0000007MfC9MAK; first error: FIELD_INTEGRITY_EXCEPTION, There is already an item in this list with the name

 

I've only recently started seeing this and simply cannot see how this is possible. The code is very simple, retrieve the custom setting, change a field, and then update (not insert). Nowhere am I touching the id or name of the returned object. Example:

 

MySetting__c mysetting = MySetting__c.getValues('TestName');

mysetting.MyField__c = 'test';

update mysetting;

 

Any insights as to why this would happen?

Due to a slow-loading page in my app I did some investigation and found out the slowness is because of this "Generate Metadata" step:

 

 13:06:08.976|CODE_UNIT_STARTED|[EXTERNAL]|Generate Metadata
 13:06:47.992|CODE_UNIT_FINISHED|Generate Metadata

 

That step alone takes almost 40 seconds while the rest of my page (including a web service callout to get a list of options for a dropdown) loads in less than 1 second.

 

What is the purpose of this "Generate Metadata" performance hog?  How can I remove it or at least speed it up?

I created a visualforce page wizard with 3 visualforce pages.That means user first fills the first visualforce page and after that he clicks on next then he fills next visualforce page after that he clicks on next then he fills third visualforce page now he saves the form.

 

    My problem is, when user fills the first visualforce page and when he clicks on next, then the whole page is reloading. I want to reload only page part.

 

Can any one please help me in doing this.

 

Thanks,

Naresh

I am trying to build a trigger that will do the following:

 

Upon any changes (additions, deletions) to the Account Team related list, will gather the owner alias' of each member and then erase and update a field on the account record.

 

Example:  Account Team members:  John Doe, Jim Nelson, Peter Downey

 

On Account Record, a field called "Account Team Members" would then look something like this:  jdoe; jnelson1, pdowney

 

Each time a related list item is added, deleted or modified, the trigger would rerun to erase and update that field.

 

I don't have any experience in writing triggers and would greatly appreciate any help from someone who could walk me through this A-Z.

 

Thanks :)