• mac admin
  • NEWBIE
  • 75 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 57
    Questions
  • 88
    Replies
Hi all,

I have created a custom vfpage for edit view for custom object. In that custom vfpage using action support with onchange event I'm showing/hiding the fields based on the picklist value selection. I was unable to update the field values if I edit the record and change the picklist value and filled the data in the related fields.

Can anyone help me over here.

Thanks in advance.

Regards,
mac.
Hi all,
Can we make the Role field as madetory, While creating user. Actually it shows as madatory but it is not madatory. Can anyhelp how we can make Role field as mandatory other than using validation rule(If I'm wrong correct me.)

Thanks in advance,

Regrads,
mac.
Hi all,

Can anyone help me in writting the test class for the below class.
 
trigger EdiGra on Form__c (after update) {
  Schema.DescribeSObjectResult objSchema = Form__c.sObjectType.getDescribe();
  Set<String> fields = objSchema.fields.getMap().keySet();
  
    String[] changedFields  = new String[]{};

    for(Form__c c: trigger.new){
        for(string s: fields){
            if(c.get(s) != trigger.oldMap.get(c.Id).get(s)){
                changedFields.add('GForm :' + c.Name + ' - ' + s + ' - Old Value:' + trigger.oldMap.get(c.Id).get(s) + ' New Value:' + c.get(s));
            }
        }
    }
    if(changedFields.size()>0){
      messaging.singleEmailMessage mail = new messaging.singleEmailMessage();
        mail.setToAddresses(new string[]{UserInfo.getUserEmail()});
        mail.setReplyTo(UserInfo.getUserEmail());
        mail.setSubject('Postal updated');

         
        string htmlBody = '';
        for (String s : changedFields){
            htmlBody += '<div> ' + s + ' </div>';
        }
        mail.setHtmlBody(htmlBody);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[]{mail});
  }
}

Thanks in advance.

Regarding,
mac.
Hi all,

I showing the success message after uploading the file as an attachment form custom vfpage. Now I want to clear the page message when I click the Browse button in custom vfpage. Can we achive this.

Can anyone help me over here.

Thanks in advance.

Regards,
mac.
Hi all,
I want to show the confirmation box before changing the picklist value in custom vfpage. Based on picklist value I'm showing the idfferent fields. So i want to show the confirmation box.

Can anyone help me over here.

Thanks in advance.
Hi all,
In custom vfpage with standard controller, I'm showing different fields based on picklist value selection using actionsupport component with the event as onchnage. I want to show a confirmation box before changing the picklist value. I'm using ready function but it's not working for me can any one help me over here.
<script type="text/javascript">

$(document).ready(function () {

    $(".department").on("change", function () {
        var ddlBrand = $('.department');
        var value = ddlBrand.val();
        var prevValue = ddlBrand.data('prev');

        if ( value != '--Select--' && prevValue && prevValue != '--Select--') {
        
        var confirmval = confirm('Values entered  will reset. Are you sure you want to change the picklist value.');
            if(confirmval == true){
               ddlBrand.data('prev', value) 
            }else{
                ddlBrand.val(prevValue )
            }
        }else{
            ddlBrand.data('prev', value)
        }
    });

});

</script>



Thanks in advance.

Regards,
mac
Hi all,
I want to make the standard date picker as readonly if a check box is checked in custom vfpage.
I have used readonly= true. but it doesn't worked for me.

Can anyone help me over here.

Thanks in advance.

Regards,
mac.
Hi all,
Can anyone help in writting the test class for the below extension class.

public class gdaControllerExtension {

    Public final GFrm__c gfrm;

    public gdaControllerExtension (ApexPages.StandardController stdController) {
        this.gfrm = (GFrm__c)stdController.getRecord();
    }

    
  public void mfarten()
  {

 
  if(gfrm.SelectProgram__c=='MA')
  {
      gfrm.Select_One_Art_Ed__c= null;
        
  }else if(gform.SelectProgram__c=='AED'){
 
      gfrm.SelectOne_MFA__c= null;

   
  }else if(gfrm.SelectProgram__c=='enroll'){
 
      gform.SelectOne_MFA__c= null;

 
  }
 
  }

}

Thanks in advace.

Regards,
mac.
Hi all,

I have written the test class for the standard controller extention. While I test run the test class the methods are failed. Below is my test class .

@istest
public class gdaControllerExtension_test {  
static testMethod void testreparentMethod()     {    
 GFrm__c gform = [SELECT ID FROM GFrm__c LIMIT 1];     ApexPages.StandardController stdController = new ApexPages.StandardController(gfrm);     gdaControllerExtension gdcon=new gdaControllerExtension(stdController);     
    gdcon.gfrm.SelectProgram__c='MA';
 gdcon.mfarten();   
}   
static testMethod void testparentreAddresMethod()     {     
GFrm__c gform = [SELECT ID FROM GFrm__c LIMIT 1];     ApexPages.StandardController stdController = new ApexPages.StandardController(gfrm);     gdaControllerExtension gdcon=new gdaControllerExtension(stdController);           
    gdcon.gfrm.SelectProgram__c='AED';
  gdcon.mfarten();   
}       
static testMethod void testparentresetAddressMethod()     {     
GFrm__c gform = [SELECT ID FROM GFrm__c LIMIT 1];     ApexPages.StandardController stdController = new ApexPages.StandardController(gfrm);     gdaControllerExtension gdcon=new gdaControllerExtension(stdController);     
     gdcon.gform.SelectProgram__c='Re-enroll';
 gdcon.mfarten();
  }
}


Can anyone help me over here.

Thanks in advance.

Regards,
mac.
Hi all,

how can we write test class for the standard controller extension. Below is my extenstion class
public class gdaControllerExtension {

    Public final GFrm__c gfrm;

    public gdaControllerExtension (ApexPages.StandardController stdController) {
        this.gfrm = (GFrm__c)stdController.getRecord();
    }

    
  public void mfarten()
  {

 
  if(gfrm.SelectProgram__c=='MA')
  {
      gfrm.Select_One_Art_Ed__c= null;
        
  }else if(gform.SelectProgram__c=='AED'){
 
      gfrm.SelectOne_MFA__c= null;

   
  }else if(gfrm.SelectProgram__c=='enroll'){
 
      gform.SelectOne_MFA__c= null;

 
  }
 
  }

}


Thanks in advance,

Regards,
mac.
Hi all,
I want to upload the multiple file attachemt form custom vfpage form Force.com Site. I was unable to upload the second file of same type for example If I have uploaded the first file as PDF , When I upload the second file as PDF then it's authorization error. Can anyone help me over here.

Thanks in advance.

Regards,
mac.
Hi all,
Can we make the Standard  Date picker as readonly when a check box is checked in custom vfpage. Is it posibble in custom vfpage..?


Can any one help me over.

Thanks in advance.

Regrads,
mac.
Hi all,
I'm losing the previous pages data when the current vfpage is reloaded/refreshed. In Force.com sites I have created 4 vfpages with a single controller. I'm redirecting the page with redirection method and In the last page I'm saving the data.

Can anyone help me over here.

Thanks in advance.

Regards,
mac.
Hi all,
I want to write the update method with in the same controller. For four vfpage i have written a single controller in the save method i have written a redirect method to second page with saved record ID. Now I want to update the second page values and redirect to third page.

Can anyone help me over here.

Thanks inadvance.

Regards,
mac.
Hi all,
I want to show the duplicate email validation error message in first Custom vfpage while redirecting to second vfpage. In Save method  I have written try catche method which is calling in the second page. But In the first page i want to show the duplicate email Id validation error message.

Can anyone help me over here.

Thanks in advance.
Regrads,
mac.
Hi all,
In my Force.com Sites First custom vfpage If I add the link as below:

<link REL="SHORTCUT ICON" HREF="{!URLFOR($Resource.favicon)}"/>

the javascript validations are not working. But for remaing pages It works fine. But in First page the it showing the issue.
And I also added the favicon to Sites by adding the image to Static resources as .ico formate and added the image to site. Even then the image is not showing.
Can anyone help me over here.
Thanks in advance.

Regrads,
mac.
 
HI all,

I have created four custom vfpages for Force.com Sites. I'm redirecting the pages with methods in custom controllers. I was displaying the fields based on picklist value.  When I'm redirecting to previous page,  after clicking previous button If I change the picklist value then firstly given values are not changing to null.

Can any one help me over here.

Thanks in advance.

Regards,
mac.
Hi all,

Can anyone help me how to write a trigger to update the picklist field in custom object when an record is created in another custom object, If the email ID's are same then picklist value should update.

Thanks in advance.
Regards,
mac.
Hi everyone,
Can anyone help me in writting test class for below calss.
trigger verifyUG on UnderLdes__c (after insert) {

Set<String> Email = new Set<String>();
Set<String> PhoneNumberSet = new Set<String>();

list<Form_Leads__c> test1  = new  list<Form_Leads__c> ();
list<Form_Leads__c> test2  = new  list<Form_Leads__c> ();

for(UnderLdes__c IL : trigger.new){
	if (IL.Email__c != null){
		Email.add(IL.Email__c);
	}
	if (IL.Cell_Phone_Number__c!= null){
		PhoneNumberSet.add(IL.Cell_Phone_Number__c);
	}
}
test1 = [SELECT id, Email__c, Cell_Phone_Number__c, Converted_Status__c FROM Form_Leads__c WHERE Email__c IN : Email AND 
Cell_Phone_Number__c IN: PhoneNumberSet limit 5000 ];


if(test1.size() > 0){
	for(Form_Leads__c t :test1){
		Form_Leads__c fl = new Form_Leads__c();
		f1.Id = t.Id;
		fl.Applied__c = true;
        fl.Converted_Status__c = 'Matched';
        test2.add(fl);
	}
}
if(test2.size() > 0{
	update test2;
}
}

 
Hi all,
Below is my trigger to update the status in the other object if the email is matched then it will update the status in the other object.
trigger verifyUG on UnderGradute__c (after insert) {
list<string> Email = new    list<string> ();
    list<string> phone = new    list<string> ();

    list<Form_Leads__c> test  = new   list<Form_Leads__c> ();
    list<Form_Leads__c> test1  = new  list<Form_Leads__c> ();
    list<Form_Leads__c> test2  = new  list<Form_Leads__c> ();
    
 for(UnderLad__c IL :trigger.new){
if (IL.Email__c != null){
Email.add(IL.Email__c);
}
if (IL.Cell_Phone_Number__c!= null){
phone.add(IL.Cell_Phone_Number__c);
}
}
test1=[SELECT id, Email__c, Cell_Phone_Number__c, Converted_Status__c FROM Form_Leads__c WHERE Email__c IN : Email limit 5000 ];
    
test=[select Cell_Phone_Number__c,Email__c, Converted_Status__c from Form_Leads__c where Id IN: test1 limit 5000];
    
system.debug('////'+test);
    
for(Form_Leads__c t :test){
if(test.size()!=null){
t.Applied__c= true; 
t.Converted_Status__c='Matched';
test2.add(t);
}

}
update test2;
}
In Sandbox it is working fine but in production it throwing an error as  System.LimitException: Too many query rows: 50001.

Can anyone help me over here.
Thanks in advance.


Regards,
mac.

 
Hi all,
Can anyone help in writting the test class for the below extension class.

public class gdaControllerExtension {

    Public final GFrm__c gfrm;

    public gdaControllerExtension (ApexPages.StandardController stdController) {
        this.gfrm = (GFrm__c)stdController.getRecord();
    }

    
  public void mfarten()
  {

 
  if(gfrm.SelectProgram__c=='MA')
  {
      gfrm.Select_One_Art_Ed__c= null;
        
  }else if(gform.SelectProgram__c=='AED'){
 
      gfrm.SelectOne_MFA__c= null;

   
  }else if(gfrm.SelectProgram__c=='enroll'){
 
      gform.SelectOne_MFA__c= null;

 
  }
 
  }

}

Thanks in advace.

Regards,
mac.
Hi all,

how can we write test class for the standard controller extension. Below is my extenstion class
public class gdaControllerExtension {

    Public final GFrm__c gfrm;

    public gdaControllerExtension (ApexPages.StandardController stdController) {
        this.gfrm = (GFrm__c)stdController.getRecord();
    }

    
  public void mfarten()
  {

 
  if(gfrm.SelectProgram__c=='MA')
  {
      gfrm.Select_One_Art_Ed__c= null;
        
  }else if(gform.SelectProgram__c=='AED'){
 
      gfrm.SelectOne_MFA__c= null;

   
  }else if(gfrm.SelectProgram__c=='enroll'){
 
      gform.SelectOne_MFA__c= null;

 
  }
 
  }

}


Thanks in advance,

Regards,
mac.
Hi all,
I want to write the update method with in the same controller. For four vfpage i have written a single controller in the save method i have written a redirect method to second page with saved record ID. Now I want to update the second page values and redirect to third page.

Can anyone help me over here.

Thanks inadvance.

Regards,
mac.
Hi all,
In my Force.com Sites First custom vfpage If I add the link as below:

<link REL="SHORTCUT ICON" HREF="{!URLFOR($Resource.favicon)}"/>

the javascript validations are not working. But for remaing pages It works fine. But in First page the it showing the issue.
And I also added the favicon to Sites by adding the image to Static resources as .ico formate and added the image to site. Even then the image is not showing.
Can anyone help me over here.
Thanks in advance.

Regrads,
mac.
 
HI all,

I have created four custom vfpages for Force.com Sites. I'm redirecting the pages with methods in custom controllers. I was displaying the fields based on picklist value.  When I'm redirecting to previous page,  after clicking previous button If I change the picklist value then firstly given values are not changing to null.

Can any one help me over here.

Thanks in advance.

Regards,
mac.
Hi all,

Can anyone help me how to write a trigger to update the picklist field in custom object when an record is created in another custom object, If the email ID's are same then picklist value should update.

Thanks in advance.
Regards,
mac.