• nbk
  • NEWBIE
  • 391 Points
  • Member since 2010
  • Salesforce Developer


  • Chatter
    Feed
  • 11
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 29
    Questions
  • 199
    Replies
I have a picklist field on a custom object who's values are translated using translation workbench.
In my class I am using wrapper class and displaying the picklist value on a visualforce page using "output:text component".But the translated valu is not getting rendered as I have used a wrapper class.Can any one help to find a way around for this  issue.
 
Hi,

When the Owner of an account has been changed , I would like to change as well the owner on the related Contract.
I wrote this trigger but it gives me an error, Does someone see where is the issue?
Many thanks for your time.

[Code]
trigger ChangeAccountOwnerOnContract on Account(after insert,After update){

for(Account Acc :Trigger.new){
List<Contract> C = [select Owner.Id from Contract where Account.Id = :Acc.Id];

for (Contract Ctrct : C)
{
Ctrct.Owner.Id = Acc.Owner.Id ;
}
update C;
}
}
[/code]

Error: Apex trigger ChangeAccountOwnerOnContract caused an unexpected exception, contact your administrator: ChangeAccountOwnerOnContract: execution of AfterUpdate

caused by: System.DmlException: Update failed. First exception on row 0 with id 80020000000vULAAA2; first error: INVALID_FIELD, Cannot specify both an external ID reference Owner and a salesforce id, OwnerId: []: Trigger.ChangeAccountOwnerOnContract: line 14, column 1
I have a list of sObjects and also know its field names. We need to retrieve these field values and build a custom object out of it. sObject.getSobject() returns an object and which needs to stored in various fields of the Custom Objects. The data types of fields in custom objects are LongTextArea, ID, Datetime. 

Any idea how to do this. 
This js getElementById command is working when accessing an element under a tag...

            <apex:pageBlock title="Selected {!$ObjectType.Product2.LabelPlural}" id="selected">                  
                   <apex:inputHidden value="{!NeedsApproval}" id="needsapproval"/>

by using the following js in a function called from a button click...

            var text = document.getElementById('{!$Component.mainpage.mainform.selected.needsapproval}').value;

Now when trying to access an value from an apex:inputField within an apex:pageblockTable under the same apex:pageblock I am unable to get the value.

Here's the VF...

            <apex:pageBlock title="Selected {!$ObjectType.Product2.LabelPlural}" id="selected">                  
                   <apex:inputHidden value="{!NeedsApproval}" id="needsapproval"/>               
                   <apex:pageblockTable value="{!shoppingCart}" var="s" id="ProdTable">              
                        <apex:column headerValue="{!$ObjectType.OpportunityLineItem.Fields.Approval_Level__c.Label}" id="level">                   
                            <apex:inputField value="{!s.Approval_Level__c}" style="width:20px" />
                        </apex:column>                   
                   </apex:pageblockTable>
            </apex:pageBlock>

And here is the js command that does not work when called from the same method when 1 record exists in the table...

var text = document.getElementById('{!$Component.mainpage.mainform.selected.ProdTable.0.level}').value;

I think I'm referencing the element correctly based on the source behing the VF page.

Can anyone see what am I doing wrong here?

Regards
Lance Cresswell

Hi,

 

  I made a email alter when work flow condition is set as mentioned below. 

 

  In Lead there is a Column called Lead Status  When lead status is changed to MQL or SQL it must trigger email to User. 

 

   I tried with Operator Contains(MQL, SQL) its not working,  But when i mention equal to MQL or SQL it is working. 

 

  Please suggest me how to add this condition. 

 

Thanks

Sudhir

One more newbie question what is Allow Reports do when adding an object declaratively.

Please help.

Thanks

Sai

1. Is it possible to customize a data object page, in other words if we create a dataobject1 with field1 and add a layout to it.

And then if i would like to add a new button to this layout in this page using page layout is it possible.

 

2. Also why would we need multiple page layouts for a page.

 

Please help.

Thanks

Sai

Hi,

 

How can I get current user Id in apex code? I tried {!$User.Id}. But it didn't work. How to resolve it?

 

Thanks in Advance

Hi,

 

Can any one plz tell me the differences between DataLoader and Import wizard?

 

 

 


As per the below link, the partner portal will be retired Feb 20th and completely turn off. To overcome this should be migrated to partner community.
https://partners.salesforce.com/partnerNews?id=a033000000C7SUcAAN

I am working with customers who has several preexisting Partner portal sites (develop->sites->site link-> login through the link and update their information)

Is any impact for force.com sites due to Partner portal retires in early 2015?
If yes please share your ideas and how to overcome this?

Highlities from the source link:
February 20th - release new functionality outlined above in Partner Community.  All partners will need to re-accept the Partner Master Agreement.
February 20th - links and functionality will be removed in the Partner Portal.
April 3rd - Partner Portal site will be fully retired.
 
  • January 21, 2015
  • Like
  • 0
We are using Salesforce partner portal site where Salesforce is automatically setting the HTTP Header - "X-XSS-Protection" to "0" by default.

This has been flagged by a security flaw by our client and we should to overcome this issue.
Reproduce steps: 

Go to https://nbk-developer-edition.na15.force.com/, Using inspect Element of Chrome, check for the Response Headers of sitelogin Page. One of the Response header is X-XSS-Protection, which is set to 0. It should ideally be set to 1.

Identified that Login.salesforce.com page also setting with 0, please provide if you come across this issue and resolution.
whereas google.com site setup with X-XSS-Protection:1
 
  • December 25, 2014
  • Like
  • 0
Hello Everyone,
I am getting System.TypeException: Data type not supported in API 30.0 versions while running the same class is working in previous versions. Below are the sample class.
Class:
global class SampleUtility
{

public static Map<String , Boolean> searchMap = new Map<String , Boolean>() ;
  
    public String createDynamicQuery(Set<String> selectClaseFields, SObject sObjectRecord)
        {
          
            Schema.SObjectType systemObjectType ;
            ////System.debug('sObjectRecord :::::: ' + sObjectRecord) ;
            if(sObjectRecord != null)
                {
                    systemObjectType = sObjectRecord.getSObjectType();
                    Schema.DescribeSObjectResult r = systemObjectType.getDescribe();

                    String objectName = r.getLocalName();
                    if(objectName != null && objectName  != '' && selectClaseFields != null && selectClaseFields.size() > 0)
                        {
                            //get operator for fields which have value in sObject
                            //Schema.DescribeSObjectResult r = systemObjectType.getDescribe();
                            Map<String,Schema.SObjectField> M = r.fields.getMap();
                            Map<String,DisplayType> fieldMap = new Map<String,DisplayType>();
                          
                            Set<String> existingFieldNamesList = M.keySet();
          
                            //Remove tag fields from fields name
                            for(String fieldName : existingFieldNamesList)
                                {
                                    //String str = String.valueOf(sObjectRecord.get(fieldname));
                                    //if(str != null && str != '' && str != '[]')
                                    if(sObjectRecord.get(fieldname)!='[]' && sObjectRecord.get(fieldname)!=null && sObjectRecord.get(fieldname)!='') //throwing error
                                        {
                                            searchMap.put(objectName, true) ;
                                            Schema.SObjectField field = M.get(fieldName);
                                            Schema.DescribeFieldResult fieldDesc = field.getDescribe();
                                            fieldMap.put(fieldName, fieldDesc.getType());
                                            //Base_AC_Utility.selectedFieldLabel += fieldDesc.getLabel() + '-' + sObjectRecord.get(fieldname) + ' ,' ;
                                        }
                                }
                           }
                   }return null;
                   }       
}

Test Class
@isTest
public class Test_Utility
{
  public static testMethod void unittest1()
  {
      Account acc = new Account(name='testaccount');
      insert acc;
      Contact contact =  new Contact(accountid=acc.id,LastName='Test');
                
                  insert contact;
                
     SampleUtility controller= new SampleUtility();
      Set<String> selectClaseFields = new Set<String>{'Id','Name'};
      String actualQuery1 =  controller.createDynamicQuery(selectClaseFields,contact);
    
  }
}

Please let me know if you have any workaround for this issue.
  • April 30, 2014
  • Like
  • 0
Hello All,

I have one Package org and it have managed package (testmanagement) it holds several components, when I install 'testmanagement' url in customer orgs all new components or existing compoments will be updated in customer orgs.

My requirement is to upload one un-manage class from managed package. for example I have a class in package org with 'DataLoadAccounts' and have required coverage, now I want to install the class in customer orgs with un-manage version.(user is able to edit the class)

If I add 'DataLoadAccounts' class to package the class is converted to managed version in customer orgs. My goal is the class should be editable in client orgs (custsomer orgs) we expect some changes in the class so the class is require un-manage version.

Do we have any steps to acheive this? please provide your inputs if you have any!!
  • March 17, 2014
  • Like
  • 0
Hello All,

I want to process 1Lakh records by using batch class and intially I used default batch size to 200 but am getting some code issues 'System.ListException: Before Insert or Upsert list must not have two identically equal elements'..etc. If i restrict the batch size to '1' it is working fine.

 would like to know the batch execution time is depends on the batch size? If yes, please share the links if you have any!
batchprocessid = Database.executeBatch(batchclass,200); //Execution time
batchprocessid = Database.executeBatch(batchclass,1);     //Execution time


  • February 20, 2014
  • Like
  • 0

Hello All,

 

I am getting an issue while updating user object from Partner User profile.  Tried with without sharing in the class level and other ways to overcome the issue but could't find the fix.

 

I have raised a case to salesforce and they confirmed that you can not update User object from Partner user profile and it is allowing only from System Admin profile.

 

Please let me know if you have workaround for this issue.

 

Sample Code:

@future  
    public static void disableUser(Set<ID> userIds)
        {     
       
  List<User> lstusers = [Select id from User where id in: userIds];
           
            for(User u : lstusers)
                {
                   u.isActive = false;
                
   }
            update lstusers;//throwing error

 

From Debug log:

04:31:04.056 (56044017)|EXCEPTION_THROWN|[708]|System.DmlException: Update failed. First exception on row 0 with id 005F0000002F981IAC; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []
04:31:04.056 (56953655)|FATAL_ERROR|System.DmlException: Update failed. First exception on row 0 with id 005F0000002F981IAC; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id

  • December 04, 2013
  • Like
  • 0

Hello All,

 

I am getting an issue while updating user object from Gold Partner User profile. This issue will come after winter 14 salesforce upgrade. Previously it is working fine. Please let me know if you have workaround for this issue. Tried with without sharing in the class level and other ways to overcome the issue but could't find the fix.

 

Sample Code:

@future  
    public static void disableUser(Set<ID> userIds)
        {     
       
  List<User> lstusers = [Select id from User where id in: userIds];
           
            for(User u : lstusers)
                {
                   u.isActive = false;
                
   }
            update lstusers;//throwing error

 

From Debug log:

04:31:04.056 (56044017)|EXCEPTION_THROWN|[708]|System.DmlException: Update failed. First exception on row 0 with id 005F0000002F981IAC; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []
04:31:04.056 (56953655)|FATAL_ERROR|System.DmlException: Update failed. First exception on row 0 with id 005F0000002F981IAC; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id

  • November 19, 2013
  • Like
  • 0

Hello Everyone,

 

I am using following statement to retreive Logged in User role name from VFP.

 

{!Left($UserRole.Name,(FIND('CEO', $UserRole.Name) - 1))}  -->am able to get the expected value and it is working. but when I pass the merge field in FIND method the vfp shoiwng BLANK.

ex:

{!Left($UserRole.Name,(FIND('{!$Label.testLabel}', $UserRole.Name) - 1))} - How to use custom variable or class variable in Find method..

Do we have any workaround for this or FIND method does'nt accept Merge fields!

 

Thanks,

Balakrishna

 

  • November 12, 2013
  • Like
  • 0

Hello Everyone,

 

I have created new report with "New Accounts" under "Supplier Owner" Report type. I am able to view the report in System Admin profile but not other profiles.

 

Getting 'Insufficient Priviliges" issue while opening the report other than system admin profile(ex:Account Manager profile) and update below settings for the profile.

 

Manage Public Reports - True

Run Reports -                     True

 

 

Is native report types are only accesible for System Admin profile?

Identified other report too - All Pending Approval Requests

 

Can someone clarify the above questions! How to view  reports which created by salesforce native report types other than system administrators?

 

Thanks,

Krishna

  • May 20, 2013
  • Like
  • 0

Hello Everyone,

 

I have created new report with "New Accounts" under "Supplier Owner" Report type. I am able to view the report in System Admin profile but not other profiles.

 

Getting 'Insufficient Priviliges" issue while opening the report other than system admin profile(ex:Account Manager profile) and update below settings for the profile.

 

Manage Public Reports - True

Run Reports -                     True

 

 

Is native report types are only accesible for System Admin profile?

Identified other report too - All Pending Approval Requests

 

Can someone clarify the above questions! How to view  reports which created by salesforce native report types other than system administrators?

 

Thanks,

Krishna

 

 

 

  • May 20, 2013
  • Like
  • 0

Hello Everyone,

 

I have a requirement to render dynamic fields in Field set  by Location wise.

More Details:

1) Fieldset structure

 

Fieldset Name       Available fields    Object Name

General                    Account Name     Account

                                   Employees

                                   Year established

                                   Location

 

2) If the Account location is "Australia" need to render the following fields. not required to show (Year & Location) fields

Fieldset Name       Available fields    Object Name

General                    Account Name     Account

                                   Employees

                                   Year established

                                   Location

 

3) If the Account location is "Australia" need to render the following fields. not required to show (Year ) fields

Fieldset Name       Available fields    Object Name

General                    Account Name     Account

                                   Employees

                                   Year established

                                  

Can  you post your ideas/solutions how to acheive the requirement without creating new fieldset.

Expectation: One field set is ability to handle the fields dynamically by Location .

 

 

 

 

 

  • May 16, 2013
  • Like
  • 0

Hello Everyone,

 

I have a requirement to render dynamic picklist values in Fieldset based on "NumberofEmployees" value from Account object. Please find the details as below.

 

Picklist  - Account Status --> Picklistval1, Picklistval2,Picklistval3

Fieldsetname - DemoFieldset -> the fieldset contains "Account Status, Account Name..etc" (there are around 15 fields available in fieldset and some of the fields have dependent fields one each other)

 

Now I want to show Picklistval1, Picklistval2 values when the "NumberofEmployees"<10, other wise show 3 items(Picklistval1, Picklistval2,Picklistval3)

How can I acheive this.? Please share your ideas to implement this!!

 

<apex:page standardController="Account" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection title="test">
    <apex:repeat value="{!$ObjectType.Account.FieldSets.DemoFieldset}" var="GS" >  
                              <apex:inputField value="{!account[GS]}"/> 
     </apex:repeat>
<apex:pageBlockSection>
</apex:pageBlock>
</apex:form>

 

 

  • May 02, 2013
  • Like
  • 0

Hello Everyone,

 

Here is my requirement to render fieldset dynamically from custom object in Visual force page.

custom object structure

 

FieldSetName Object

fieldset1           Account

fieldset2           Account

 

usually we are calling fieldset in visualforce as below.

<apex:pageBlockSection title="Address">
           <apex:repeat value="{!$ObjectType.Account.FieldSets.Address}"
                    var="field">
              <apex:inputField value="{!Account[field]}" />
           </apex:repeat>
</apex:pageBlockSection>

 

As highlited fieldset name "Address" above, I need to retreive the fieldset name from custom object (ex:fieldset1) and use in repeat tag.

The visualforce page needs to be dynamic once you create a new entry in custom object and new field set data should be display in vfp without modify the vfp. Pleae share your ideas to acheive the requirement!!

 

 

FieldSetname Object

fieldset1           Account

fieldset2           Account

fieldset3          Account

 

Thanks,

Krishna

  • April 25, 2013
  • Like
  • 0

Hi All,

 We are unable to view Record Type value in lookup window while applying filters in Reports.

scenario: created 2 Record types for custom object with Custom object 1

Record Types:

  1. Business Unit Obsolete - used in apex class
  2. Business Unit

Note: Above records are in "Active" mode

Reports on Custom Object1-Filter Criteria - By clicking on Record Type lookup window the Business Unit Obsolete not showing and it shows "NULL" in the value field.

 

Please share your ideas on how to get Record Type value in Lookup window.

 

Thanks,

Krishna

  • February 27, 2013
  • Like
  • 0

Hi All,

Below is my requirement for displaying grand total in viusal force page.

 

The sample data is below from account object.

I have a currency field with "total" in Account object. Now I want to display the Grand total label value dynamically while editing the total.

can you please share your ideas to acheive this!. Is any built in aggregate field in Visual force to use.

 

Account NameTotal
ABC100
XYZ200
PQR300
  
Grand Total600
  • August 03, 2012
  • Like
  • 0

Hi All,

 

When user chooses to “logout” they are brought back to the SalesForce logout page. Is there any way to have the users brought back to the Custom Visual force page/default site login page.

 

Thanks,

Krishna

  • May 02, 2012
  • Like
  • 0

Hi All,

 

I need to use controller class variable in javascript onClick event. For this I used below code.

I am getting NULL value instead of  "samplevariable" which hardcoded in class variable while click Javascript function and m

VFP:

 

<apex:page id="pageForm" controller="formController">
    <apex:form id="form">
         <apex:inputHidden value="{!myObject.textdata}" id="hidBusiness"/>
        <apex:commandButton id="btnSave" onclick="javascript&colon;if(!confirmation()) return false;" value="save"/>
    <script>
       function confirmation()
        {
          var hidBusiness= document.getElementById("{!$Component.hidBusiness}");
          alert('Hi'+hidBusiness);
        }
    </script>
    </apex:form>
</apex:page>

 

Controller class:

public class formController {

  public class MyObject {
     public String textdata = 'samplevariable';

    public String getTextData() { return textdata; }
    public void setTextData(String data) { textdata = data; }

  }

  • November 25, 2011
  • Like
  • 0

Hi All,

 

If we create new user/Reset password from Manage Users section(Administration setup->Manage Users), The sales force sending out Email template to User with Password Confirmation.

Can we  customize verbiage of Email Template [ From address and add some additional content to this..]

 

Thanks,

Krishna

 

 

  • October 07, 2011
  • Like
  • 0

Hi All,

 

I 've created 2 Salesforce accounts[Developer Editions] DevA, and DevB and did some manipulations on DevB.
I Forgotten password of DevB and changed to new pwd. When I login with new password of DevB, the DevA Org opened instead of DevB.

why the loginid of DevB org mapped to the DevA org?

How can I login to DEVB..

 



  • August 12, 2011
  • Like
  • 0

Hi All,

 

I need to convert DateTime field  2011-03-21T11:54:45.000Z to Date Format. March 21, 2011

 

Thanks,

Krishna

  • August 11, 2011
  • Like
  • 0
When a community is set up with access to multiple IDP with SSO. The standard login page will disply buttons for each of the allowed IDP's and the user can make a choice on who to autenticate with.

How to get this functionality working on a custom button in visual force as a SP-initiated request. I am able to get a button working as a idp-initiated request .

With the standard page i have found the following it  makes a call to the salesforce SAML request generator '/saml/authn-request.jsp' with  parameters picked from SSO setup.  This in turn generates a SAML assertion make a call to the idp sending through the  saml request and relay state as a POST message.

I have not found anything that salesforce provides that can do this for custom visualforce. ie: a function that can pick values from SSO setup and make a call to the SAML generator. Something that can be invoked into the button click event for the button  . Is there something or is there any other way 
Hi Everyone,
I have a issue in a customer, where we have 2 portals installed, and 2 different sso solutions at the same time.
Regular salesforce users log in through login.salesforce.com or custom url.
Customers from portal 1 go through IDP 1
Customer from portal 2 o trough IDP 2
Both IDP SSO configs are SP initiated (they have to start on salesforce).
My issue is:
I need a way to avoid going to the login page and actively chose one of the logins methods.
Salesforce generate the login links as follows:

https://my.custom.salesforce.domain/saml/authn-request.jsp?saml_request_id=_2CAAAAVZTcY0mME8wbTAwMDAwMDA0Qzk0AAAAypQs87MjXfKGfnOM29wBsHYId_Alz7ZZxK9jm0Sw2ElCsi4NGRR0OeIj1-asA8CLNDxFCpFjK3Cu4pxu031lK7RQaxwGRPuw4eI9nnPtleFYfR_5_eIXAAE0Dcp7zHjceZXj1q7Ivl5_Prgc0wDl7YmXkt53qOVr8bJ2oAPtR-CMj-_XB_KDi7URAcJnjWDvsseG0z15wSpCwN52nhB9QzWJWwvZTJ0BwYxS9ex4PJHrP8UPSS-pgnBiiG9oPLQp5g&saml_acs=https%3A%2F%2Fmy.custom.salesforce.org%3Fso%3D00Dm0000000CqC7&saml_binding_type=HttpPost&Issuer=https%3A%2F%2F.my.salesforce.com%2F&samlSsoConfig=SSoCOnfigId&RelayState=%2F

Is there a way to programatically chose a connection method or to manually generate the saml_request_id
Anyone has any thoughts on how achieve that without going the IDP initiated SSO???
Cheers
hi i worte a simple update of record in account object using developer console.  i am getting this error:---   "unexpected token: account"   at line 4;

public class updatename {
    public updatename()
    {
        list<account> accs=[select name form account where name='GenePoint'];
        
        for(account a:accs)
        {
            a.name='Jaffa point';
        }
        update accs;
    }
    
}
Hi all,

When i am Upgrading Managed package in my org(production) i'm getting Error like.. 
Screen Shot of Error while package installing

But,i'm succeded upgrading in some orgs.
Plz tell me what are the causes to getting this error..
System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []
Hi,
I am new to salesforce.
I currently have a wordpress site that logs customer queries and leads to a few custom tables in the mysql database of the WP site. I can see there there are many tools out there that can connect salesforce to MySQL. Can anyone recommend a plugin that works with good documentation.
I will need the plugin to read/write to this DB.

Thanks
I have installed apptus from Appexchange .. As per my requirment i need to change controller .. but controller code not visiable.. plz help me on this if any one ave idea.
  • April 22, 2015
  • Like
  • 0
Hi,

Using the Salesforce API via my iOS app that I have created I'm currently collecting the Phone and Title attributes of the logged in user (with Administrator access) using the retrieve() method.

But when I log in as a non Administrator these details are not passed back.

Would anyone know which permission(s) I need to change in order for this to work for non Administrator users?

Thanks,

Mark
Hi Experts,
 
In our salesforce application we are using 4 different record types in Project custom object.
Below are record types.
    - Managed Project
    - Project Templates
    - REST Project
    - Staffing Project
One custom picklist Case_Team__c is on project object.
Case_Team__c custom picklist added to all record types.
But we need to remove this picklist field from one of the record type.
Please find the below images.

Available record types for Project Object

Record Type = Staffing Project
 
Anyone please resolve my issue.
Thanks in advance.
 
Thanks,
Manu

As per the below link, the partner portal will be retired Feb 20th and completely turn off. To overcome this should be migrated to partner community.
https://partners.salesforce.com/partnerNews?id=a033000000C7SUcAAN

I am working with customers who has several preexisting Partner portal sites (develop->sites->site link-> login through the link and update their information)

Is any impact for force.com sites due to Partner portal retires in early 2015?
If yes please share your ideas and how to overcome this?

Highlities from the source link:
February 20th - release new functionality outlined above in Partner Community.  All partners will need to re-accept the Partner Master Agreement.
February 20th - links and functionality will be removed in the Partner Portal.
April 3rd - Partner Portal site will be fully retired.
 
  • January 21, 2015
  • Like
  • 0
We are using Salesforce partner portal site where Salesforce is automatically setting the HTTP Header - "X-XSS-Protection" to "0" by default.

This has been flagged by a security flaw by our client and we should to overcome this issue.
Reproduce steps: 

Go to https://nbk-developer-edition.na15.force.com/, Using inspect Element of Chrome, check for the Response Headers of sitelogin Page. One of the Response header is X-XSS-Protection, which is set to 0. It should ideally be set to 1.

Identified that Login.salesforce.com page also setting with 0, please provide if you come across this issue and resolution.
whereas google.com site setup with X-XSS-Protection:1
 
  • December 25, 2014
  • Like
  • 0
how to pass value from vf page to controller ??
  • December 07, 2014
  • Like
  • 0
Hi,

I have requirement that, i have to dislpay Count of leads modified from last 3moths in Home Page. 

Regards
Shaik
  • December 05, 2014
  • Like
  • 0
Hi All

I have created a apex class for sending mail.but my requirment is subject line is different for diffrenet object.

mainly i have created this for task object for assining task ,when user assign any task depending on custom object/standard object it will send a mail with proper subject line

for ex

if(acc.Company_Name__c !=null)
        {
         mail.setSubject(    +  acc.Company_Name__c );
         }
      else
mail.setSubject(    'There is no company name' );


i has create like this but its not working.
 
I have a picklist field on a custom object who's values are translated using translation workbench.
In my class I am using wrapper class and displaying the picklist value on a visualforce page using "output:text component".But the translated valu is not getting rendered as I have used a wrapper class.Can any one help to find a way around for this  issue.
 
What is the difference between Record Types and page layout?

Regards,
Anil Kumar
Hi,

I created a Visualforce page (on a custom object related to Account) where users will be able to search for contacts based on FirstName and LastName. When I enter the LastName and click Search, the page retrieves only the contacts based on LastName and works as expected. But when I enter FirstName and click Search, the page shows an error message ("Please enter firstname or lastname") which I created when the user does not enter anything in any of the fields and clicks Search. But it shows up even when FirstName is entered. I am not sure what is incorrect in the soql statement or in other area of the code. When I try to add another Search attribute based on Division, I get the same error message. Below is the partial Class code and Vf code which involves Firstname/Lastname search features. I appreciate any help in this regard. Thank you.

Class code:

public class AccountContacts{
public AccountContacts() {}
String aid=ApexPages.currentPage().getParameters().get('id');
 /* Variable declarations */
public List<cContact> contactList {get; set;}                              
public Boolean selectAllCheckbox {get; set;}                                  // Stores checkbox data.
public boolean errormsg=false;
public boolean errormsg1=false;

String userinput1;                                                             // Contact firstname
String userinp;                                                                  // Contact lastname

Public List<Contact> results = new List<Contact>();                            // Contact search results.
Public List<Contact> selectedContactsstep2 = new List<Contact>();
public List<Account_Contacts_Teams__c> act = new List<Account_Contacts_Teams__c>();
/* End of Variable declarations */

/* Getter and setter methods for getting the user input ie. Contact firstname and lastname from the UI */
public String getuserinput1(){return userinput1;}
public void setuserinput1(String userinp){this.userinput1=userinput1;}
public String getuserinp(){return userinp;}
public void setuserinp(String userinp){this.userinp=userinp;}
/*End of Getter and Setter methods */

/* Method to Search the contact database to fetch the query results */
public List<cContact> contactsearch()
{
    contactList=new List<cContact>();
        errormsg=false;
    if((userinput1==null || userinput1=='') && (userinp==null || userinp==''))
    
     errormsg1=true;
    else
        errormsg1=false;
    if(!errormsg1){
          
       if(userinput1!=null){
     for(Contact c : [select Id,FirstName,LastName,Email,Phone,Title,Company__c,Division__c from Contact where FirstName like userinput1+'%' ])
     {    
         contactList.add(new cContact(c));
     }
        }
        
       if(userinp!=null){
     for(Contact c : [select Id,FirstName,LastName,Email,Phone,Title,Company__c,Division__c from Contact where LastName like :userinp+'%'])
     {    
         contactList.add(new cContact(c));
     }
        }         
    }  
   
   return null;
}

public List<cContact> getresults() {

return contactList;

}

VF code:

<apex:page controller="AccountContacts" tabStyle="Account">
    <apex:form >
      <apex:sectionHeader title="Step 1" subtitle="Select Contacts to Add to the Account"/>
             <apex:pageblock >
                <apex:pageBlockSection title="Search Contacts" columns="1"></apex:pageBlockSection>
                  <apex:panelGrid columns="2">
                 <apex:outputLabel style="font-weight:bold;" value="Contact FirstName"></apex:outputLabel>
                 <apex:inputText value="{!userinput1}" />
                 <apex:outputLabel style="font-weight:bold;" value="Contact LastName" ></apex:outputLabel>
                 <apex:inputText value="{!userinp}"/>
             </apex:panelGrid>
             <apex:commandButton value="Search" action="{!contactsearch}"/>
 
<!-- Display error message -->
<apex:pagemessage strength="2" title="Error!!" severity="error" detail="Please select a contact or enter different contact name to proceed" rendered="{!errormsg}"/>
<!-- End of error message -->
    
<!-- Display error message -->
<apex:pagemessage strength="2" title="Invalid!!" severity="error" detail="Please enter firstname or lastname" rendered="{!errormsg1}"/>
<!-- End of error message -->    

<!-- Display search results -->
<apex:pageblocksection columns="1" title="Search Results" rendered="{!NOT(ISNULL(results))}" >
  <apex:outputpanel id="Contactlist">

        <apex:pageBlockTable value="{!results}" var="contacts">
             <apex:column >
                <apex:facet name="header">
                    <apex:inputCheckbox onclick="checkAll(this)"/>
                </apex:facet>
             <apex:inputCheckbox value="{!Contacts.selected}" id="selectLine1"/>       
            </apex:column>
            <apex:column headervalue="Contact FirstName">
                <apex:outputtext value="{!Contacts.con.FirstName}"/>
            </apex:column>
            <apex:column headervalue="Contact LastName">
                <apex:outputtext value="{!Contacts.con.LastName}"/>
            </apex:column>
            <apex:column headervalue="Title">
                <apex:outputtext value="{!Contacts.con.Title}"/>
            </apex:column>
            <apex:column headervalue="Phone">
                <apex:outputtext value="{!Contacts.con.Phone}"/>
            </apex:column>
            <apex:column headervalue="Email">
                <apex:outputtext value="{!Contacts.con.Email}"/>
            </apex:column>
            <apex:column headervalue="Company">
                <apex:outputtext value="{!Contacts.con.Company__c}"/>
            </apex:column>
            <apex:column headervalue="Division">
                <apex:outputtext value="{!Contacts.con.Division__c}"/>
            </apex:column>
          </apex:pageBlockTable>  <br/><br/>
    </apex:outputpanel>
  • November 11, 2014
  • Like
  • 0

Hi,

 

I have enable customer portal and am using Force.com sites with customer portal authorisation.

In the sandbox when a user is provided access they receive a temp password in their email and when the first try to login into the sites they are redirected to the change password page so that they can change the temp password.

I deployed the same code into production. Here the first time users are getting redirected to the home page directly without going to the Change password page where they can change the temp password.

 

Why is this happening? Am i missing any settings.

 

Thanks

KD

  • August 25, 2011
  • Like
  • 0