• gomennasai123@n.org
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 0
    Replies
I want to create a Json string that has a document that shows base64
ex.
{ "first name" : "Rob, "mypdfdoc" : "AAASDECgtNhr==" }

when I pass the file to JavaScript it encodes it to base64 .
when I pass it back to a string type in my controller it shows [file type object]
not AAASDEC...
Any ideas why it is not showing it as a base64 string, instead displays [file type object] in the debug log?
Basically I want to take the base64 string and use put to assign to a map
thank you
 

I have a controller that has the following lines of code. (abbreviated for example purposes)

 

public  with sharing class  myReferralController2  {

public string   CaseAppMonth(string mymonth) {
  string mynumbermonth;
 
   if    (mymonth == 'Jan') {
          mynumbermonth ='1';    }
      else
       if (mymonth == 'Feb') {
           mynumbermonth ='2';    }
      else
       if  (mymonth == 'Mar') {
            mynumbermonth ='3';    }
    if      (mymonth == 'Apr') {
           mynumbermonth ='4';    }
      else
       if (mymonth == 'May') {
          mynumbermonth ='5';    }
      else
       if (mymonth == 'Jun') {
           mynumbermonth ='6';    }
      else
       if (mymonth == 'Jul') {
          mynumbermonth ='7';    }
      else
       if (mymonth == 'Aug') {
           mynumbermonth ='8';    }
       else
       if (mymonth == 'Sep') {
           mynumbermonth ='9';    }
      else
       if  (mymonth == 'Oct') {
            mynumbermonth ='10';    }
      if   (mymonth == 'Nov') {
            mynumbermonth ='11';    }
      if   (mymonth == 'Dec') {
            mynumbermonth ='12';    }
      
 
   return mynumbermonth;                       }

 

 

 

my unit test is something like this:

 

myReferralController2 cc1 = new  myReferralController2();
              cc1.NewReferralClientc.Client_Rep_ID__c='DEC79EN';
           .      .
.           cc1.getChooseReferral();
           cc1.ReferralType='Engagement';
           List<SelectOption> ChoosePartner =    cc1.getChoosePartner();
           cc1.PartnerProviderType = 'TNCSA';
           List <string> appointmentlist1 = cc1.getlistappointments();
                                            cc1.getDateAppointmentsListValue();
         list <SELECTOPTION> options = cc1.getDateAppointmentsoptions();
                                     cc1.AddDateTime();
                 
                                    cc1.IsDateAndTimeSelected();
                                    cc1.norefresh();
                               
           cc1.NewReferralClientc.Client_Rep_ID__c  = 'DEC79EN';
           cc1.ClientFirstName  = 'Bob';
           cc1.ClientLastName = 'Smith';
           cc1.ClientLastFour ='0900';
           cc1.ClientPhone ='2152345677';
               
        
           string numbermonth = cc1.CaseAppMonth('Jun');
           system.assertequals('6',numbermonth);
         

 

When I  run the Unit test I don't see any increase in coverage.

Can you show me how to cover the if else branch and how to call caseappMonth?

 

Thank You

 

 

 

 

 

 

Hi All;

 

I have Pageblock mode = edit in my VF page

I can only update the values from the parent SOQL query but no values from the subquery although I can display both values.

 

Below is my code and a screen shot. ( I added the basic lines to explain further)

 

 <apex:PageBlock mode="edit" id="block">

 

<apex:datatable value="{!searchResults}"  var="r" columns="10">
    
<!--   <apex:column headervalue="FirstName" style="width:200px"/> <apex:column headervalue="LastName" style="width:200px" /><apex:column headervalue="Time" style="width:200px"/>-->
   
   <apex:column >
  <apex:inputField value="{!r.Name}"/>&nbsp;&nbsp;
  </apex:column>
    <apex:column >
  <apex:inputField value="{!r.First_Name__c}"/>
  </apex:column>


 
 
         <apex:datatable value="{!r.Referral_Appointments__r}" var="a" >
            
       
    
    <apex:column >
      
           <apex:inputField value="{!a.Partner_Service_Provider__c}"/> <- does not update
           
    </apex:column>
    
    

 

My query from the controller:


 public list<new_referral_client__c> searchResults {get; set;}

public list<Referral_Appointment__c> ReferralApp1 {get; set;}

 

 

public PageReference search() {
 
  if (searchText != null && searchtext.length() > 0)
     {
    string selectstatement = 'select id,(select a.id, a.Appointment_date__c,a.timepick__c, a.partner_service_Provider__c,status__c from Referral_Appointments__r a), Name, First_Name__c,Last_Name__c,Cell_Phone__c,Last_4_digits_of_ssn__c,Referral_Type__c from new_referral_client__c ' ;
    string wherestatement = 'where (OwnerId = ' + '\'' +UserInfo.getuserID() + '\')' + ' and Last_Name__c LIKE \'%'+searchText+'%\'   order by Last_Name__c  ';   
    string qry =   selectstatement + wherestatement;  
     searchResults = Database.query(qry);
     

 

I can update fields Name, First_Name__c,,Last_Name__c etc....

but not  a.Appointment_date__c,a.timepick__c, a.partner_service_Provider__c,status__c which is my subquery.

 

This is where the update occurs

public PageReference save() {
    
   // if (searchResults != null)
    //   {
         
      
           }  
      try
        {
        update searchResults; <- this updates in edit mode
        update ReferralApp1; <- not sure how to update the subquery values in edit mode Thought it would do it by default.

 

Thank You for your help.

 

Steve