• mdinatale
  • NEWBIE
  • 25 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 21
    Questions
  • 15
    Replies

Okay, ive been googleing this for hours, can't seem to figure it out. My production overall code coverage is 70% so i can't update any code on production. So how do i update my code on production to raise the test conditions if i can't update any code? I do have eclipse. Any help will be much appreciated.

This is probably simple but i can't seem to figure this out. Just want to make the date field blank, what ever date is it it, make it gone :-). I get a not valid value. Thanks in advance

 

$theID = $record->Id;
		           $setA = array(            		    
			   'Appointment_Date_Time__c' => NULL,
			   'fixdate__c' => 'Y'            				
            				);
			 $saveObj1 = new SObject();
            		 $saveObj1->fields = $setA;
            		 $saveObj1->type = 'Work_Order__c';
			 $saveObj1->Id = $theID; 								 		
          		 $allOBJ[] = $saveObj1; 
								 
			if(!empty($allOBJ)){
              		   $createResponse = $mySforceConnection->update($allOBJ);
										 
              }	

 

Im trying to insert data when the vF page loads, Whats the best way to do this. I either get a DML error or page not commited. Page not commited the data goes into the object but gives the error. Any help would be apreciated

I have a object that i need to migrate the data to a new object, then remove the old object. Im not worried about removing the old object thats the easy part. Whats the best way to get all the data from object A to object B they have different structures. Do i wright a class and execute it some how, or do i use the data loader? Whats the best way to do this, Thanks in advance

I have saved data before but not from a datatable, basically what i want to do is save each row of data as a new record in my object. Not sure how to do this. It displays the data exactly how i want it just need to save it. I really need some direction any help would be appreciated.

 

<apex:page standardController="Zones_List__c" extensions="RAPI"  showHeader="false" sidebar="false" standardStylesheets="false">
  Zones
  
  
  <apex:outputPanel id="databox" >                   
    <apex:outputPanel id="dataPanel">     
       <apex:outputText value="{!DisplayZones}"  escape="false"/>
    </apex:outputPanel>
  </apex:outputPanel>
  
   <apex:form >
         
         <apex:commandButton id="ZoneUpdate" action="{!ZUpdateList}"  value="Update Zones" />
         <apex:inputText id="account_num" value="{!Zones_List__c.Account__c}"/>         
        <apex:pageBlock title="Zones" id="tblId">
          <apex:dataTable value="{!ZS}" var="r" cellPadding="4" border="1">
           <apex:column >
            <apex:facet name="header">Zone</apex:facet>
            <apex:outputText value="{!r}" />
            <!--<apex:inputText id="rZone" value="{!Zones_List__c.Rapid_Zone_Name__c}"/> -->
           </apex:column>
           <apex:column >
             <apex:facet name="header">Equipment</apex:facet>
              <apex:selectList size="1" id="equip" value="{!Zones_List__c.Equipment_Points__c}">
                <apex:selectOptions value="{!Equip}"/>
              </apex:selectList>            
           </apex:column>
           
           <apex:column >
             <apex:facet name="header">Location</apex:facet>
              <apex:selectList size="1" id="location" value="{!Zones_List__c.Location__c}">
                <apex:selectOptions value="{!ZLoc}"/>
              </apex:selectList>
            
           </apex:column>
           
          </apex:dataTable>          
         </apex:pageBlock>
         
     </apex:form>

</apex:page>

 

I'am able to sort my list with .sort() it is a string field but the results are

 

1

2

3

4

41

43

44

5

TTO

 

I need it to be

1

2

3

4

5

41

43

44

TTO

 

Any help would be greatly appreciated.

I tried to upload my code which has 100% test coverage but i guess the site as a whole is only 58% how do i find out which ones i can improve on do i just run all test and check to see which ones need to be fixed? Thanks

I've been trying this for hours now with no luck. I have a standard controller and a extension, I want to pass a var to the extension controller so when the page is loaded the proper data is viewed. So TestStatus needs a value to work properly how to i get it the value so when the page loads it knows that value.

 

<apex:page standardController="Account" extensions="rpI"  showHeader="false" sidebar="false">
 <apex:form >

 <apex:outputText value="{!TestStatus}" escape="false"> 
 
 </apex:outputText>
 
 </apex:form>
 
</apex:page>

 

I installed a package from app exchange and modified it on the sandbox side and it works fine, how do i get it to the production side, do i still need to do a test condition and deploy it like i normally would?

Is it possible to pass variables before login? For example i login here https://login.salesforce.com/ could i add on https://login.salesforce.com/?myvar=12345 and then run some apex code to do something with that variable once i login. Thanks in advance

 

Matt

I've been trying to research this for a while but can't come up with a solution. Im trying to get the windows user name and log that into salesforce. I don't have ldap setup in salesforce. I have AD and ldap on my network. Is there a way to get the windows username?

Im trying to round a decimal number just like php does but im having different outcomes with different numbers. I just need the standard round function like php. Ive tried these. Thanks foryour help

 

bpm = math.ceil(bpm);
bpm = math.round(bpm);
bpm = bpm.setscale(2);
bpm = math.roundToLong(bpm);

 

 

the value is 102.5 and it makes it 102 i need it to be 103. How can i do this. Thanks in advance

 

 

 

bpm = dc.Principal_Balance__c * (dc.Percent__c/100);
                            if(dc.Round_Payment__c){
                            
                             bpm = bpm.round();
                           }                                                         
                           pm += bpm;                

 

I Have a checkbox that the default checked is set in the object. I created a visualforce page with the checkbox. But when i hit the new button it is not checked. How do i make the default value checked. Thanks

 

<apex:inputCheckbox value="{!Debt_Info__c.Round_Payment__c}" />

 

I created a visual forcepage that has a master-detail record. When i select the magnifying glass and choose a value it puts in the name into the field, is ther a way to get the id as well? I have some javascript doing and field value but it returns the name, i need the id. Thanks in advance

I created a debt object and i have it opening a visualforce page on new and edit. I have a master-detail record to another object called creditor. On the standard edit there was a little page with a hour glass you could press to popup a search. How would i do this in the visual force page. Any help would be appreciated. Ive been trying diffrent things but can't figure it out.

I can't seem to get the data from the text box into newpicklistvalue variable in the class to update my data. Please help been trying to do this for a couple days now with no success. It seems like this should work. Thanks in advance.

 

public with sharing class dynamicpicklist
{
public ApexPages.StandardController city {get; set;}
 
     public dynamicpicklist(ApexPages.StandardController controller) {
        this.city = controller;
     }


        public List<SelectOption> getcitynames()
        {
          List<SelectOption> options = new List<SelectOption>();
          List<Client_Spouse_Picklist__c> citylist = new List<Client_Spouse_Picklist__c>();
          citylist = [Select Account__c, Full_Name__c FROM Client_Spouse_Picklist__c ];
          options.add(new SelectOption('--None--','--None--'));
          for (Integer j=0;j<citylist.size();j++)
          {
              options.add(new SelectOption(citylist[j].Full_Name__c,citylist[j].Full_Name__c));
          }
          return options;
        }
        public String newpicklistvalue{get; set;}
                
         
        public Pagereference saverec()
        {                    
            State_Fee_limit__c sfl = new State_Fee_limit__c();
            sfl.State__c = 'ZZ';
            sfl.Fee__c = 2;
            sfl.Min_Fee__c = 10;
            sfl.Max_Fee__c = 50;
            sfl.Note__c = newpicklistvalue;            
        
          insert sfl;   
         
          newpicklistvalue=NULL;
          return NULL;
        }
    
}

 

<apex:page standardController="Payment_Info__c" extensions="dynamicpicklist" sidebar="false" >

<script language="JavaScript">   
function saveit(sl){
document.getElementById("{!$Component.theForm.newval}").value=sl.value;
document.getElementById("{!$Component.theForm.saveme}").click();
}
</script>
<apex:form id="theForm">
          <apex:outputlabel value="Name On Check" for="values" />        
          <apex:selectList value="{!city}" size="1" id="values" onchange="saveit(this);">
              <apex:actionSupport event="onchange" reRender="newvalue" />
              <apex:selectOptions value="{!citynames}"/>
          </apex:selectList>          
      
      display:none;"/>      
          <apex:outputpanel id="newvalue">           
             <apex:outputpanel >
                        
                  <apex:outputlabel value="New value" for="newval" />
                  <apex:param name="newpicklist" value="1:123" assignTo="{!newpicklistvalue}" />
                  <apex:inputText value="{!newpicklistvalue}" id="newval"/>                                                    
                  <apex:commandbutton id="saveme" action="{!saverec}" immediate="true" value="Add!" style="visibility:hidden; display:none;"/>                                     
             </apex:outputpanel>
          </apex:outputpanel>             
   

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

 

Is there a way in a trigger to only return numeric from a text string? Trying to do some field validation. Thanks

I have a custom object which i have choosen open window using a visualforce page. in the Page i have javascript that should pop up a alert but it doesn't, What am i doing wrong, Thanks

Hope someone can point me in the right direction, i've created a custom object with client data in it, The fields are account and full name. What i'am looking for is when you click the magnifying glass next to the text field nothing comes up you have to search for something, i want the names to come up for that specific account id. Is there a way when you click the magnifying glass the search is pre populated? Thanks in advance

Okay, ive been googleing this for hours, can't seem to figure it out. My production overall code coverage is 70% so i can't update any code on production. So how do i update my code on production to raise the test conditions if i can't update any code? I do have eclipse. Any help will be much appreciated.

Im trying to insert data when the vF page loads, Whats the best way to do this. I either get a DML error or page not commited. Page not commited the data goes into the object but gives the error. Any help would be apreciated

I have a object that i need to migrate the data to a new object, then remove the old object. Im not worried about removing the old object thats the easy part. Whats the best way to get all the data from object A to object B they have different structures. Do i wright a class and execute it some how, or do i use the data loader? Whats the best way to do this, Thanks in advance

 

the value is 102.5 and it makes it 102 i need it to be 103. How can i do this. Thanks in advance

 

 

 

bpm = dc.Principal_Balance__c * (dc.Percent__c/100);
                            if(dc.Round_Payment__c){
                            
                             bpm = bpm.round();
                           }                                                         
                           pm += bpm;                

 

I Have a checkbox that the default checked is set in the object. I created a visualforce page with the checkbox. But when i hit the new button it is not checked. How do i make the default value checked. Thanks

 

<apex:inputCheckbox value="{!Debt_Info__c.Round_Payment__c}" />

 

I can't seem to get the data from the text box into newpicklistvalue variable in the class to update my data. Please help been trying to do this for a couple days now with no success. It seems like this should work. Thanks in advance.

 

public with sharing class dynamicpicklist
{
public ApexPages.StandardController city {get; set;}
 
     public dynamicpicklist(ApexPages.StandardController controller) {
        this.city = controller;
     }


        public List<SelectOption> getcitynames()
        {
          List<SelectOption> options = new List<SelectOption>();
          List<Client_Spouse_Picklist__c> citylist = new List<Client_Spouse_Picklist__c>();
          citylist = [Select Account__c, Full_Name__c FROM Client_Spouse_Picklist__c ];
          options.add(new SelectOption('--None--','--None--'));
          for (Integer j=0;j<citylist.size();j++)
          {
              options.add(new SelectOption(citylist[j].Full_Name__c,citylist[j].Full_Name__c));
          }
          return options;
        }
        public String newpicklistvalue{get; set;}
                
         
        public Pagereference saverec()
        {                    
            State_Fee_limit__c sfl = new State_Fee_limit__c();
            sfl.State__c = 'ZZ';
            sfl.Fee__c = 2;
            sfl.Min_Fee__c = 10;
            sfl.Max_Fee__c = 50;
            sfl.Note__c = newpicklistvalue;            
        
          insert sfl;   
         
          newpicklistvalue=NULL;
          return NULL;
        }
    
}

 

<apex:page standardController="Payment_Info__c" extensions="dynamicpicklist" sidebar="false" >

<script language="JavaScript">   
function saveit(sl){
document.getElementById("{!$Component.theForm.newval}").value=sl.value;
document.getElementById("{!$Component.theForm.saveme}").click();
}
</script>
<apex:form id="theForm">
          <apex:outputlabel value="Name On Check" for="values" />        
          <apex:selectList value="{!city}" size="1" id="values" onchange="saveit(this);">
              <apex:actionSupport event="onchange" reRender="newvalue" />
              <apex:selectOptions value="{!citynames}"/>
          </apex:selectList>          
      
      display:none;"/>      
          <apex:outputpanel id="newvalue">           
             <apex:outputpanel >
                        
                  <apex:outputlabel value="New value" for="newval" />
                  <apex:param name="newpicklist" value="1:123" assignTo="{!newpicklistvalue}" />
                  <apex:inputText value="{!newpicklistvalue}" id="newval"/>                                                    
                  <apex:commandbutton id="saveme" action="{!saverec}" immediate="true" value="Add!" style="visibility:hidden; display:none;"/>                                     
             </apex:outputpanel>
          </apex:outputpanel>             
   

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

 

I have a custom object which i have choosen open window using a visualforce page. in the Page i have javascript that should pop up a alert but it doesn't, What am i doing wrong, Thanks

Hope someone can point me in the right direction, i've created a custom object with client data in it, The fields are account and full name. What i'am looking for is when you click the magnifying glass next to the text field nothing comes up you have to search for something, i want the names to come up for that specific account id. Is there a way when you click the magnifying glass the search is pre populated? Thanks in advance

Please help with test condition it passes in Develop->Apex Test Execution  but when i go to deploy it fails, Not even sure if im doing it right. Been working on this for days. Trigger is on custom object Debt_Info

 

Fails with

Failure Message: "System.DmlException: Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, invalid cross reference id: []", Failure Stack Trace: "Class.Test_Dept_info_trigger.myTest: line 11, column 8 External entry point"

 

 

trigger Monthly_Payment on Debt_Info__c (after update, after insert) {

for(Debt_Info__c mPay : Trigger.new){
LIST<Debt_Info__c> i = [SELECT Name, Principal_Balance__c, Percent__c, Creditor_Table__c FROM Debt_Info__c WHERE Opportunity__c =: mPay.Opportunity__c];

decimal pm = 0.00;
for(Debt_Info__c dc: i){
if(dc.Principal_Balance__c != null){
pm += dc.Principal_Balance__c * (dc.Percent__c/100);
}
}

State_Fee_limit__c sf = [SELECT Fee__c FROM State_Fee_limit__c WHERE State__c = 'MI'];


decimal sfv = sf.Fee__c;

sfv = pm * sfv;
pm = pm + sfv;

opportunity o = [SELECT Monthly_Payment__c FROM opportunity WHERE Id =: mPay.Opportunity__c LIMIT 1];
o.Monthly_Payment__c = pm;
o.CCC_Fee__c = sfv;
update o;
}


}

 

 

 

public class Test_Dept_info_trigger {

    static testMethod void myTest() {
 
       
       // Create a Lead
        Lead l = new Lead();
            l.FirstName = 'Test';
            l.LastName = 'Lead';
            l.Company = 'Test Company';
            l.Email = 'leademail@example.com';
        insert l;
 
        // Create an Account
        Account a = new Account();
            a.Name = 'Test Account';
        insert a;
 
        // Create a Contact
        Contact c = new Contact();
            c.FirstName = 'Test';
            c.LastName = 'Contact';
            c.AccountId = a.Id;
            c.Email = 'contactemail@example.com';
        insert c;
 
        // Create Opportunities
         //list<Opportunity> l_Opps = new list<Opportunity>();
        Opportunity o = new Opportunity();                      
            o.AccountId = a.id;
            o.Name = 'Test Opportunity';
            o.CloseDate = date.today();
            o.StageName = 'Qualified';
            o.Sales_Monthly_Fee__c = 49;
            o.Description = 'Test Opportunity Description';
        //l_Opps.add(o);
 
      
         insert o;
         
        //insert l_Opps;
       
       
       Creditor_Table__c cr = [SELECT Name FROM Creditor_Table__c WHERE Name = 'CITI' LIMIT 1];
       
       Debt_Info__c tdebt = new Debt_Info__c(Creditor_Table__c=cr.Id,Opportunity__c=o.id,Principal_Balance__c=1000);
       
       insert tdebt;
    
    
    
     }   
}