• Natraj
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 23
    Replies

Hi All,

 

Public pageReference redirectaction(){ 

 

update ssss; //Database operation before redirection

 

String url = 'www.google.com';

PageReference pr = new PageReference(url);

pr.setRedirect(true);

return pr;

 

}

 

This is throwing the following error:  Formula Expression is required on the action attributes.

 

I want this to be done using commandbutton action.. Becoz before redirection I have to perform some database operation.

 

Could you please help me in getting this resolved?

 

Thanks in Advance.

 

 

  • December 04, 2013
  • Like
  • 0

Hi All,

 

I am using fieldsets in my VF development.

 

My Fieldset named Sampleset with the following fields Customfield1__c, Customfield2__c and Customfield3__c is added in the VF page.

 

After creating the managed package and installing the package in any org, I have all the fields added in the fieldset but NOT IN THE ORDER I ADDED. So everytime after installing the package, I am changing the layout for all fieldset I am using.

 

Looking forward for a solution asap.

 

Thanks in Advance.

  • March 13, 2013
  • Like
  • 0

Hi All,

 

I need to round numbers similar to the example below.

 

5.2 should be rounded to 5

 

5.3 to 5.7 should be rounded to 5.5

 

Greater than 5.7 to 6.

 

Is there any formula function or known way to do this?

 

Help me in this.

 

Thanks !!

  • March 11, 2013
  • Like
  • 0

Hi All,

 

I have two check boxes named A and B  in my custom object. In my visualforce page

If I select A then B should be unselected and vice versa.

 

How to do this?

 

I don't want  to use picklist at the backend and use select option at the front end.

 

I want to use only checkboxes.

 

Pls help me in this.

  • March 07, 2013
  • Like
  • 0

Hi All,

 

How can i relate the cases to assets while creating the case through email to case functionality?

 

 

 

Regards,

Natraj

  • October 10, 2012
  • Like
  • 0

Hi All,

 

I was not able to install the MANAGED  package in any of the orgs. The error i am getting is  No Custom field Contact Allow Customer Portal Self-Registration Not found.

 

The Solution is i need to enable customer portal in target org to install the managed package. But i dont want to do this.

Is there any way to remove the Allow Customer Portal Self-Registration field from the package.

 

 

Thanks

  • September 27, 2012
  • Like
  • 0

Hi All,

 

How to link a product to case in Email to Case functionaltiy?

 

 

 

 

Thanks

  • September 19, 2012
  • Like
  • 0

Hi,

 

How to link the product to a case through email to case functionality?

 

For example. I am submitting a case Using Email To Case Functionality. I want a product to be associated with this case.

How can i achieve this?

 

 

Thanks

  • September 19, 2012
  • Like
  • 0

Hi,

 

I have a object named 'Sample' with 2 fields. One is Name Field and the other is Value field. I need to display the data in visualforce in columns with Name field as column name and value as the values for columns.

 

All records whose name is A should display its value in column A and records whose name is B should display in column B (2 nd column) and  records with name C should display its value in column C (3 rd column ) and so on.......

 

Any ideas please............

 

 

 

Regards,

Natraj

  • February 16, 2012
  • Like
  • 0

Hi All,

 

I am updating a list of records from visualforce page with the help a update button. What i need here is .. lets take for example i have a list of 10 records and i have given correct values for some 5 records and incorrect values for other 5 records. When i click update i want the partial update i.e., i want the 5 records with the correct value to get updated and i need to get

 

I used DML database methods. but i am not getting clear.

 

 

 

Thanks in Advance.

  • February 13, 2012
  • Like
  • 0

Hello All,

 

I need to add the  Generate new password and notify user immediately checkbox in visualforce page.

 

How to do this?

 

 

Help me in this...

 

 

Regards,

Natraj

  • January 25, 2012
  • Like
  • 0

Hi All,

 

I have to hide the global search from salesforce header. I know it will be disabled if we disable chatter. But i have to use chatter in my app and i have to hide the global search from header.

 

Help me in this...

 

 

Thanks in advance....

 

 

 

--

Regards,

Natraj

  • October 29, 2011
  • Like
  • 0

Hi All!

 

My requirement is

 

Consider senior level manager is logging in and he wants to see the users under him and other users under his user.

 

            userList1 = [ select id, name, firstname, lastname,ManagerId from user where Managerid =: Userinfo.getUserId() ];
          
            userList2 = [ select id, name, firstname, lastname,ManagerId from user where Managerid IN : userList1 ];

 

            userList3 = [ select id, name, firstname, lastname,ManagerId from user where Managerid IN : userList2 ];

 

              userList.addAll(userList1);
             userList.addAll(userList2);
             userList.addAll(userList3);
           
             return userList; 

 

this is wat i did and finally added the both the list to a single list.

 

apex:outputPanel id="chartPanel" layout="block">

    <script type='text/javascript'>
      google.load('visualization', '1', {packages:['orgchart']});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Name');
        data.addColumn('string', 'Manager');
      
       
        <apex:repeat value="{!userList}" var="u">
            data.addRow([{v:'{!u.id}'
                , f:'{!JSENCODE(u.roleBody)}'}
                , '{!u.ManagerId}']);
        </apex:repeat>

</apex:outputpanel>

 

But i want to get all users i.e., user uunder a user under another user. in a single query. How to get this?

  • September 16, 2011
  • Like
  • 0

Hi all,

 

How to get the manager name of the user. ?

 

userList1 = [ select id, name, firstname, lastname,ManagerId from user where Managerid =: Userinfo.getUserId() ];

 

Pls help.

 

 

Thanks in advance.

  • September 16, 2011
  • Like
  • 0

Hi All,

 

I am using fieldset in my VF page. The fieldset has add1, ad2,add3,country and postcode fields in it.

When i click the save button, it should check  for any fields values are null and it should throw the error message.. If all fields are filled, then it should save the records.


<apex:pageBlockSection >
 <apex:repeat value="{!$ObjectType.Address__c.Fieldsets.Address_Set}" var="o"  >
  <apex:inputField value="{!addres[o]}" required="{!o.Required}" id="addr"><br/><br/>
   </apex:inputField>                                            
 </apex:repeat>                                               
 </apex:pageBlockSection> 

<apex:commandButton value="Save" action="{!saveadd}"/> 

 

 

public Address__c addres;
    public Address__c getaddres(){      
        addres=new Address__c(Employee_Details__c=this.empDetail.Id);
        return addres;
    }
  
    public PageReference saveadd(){

//I have to do my validation here. if any fields values are null, an error msg should be thrown, orelse it should be saved

         insert addres;
        return null;
}

 

 

If possible give me sample code or do the changes in code above, so tha i can understand it more better.

 

Kindly help me for doing this. Thanks in advance

 

Regards,

Natraj

  • August 29, 2011
  • Like
  • 0

Please help in this ASAP. If there is any documents or links available to resolve this issue 

Its very urgent.. Thanks in advance..

 

 

 

Natraj.

 

Hi,

 

In some of the classes the (exceptions) Catch part are covered in test coverage and in some cases its not covering the catch exception in test code. Is there any special way to cover the catch part in test code..

 

Thanks in advance...

 

Natraj..

Hi,

 

 

Pls provide me the explanation for the trigger context variables. Thanks in advance.

 

 

Natraj.

 

CODE IN APEX CLASS:

public List<String> PrimaryRoles {
    get {
      if (PrimaryRoles == null) {
        PrimaryRoles = new List<String>();
        Schema.DescribeFieldResult field = Contact.Primary_Role__c.getDescribe();
         for (Schema.PicklistEntry f : field.getPicklistValues())
          PrimaryRoles.add(f.getLabel());
      }
      return PrimaryRoles;   
}
set;
}
VF CODE:

<td style="font-weight:bold;">Primary Role<br/>
<select id="primaryRole" onchange="doSearch();">
<option value=""></option>
<apex:repeat value="{!primaryRoles}" var="prole">
<option value="{!prole}">{!prole}</option>
</apex:repeat>
</select>
</td>

Step 1. I have queried opportunity line items and displayed in the VF page

step 2. On save button click this will be saved in assets

step 3. if values are already in asset databse and if i click save, its again duplicating in assets

 

So i have to avoid this by confirm msg using javascript. If "Ok" it should be saved and if "Cancel" it sholud not be save in assets while on clicking save button....How to do this????

 

Hi all,

 

I am using Developer Edition. In i am not getting any <apex:chart> tags?

 

Can you please help me any one

 

Thanks for u r help.....

i have created an email template 

 

 

EmailTemplate et = [SELECT Id FROM EmailTemplate WHERE DeveloperName='Promotional_Stationery_Inventory'];

 

here wt is an developername is it  an field or here in developer name what we must  send to it

developername means ownername or emailtemplatename

please help me wt to follow

thanks in advance

 

  • March 14, 2012
  • Like
  • 0

Hi, everyone

 

I need your help to understand and fix this problem:

I built an apex text class in a sandbox environment (i'm using eclipse) but when I run this apex test class I'm getting this error: System.QueryException: List has no rows for assignment to SObject. The problem is that the object really has records both in sandbox and in production environment !!!! I run that query in Force.com Explorer, salesforce.shema Explorer, etc. and there I can see the existing records but in the test all the time throws that error... Could anyone please guide me why is it happening and how can it be fixed?

How to bulkify this trigger

 

trigger UpdateUserFields on User (before insert ,before update) {


Set<String> userEmails = new Set<String>();

if(Trigger.isInsert){
for(User u :trigger.new){
userEmails.add(u.Email);

}
}

if(Trigger.isUpdate){
for(User u : trigger.new)
                       {
                        User oldUser =trigger.OldMap.get(u.id);
                        userEmails.add(oldUser.Email);
                        }
                        }
                        
 List<Contact> conList =new List<Contact>([Select Email ,Code__c , BTF__c  from Contact where  Account.Name  = 'Test' and id IN :userEmails]);
                                  
                                                          
                for(User u : trigger.new){
               if(u.Email == conList[0].Email){
                              
              u.Testfield1__c = conList[0]. Code__c ;

              u.TestField2__c  = conList[0].BTF__c; 
                                  
             } 
                                  
               }
         
               }

 

Thanks

 

hi

i want two buttons one standard update

2)controllerextensionupdate

<apex:page standardController="ControlerETO__c" recordSetVar="ControlerETO" >
    <apex:form >
   <apex:dataTable value="{!ControlerETO}" var="individualrecords">
   <apex:column headerValue="first object">
   <apex:inputField value="{!individualrecords.Name}"/>
   </apex:column>
   <apex:column headerValue="second object">
   <apex:inputField value="{!individualrecords.Description__c}"/>
   </apex:column>
   <apex:column headerValue="third object">
   <apex:inputField value="{!individualrecords.Numbaer__c}"/>
   </apex:column>
   </apex:dataTable>
   <apex:pageBlock >
   <apex:commandButton value="standard update" action="{!standardupdate}"/>
   <apex:commandButton action="{!Controlerextensionupdate}" value="Controlerextensionupdate"/>
   </apex:pageBlock>
    
    </apex:form>
 
</apex:page>

 

 

this my code but its not accepting it showing two errors standard controller nd controller extension how can i get tht two buttons

below code is given in which i am  printing http responce...but it is null...an nothing is printed..what is the posssible reason???

 

public void Method() {

  system.debug('@@@@@@@@@@'+'in method');
  HttpRequest req = new HttpRequest();
  req.setMethod('POST');
  req.setEndpoint('https://edge-beta.krollfactualdata.com/services/mismo231/kfdlos.aspx');


  String b='<REQUEST_GROUP MISMOVersionID=\'2.3.1\'><SUBMITTING_PARTY><Name>'+
  'Jefferson Funding</Name></SUBMITTING_PARTY><RECEIVING_PARTY><Name>Factual Data'+
  '</Name></RECEIVING_PARTY><REQUEST RequestDatetime=\'2003-3-24T11:30:53\''+
  'InternalAccountIdentifier=\'0610JFFUND\' LoginAccountIdentifier=\'jeffersonuser\''+
  'LoginAccountPassword=\'j3ffus3r\'><KEY><Name>HTMLFile</Name><Value>true</Value>'+
  '</KEY><KEY><Name>TextFile</Name><Value>true</Value></KEY><KEY><Name>PDFFile'+
  '</Name><Value>true</Value></KEY><REQUEST_DATA>'+
  '<CREDIT_REQUEST MISMOVersionID='+'\'2.3.1\''+' LenderCaseIdentifier='+'\'Loan#\''+
  'LenderCaseID here\' RequestingPartyRequestedByName=\'Elend Tester\'>'+
  '<CREDIT_REQUEST_DATA CreditRequestID=\'CreditReq0001\' BorrowerID=\'Borrower\''+
  ' CreditReportRequestActionType=\'Submit\' CreditReportType=\'Merge\' '+
  'CreditRequestType=\'Individual\'><CREDIT_REPOSITORY_INCLUDED>'+
  '<EquifaxIndicator>N</EquifaxIndicator><ExperianIndicator>N</ExperianIndicator>'+
  '<TransUnionIndicator>Y</TransUnionIndicator></CREDIT_REPOSITORY_INCLUDED</CREDIT_REQUEST_DATA>'+
  '<LOAN_APPLICATION><BORROWER BorrowerID=\'Borrower\'><BirthDate>1975-02-09</BirthDate>'+
  '<FirstName>Beth</FirstName><MiddleName>A</MiddleName><LastName>Bfacommon</LastName>'+
  '<PrintPositionType>Borrower</PrintPositionType><SSN>067242712</SSN>'+
  '<UnparsedName>Beth A Bfacommon</UnparsedName><MaritalStatusType>Single</MaritalStatusType>'+
  '<RESIDENCE_StreetAddress>27 E Murray</RESIDENCE_StreetAddress><City>Fantasy Island</City>'+
  '<State>IL</State><PostalCode>60750</<PostalCode>'+
  '<BorrowerResidencyDurationYears>5</BorrowerResidencyDurationYears>'+
  '</BORROWER></LOAN_APPLICATION></CREDIT_REQUEST></REQUEST_DATA>'+
  '</REQUEST></REQUEST_GROUP>';

  req.setClientCertificateName('KFDCertification');
  req.setBody(b);
  Http http = new Http(); 
  try { 
   
   HTTPResponse res = http.send(req);      
   System.debug('RRRRRRRRRR'+res.getXmlStreamReader());
   
   System.debug('response:@@@@@@@@@@@@'+res.getBody()+'PPPPPPPPP'+res.toString()); 
   } catch(System.CalloutException e)
   { 
         system.debug('@@@@@@@@@@'+'in catch'+e.getMessage());
   }
   system.debug('@@@@@@@@@@'+'out method');  */
   
}





 

Hi Friends,

 

I have to mass update account records based on the filetring mechanism.I want to allow my users to select records which needs to be updated.

 

How can I do this ,Can somebody please give me an idea or if somebody has some code.

 

I am assuming I need a visual force page which i will be able to create and then I need a way to fileter records so that i can select records which can then be updated .

 

 

Can somebody please help.

 

 

Thanks,

Trick

 

 

Thanks,

Trick

  • March 10, 2012
  • Like
  • 0

Hi All,

I have a custom object and which having two master deatils relation ship with diffent object. So now when i go to OWD setting i found that for this object default setting is Controller by Parent. I want to know in this case it will conside which object as Parent?????????

Hi All,

 

I am updating a list of records from visualforce page with the help a update button. What i need here is .. lets take for example i have a list of 10 records and i have given correct values for some 5 records and incorrect values for other 5 records. When i click update i want the partial update i.e., i want the 5 records with the correct value to get updated and i need to get

 

I used DML database methods. but i am not getting clear.

 

 

 

Thanks in Advance.

  • February 13, 2012
  • Like
  • 0

Hello All,

 

I need to add the  Generate new password and notify user immediately checkbox in visualforce page.

 

How to do this?

 

 

Help me in this...

 

 

Regards,

Natraj

  • January 25, 2012
  • Like
  • 0

Hai friends,

 

       Can you any body help me to add Columns to Datatable on Vfpage Dynamically.I have to display all records in Data table on vfpage. we can add rows dynamically to datatable,but i need to add columns to datatable.Please help me in this scenario.

 

Thank u,

Haribabu

I have one field which is formula field as Income_Amount__c which stores the entire amount of every type of incomes & have one more field as Total_income__c which calculates sum of all incomes amount which is in Income_Amount__c then how to write formula for this field Total_Income__c  bcoz As I know that there is no any function like SUM in formula field...
Since i am not able to store values in Total_Income__c field by formula but when i put values directly in Total_Income__c then it shows that values in my GUI but I want SUM(Income_Amount__c) values should appear in my GUI.

 

Please tell me that how to write formula in this formula field...

Or needs to do by other ways then also tell me...

I have a Princial_amount_outstanding custom field in my Asset object. it wil consist of a list of values. i need to find a sum of all the Principal_amount_outstanding in my Account Object custom field how shld i write the formula for it in another object

I've got a situation where I want to display competitors on a Visualforce page -- if there are any.

 

My competitors are stored in Account and there's an object called Competitor__c which links the Account to itself many to many.

 

On my visualforce page, I've got two datatables that render the lists of competitors as per getIncumbents and getNonIncumbents.

 

 

        public list<Competitor__c> getIncumbents() {
                 return getCompetitors(account.Id, true);
     
         }

        public list<Competitor__c> getNonIncumbents() {
                 return getCompetitors(account.Id, false);
        }


        public list<Competitor__c> getCompetitors(Id accId, boolean incumbent) {
        // pass true for incumbents and false for non-incumbents
        list<Competitor__c> comps = new list<Competitor__c>();

        comps = [Select Opportunity__r.StageName, Opportunity__r.Name, 
        Opportunity__c, Notes__c, LastModifiedDate, LastModifiedById, 
        Incumbent__c, Incumbent_Value__c, Incumbent_Renewal_Date__c, 
        Competitor__r.Name, Competitor__c, Competing_Product_Area__c 
        from Competitor__c c 
        where Account__c = :accId and Incumbent__c = :incumbent];

        if (comps.size() > 0) {
        	return comps;
        	}
        else return null;
    }

 

 

The situation is that it's perfectly normal for there to not be any competitors.  When there are competitors it all works fine.  When there aren't there are nullPointer exceptions.

 

What does one do when returning nothing back is AOK??

 

 

 

            <apex:dataTable rendered="{! NOT(err)}" value="{!incumbents}" var="c" styleClass="tableClass" columnswidth="200px,200px" cellpadding="4" border="1">                <apex:column >
                        <apex:facet name="header">Competitors (incumbent)</apex:facet>
                        <apex:outputText value="{!c.Competitor__r.Name}"/>
                </apex:column>

                <apex:column >
                        <apex:facet name="header">Notes</apex:facet>
                        <apex:outputText value="{!c.Notes__c}"/>
                </apex:column>

                <apex:column >
                        <apex:facet name="header">Value</apex:facet>
                        <apex:outputField value="{!c.Incumbent_Value__c}" />
                </apex:column>

                <apex:column >
                        <apex:facet name="header">Renewal Date</apex:facet>
                        <apex:outputText value="{0,date,MMM d yyyy}">
                             <apex:param value="{!c.Incumbent_Renewal_Date__c}" />
                        </apex:outputText>
                                 
                </apex:column>

                <apex:column >
                        <apex:facet name="header">Product Area</apex:facet>
                        <apex:outputText value="{!c.Competing_Product_Area__c}"/>
                </apex:column>
            </apex:dataTable>
<p/><hr/><p/>

            <apex:dataTable rendered="{! NOT(err)}"  value="{!nonincumbents}" var="c" styleClass="tableClass" columnswidth="200px,200px" cellpadding="4" border="1">                <apex:column >
                        <apex:facet name="header">Competitors (non-incumbent)</apex:facet>
                        <apex:outputText value="{!c.Competitor__r.Name}"/>
                </apex:column>

                <apex:column >
                        <apex:facet name="header">Notes</apex:facet>
                        <apex:outputText value="{!c.Notes__c}"/>
                </apex:column>

                <apex:column >
                        <apex:facet name="header">Opportunity</apex:facet>
                        <apex:outputText value="{! if(c.Opportunity__r.Name != null,c.Opportunity__r.Name, ' -- ') }"/>
                </apex:column>


                <apex:column >
                        <apex:facet name="header">Stage</apex:facet>
                        <apex:outputText value="{!c.Opportunity__r.StageName}"/>
                </apex:column>

                <apex:column >
                        <apex:facet name="header">Product Area</apex:facet>
                        <apex:outputText value="{!c.Competing_Product_Area__c}"/>
                </apex:column>
            </apex:dataTable>

 

There must be something simple here I'm just not doing. 

 

THANKS!!!

 

 

 

CODE IN APEX CLASS:

public List<String> PrimaryRoles {
    get {
      if (PrimaryRoles == null) {
        PrimaryRoles = new List<String>();
        Schema.DescribeFieldResult field = Contact.Primary_Role__c.getDescribe();
         for (Schema.PicklistEntry f : field.getPicklistValues())
          PrimaryRoles.add(f.getLabel());
      }
      return PrimaryRoles;   
}
set;
}
VF CODE:

<td style="font-weight:bold;">Primary Role<br/>
<select id="primaryRole" onchange="doSearch();">
<option value=""></option>
<apex:repeat value="{!primaryRoles}" var="prole">
<option value="{!prole}">{!prole}</option>
</apex:repeat>
</select>
</td>

i have two custom object Asset and Goal. i have to write a formula for goal object field where i need to use a field of asset object. there is no relation between these two objects then how do i use the field of Asset object.

 can i get a solution for the same