• tgganesh
  • NEWBIE
  • 75 Points
  • Member since 2012

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 11
    Replies

Hi All,

 

I have written a trigger on an object. I have written a logic to collect values from a custom setting.

 

In Custom Setting we are storing name of few classes.

 

So i will be receiving class name as value, I have to create instance of the class am receiving from the custom setting.

 

Please help me :(

 

Thanks in Advance..!!

Hi,

 

Can anyone suggest the best way  or Tool to merge accounts in Salesforce to remove duplicate accounts from the system. While merging accounts, oneaccount should be selected as the master account to remain in the system.

 

All related objects (eg: contacts, opportunities, etc.) from the

secondary account(s) should be attached to the master account, automatically, and remain in the system.

 

Thanks in Advance :)

 

 

Hi,

 

I want to differentiate the update request from Custom button and standard save button.

 

i have created a custom button on a custom object and named as Refresh. whenever i click this button, the object data has to refresh and some processing will happen. i dont want to do the same process whenever i try to update that custom object (Save button). so i want to skip this processing while clicking the save button and have to do process only while clicking Refresh button.

 

I tried to update some field value on refresh button and checked that condition,i have added some SOQL before processing update record. So that field value checking wont work..

 

I tried to update a static value and checked it before executing code, but static value getting reset and am getting default value :(

 

 

suggest me idea :)

Hi,

 

I am trying to fetch value from custom object, it is giving me invalid field exception.

 

Please tell me where am doing mistake. here is the code.

 

At_Risk_Request__c dynObject = new At_Risk_Request__c();
                    
dynObject= mapMainObjectData.get(AtRiskRecords.Id);                  
                      system.debug('GlobalREgion+++++'+String.valueOf(dynObject.get('CustomerAccount__r.Global_Region__c')));

 CustomerAccount is a Parent object of At_Risk_Request object. i am trying to access CustomerAccount field.

Hi,

 

I am trying to fetch a field value from a custom object. Currently am storing custom object data in a sObject. when i try to fetch some related field value of custom object. it is throwing me error as invalid field.

 

if i try to fetch field value belongs to custom object, it is providing correctly.

 

for(At_Risk_Request__c AtRiskRecords : mapMainObject.values()) // Taking atRisk record
                {                
                    sObject dynObject= Schema.getGlobalDescribe().get('At_Risk_Request__c').newSObject() ;
                    //At_Risk_Request__c dynObject = new At_Risk_Request__c();
                    
                    dynObject= mapMainObjectData.get(AtRiskRecords.Id);
                    
                                       system.debug('GlobalREgion+++++'+String.valueOf(dynObject.get(CustomerAccount__r.Global_Region__c)));

 At_Risk_Request__c is a Child object and CustomerAccount is parent object (Account).

Hi All,

 

I have a requirement to create Rule Engine, we have created a set of rules and stored in an object. Each rule will have some Rule Criteria and Rule result (Child objects of rule object). 

 

whenever i tried to update an Account. That record should go through all the rules and compared with all rule criteria.Each rule criteria will have some conditions. if all the rule criteria's are satisfied, we need to update a field in account object by rule result.

 

To accomplish this requirement,

 

I have created Three objects,

 

Rule-Master object

Rule Criteria - Child object

Rule Result - Child object.

 

Whenever i tried to update one record, trigger will call this method and loop through all the rules, rule criteria and update rule result value on the field.

 

Currently it is working. but we may hit some performance issue in future, because using "for loop" we going though Rule then looping all the Rule Criteria then looping though all the Rule results.

 

Please let me know, If you have any idea to complete this requirement in simple way.

 

 

Thanks in advance :)

Hi All,

 

I am planning to Take ADM 201, Recently i completed DEV 401.

Please suggest me how can i crack 201 exam.

 

Thanks and Regards,

Ganesh Babu.

Hi All,

 

I have created a custom object, using a controller i need to collect a list of records belonging to a custom object and display all the records in a VF Page. Please give me some code snippet to complete this.

 

Thanks in advance :)

Hi all,

 

I have write a code to store a value, just for checking i added debug comment in setter method. but in debug logs am not receiving the values. it seems like setter method is not working properly.

 

public class chooseColor {
    String sCheckboxAnswers;
    
    public String getSCheckboxAnswers(){
        return sCheckboxAnswers;
    }
    
    public void setSCheckboxAnswers(String sCheckboxAnswers ){       
        system.debug('Checkbox value +++++'+sCheckboxAnswers ); 
        this.sCheckboxAnswers = sCheckboxAnswers ;
    }
}

 

<apex:page controller="chooseColor">
    <apex:form > 
    <apex:selectCheckboxes id="chooseColor3" value="{!sCheckboxAnswers}">
        <apex:selectOption itemValue="red" itemLabel="Red"/>          
    </apex:selectCheckboxes>
    </apex:form>
</apex:page>

 

can anyone tell me.. what mistake i have done.?

 

Hi All,

 

             I am trying to collect a value of the selected checkbox, am new to visualforce.

<apex:page controller="chooseColor">
    <apex:form id="Form1" >
    <script type="text/javascript">
        function ToggleInput(theId)
            {
                var e = document.getElementById(theId);
                alert(e.value);
            }
        function ToggleInput2(Idd)
            {
                var e = document.getElementById(theId);
                alert(e.value);
            }

    </script>
    
<apex:selectList id="chooseColor" value="{!string1}" onchange="ToggleInput('{!$Component.chooseColor}');">
    <apex:selectOption itemValue="red" itemLabel="Red"/>
    <apex:selectOption itemValue="white" itemLabel="White"/>
    <apex:selectOption itemValue="blue" itemLabel="Blue"/>            
</apex:selectList>

<apex:selectCheckboxes id="chooseColor1" value="{!string1}" onchange="ToggleInput2('{!$Component.chooseColor1}');">
    <apex:selectOption itemValue="red" itemLabel="Red" id="ID1" title="1"/>
    <apex:selectOption itemValue="white" itemLabel="White" id="ID2" title="2"/>
    <apex:selectOption itemValue="blue" itemLabel="Blue" title="3"/>            
</apex:selectCheckboxes>  

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

 

 Apex Controller Code:

public class chooseColor {
    String s = 'blue';
    public String Val{get;set;}
 
    public String getString1() {
        return s;
    }
                        
    public void setString1(String s) {
        Val = s;
        system.debug('Value+++'+Val);
        this.s = s;
        
    }
}

 When i try the apex:selectList am getting proper values, but am getting undefined for apex:selectCheckbox tag's. Please tell me where i have done the mistake.

 

else tell me how to find the selected checkbox. I have three checkbox and am selecting only two, i need to find the selected checkbox alone. give some idea.

 

Thanks in advance.. :)

Hi all,

 

        Can anyone help me in using Checkbox in visualfoce, am new to visualforce,

I have three checkbox, The value selecting in a checkbox should be stored in a custom object and whenever i open the page again.. the selected value should retrive from the custom object and display the checkbox selected.

 

I want to use the <apex:inputCheckbox tag..

 

Please give me some idea...

Hi all,

 

Can anyone tell me how to collect the opportunity id from the list view displaying opportunity record.

 

I have a list view in new opportunity page..

 

 

i should select the opportunity and when i click the send mass email button. it has to collect id of the selected opportunity and mail to the owner of the record.

 

Can anyone give me a solution for this?

 

 

Hi all,

 

I have created a VF Page.. I need to validate the values entering in a text box.

 

I should not enter more than three characters in that text box.

 

If i enter a value in text box, that value should pass to a java script function and that should validate and throw a error.

 

Please give me a sample code...

 

 

Hi All,

 

I want to share a opportunity through apex code and

 

i tried to set role id as userid or group id.. but its throwing a error like Database.Error[getFields=(UserOrGroupId);getMessage=User/Group ID: id value of incorrect type: 00EV0000000Hp7wTAP;getStatusCode=FIELD_INTEGRITY_EXCEPTION;]

 

so i planned to create a group and add members belongs to that role.. after creating group i can set the group id while sharing opportunity.

 

i need to create a group and add few members in a group through apex code,

 

am not getting how to create group and add members through apex code.

 

Please give me a solution...

 

Thanks in advance.. :)

Hi All,

 

I want to display a date field in VisualForce Email template.

According to user locale language selection.. the date format should get change.

If an user is from US... date should display in MM/DD/YYYY format

For UK user date should display in DD/MM/YYYY format..

 

if am using {!Now()} in template... date format is changing according to locale.

 

I tried by giving the date field directly and am receiving the output "Thu Feb 23 00:00:00 GMT 2012."

 

I tried  {!day(relatedTo.Datefield__c)}/{!month(relatedTo.Datefield__c)}/{!year(relatedTo.Datefield__c)}, here i have defined the format.. so its not getting change according to the locale...

 

Give me an idea to display date format according to the locale of user.

 

 

Hi All,

 

         I am using VisualForce Email template and i need to do few validations in that email template. According to countries i need to display the date format. Is it possible to add java script in vf email template? if so please give me a sample.. am newbie to VF template.

 

Thanks in advance..

 

Ganesh

Hi All,

 

I have written a trigger on an object. I have written a logic to collect values from a custom setting.

 

In Custom Setting we are storing name of few classes.

 

So i will be receiving class name as value, I have to create instance of the class am receiving from the custom setting.

 

Please help me :(

 

Thanks in Advance..!!

Hi All,

 

I have a requirement to create Rule Engine, we have created a set of rules and stored in an object. Each rule will have some Rule Criteria and Rule result (Child objects of rule object). 

 

whenever i tried to update an Account. That record should go through all the rules and compared with all rule criteria.Each rule criteria will have some conditions. if all the rule criteria's are satisfied, we need to update a field in account object by rule result.

 

To accomplish this requirement,

 

I have created Three objects,

 

Rule-Master object

Rule Criteria - Child object

Rule Result - Child object.

 

Whenever i tried to update one record, trigger will call this method and loop through all the rules, rule criteria and update rule result value on the field.

 

Currently it is working. but we may hit some performance issue in future, because using "for loop" we going though Rule then looping all the Rule Criteria then looping though all the Rule results.

 

Please let me know, If you have any idea to complete this requirement in simple way.

 

 

Thanks in advance :)

Hi All,

 

I am planning to Take ADM 201, Recently i completed DEV 401.

Please suggest me how can i crack 201 exam.

 

Thanks and Regards,

Ganesh Babu.

Hi All,

 

I have created a custom object, using a controller i need to collect a list of records belonging to a custom object and display all the records in a VF Page. Please give me some code snippet to complete this.

 

Thanks in advance :)

Hi All,

 

             I am trying to collect a value of the selected checkbox, am new to visualforce.

<apex:page controller="chooseColor">
    <apex:form id="Form1" >
    <script type="text/javascript">
        function ToggleInput(theId)
            {
                var e = document.getElementById(theId);
                alert(e.value);
            }
        function ToggleInput2(Idd)
            {
                var e = document.getElementById(theId);
                alert(e.value);
            }

    </script>
    
<apex:selectList id="chooseColor" value="{!string1}" onchange="ToggleInput('{!$Component.chooseColor}');">
    <apex:selectOption itemValue="red" itemLabel="Red"/>
    <apex:selectOption itemValue="white" itemLabel="White"/>
    <apex:selectOption itemValue="blue" itemLabel="Blue"/>            
</apex:selectList>

<apex:selectCheckboxes id="chooseColor1" value="{!string1}" onchange="ToggleInput2('{!$Component.chooseColor1}');">
    <apex:selectOption itemValue="red" itemLabel="Red" id="ID1" title="1"/>
    <apex:selectOption itemValue="white" itemLabel="White" id="ID2" title="2"/>
    <apex:selectOption itemValue="blue" itemLabel="Blue" title="3"/>            
</apex:selectCheckboxes>  

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

 

 Apex Controller Code:

public class chooseColor {
    String s = 'blue';
    public String Val{get;set;}
 
    public String getString1() {
        return s;
    }
                        
    public void setString1(String s) {
        Val = s;
        system.debug('Value+++'+Val);
        this.s = s;
        
    }
}

 When i try the apex:selectList am getting proper values, but am getting undefined for apex:selectCheckbox tag's. Please tell me where i have done the mistake.

 

else tell me how to find the selected checkbox. I have three checkbox and am selecting only two, i need to find the selected checkbox alone. give some idea.

 

Thanks in advance.. :)

Hi all,

 

Can anyone tell me how to collect the opportunity id from the list view displaying opportunity record.

 

I have a list view in new opportunity page..

 

 

i should select the opportunity and when i click the send mass email button. it has to collect id of the selected opportunity and mail to the owner of the record.

 

Can anyone give me a solution for this?

 

 

Hi all,

 

I have created a VF Page.. I need to validate the values entering in a text box.

 

I should not enter more than three characters in that text box.

 

If i enter a value in text box, that value should pass to a java script function and that should validate and throw a error.

 

Please give me a sample code...

 

 

Hi All,

 

I want to share a opportunity through apex code and

 

i tried to set role id as userid or group id.. but its throwing a error like Database.Error[getFields=(UserOrGroupId);getMessage=User/Group ID: id value of incorrect type: 00EV0000000Hp7wTAP;getStatusCode=FIELD_INTEGRITY_EXCEPTION;]

 

so i planned to create a group and add members belongs to that role.. after creating group i can set the group id while sharing opportunity.

 

i need to create a group and add few members in a group through apex code,

 

am not getting how to create group and add members through apex code.

 

Please give me a solution...

 

Thanks in advance.. :)

Hi All,

 

I want to display a date field in VisualForce Email template.

According to user locale language selection.. the date format should get change.

If an user is from US... date should display in MM/DD/YYYY format

For UK user date should display in DD/MM/YYYY format..

 

if am using {!Now()} in template... date format is changing according to locale.

 

I tried by giving the date field directly and am receiving the output "Thu Feb 23 00:00:00 GMT 2012."

 

I tried  {!day(relatedTo.Datefield__c)}/{!month(relatedTo.Datefield__c)}/{!year(relatedTo.Datefield__c)}, here i have defined the format.. so its not getting change according to the locale...

 

Give me an idea to display date format according to the locale of user.

 

 

Hi All,

 

         I am using VisualForce Email template and i need to do few validations in that email template. According to countries i need to display the date format. Is it possible to add java script in vf email template? if so please give me a sample.. am newbie to VF template.

 

Thanks in advance..

 

Ganesh