• davidjbb
  • NEWBIE
  • 50 Points
  • Member since 2012

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 36
    Questions
  • 44
    Replies
                  for(jbbfc2__MaterialU__c mu :[select jbbfc2__Workorder__c,jbbfc2__Workorder__r.Id, Name,
                  	jbbfc2__Material__r.jbbfc2__ProductCode__c,jbbfc2__Material__r.jbbfc2__UnitPrice__c,jbbfc2__quantity__c
                  	from jbbfc2__MaterialU__c where jbbfc2__Workorder__r.jbbfc2__Status__c ='Closed'])
                  {
              		  
              		  System.debug('Workorder Id' + mu.jbbfc2__Workorder__r.Id);
              		  System.debug('Material' + mu.Name);
              		  
              		  matList.add(mu);
              		  if(muMap.get(mu.jbbfc2__Workorder__r.Id)==null){	
              		  	
                      	muMap.put(mu.jbbfc2__Workorder__r.Id, matList);
              		  }
                  }

 

For matList.add(mu);

It's adding all the materials to the matList regardless which jbbfc2__Workorder__r.Id it belongs too..How can i fix this? Right now i'm just adding all the records in the matList

 

Hello,

 

 

How can I rewrite the following so I don't run the soql in the for loop, however,

each Workorder has it's own material list of items.

 

		           	
                for(jbbfc2__Workorder__c wo : workorderList){  
		         materialUList = [select jbbfc2__Workorder__c, Name
                                from jbbfc2__MaterialU__c 
                                where jbbfc2__Workorder__r.jbbfc2__Status__c ='Closed' AND jbbfc2__Workorder__c =:wo.id];
 	             
                  InvoiceObj invObjItem = new InvoiceObj(wo, wrMap, materialUList);
                  this.invObjList.add(invObjItem);
                 }

 

Hello Community,

 

From my system.debug I got the following: 

2012-08-17 17:16:00

I am trying to do a SOQL on DateTime i.e

 where (jbbfc2__Start_Date__c >= :getFromDate() and jbbfc2__finished_date__c <= :getToDate())

 

However, my SOQL isn't taking into consideration of the dates and I believe it's the dateTime from getFromDate() and getToDate()

 

                //Get From Date

                public datetime getFromDate(){                  

                        System.debug('FROM DATE'+ controllerObject.Start_Date__c);

                        return this.fromDate = controllerObject.Start_Date__c;

                        

                }

 

How do I convert the DateTime to the following, so the query will work?

 

  • YYYY-MM-DDThh:mm:ss+hh:mm
  • YYYY-MM-DDThh:mm:ss-hh:mm
  • YYYY-MM-DDThh:mm:ssZ

Hello,

 

I need help with the following setScale, not sure why it's not working. I need to be able to set certain number fields with trailing 0. In this case I need a trailing 4 decimal places even if it's 0

 

quantity__c is Number(18, 0) (I had it set to 14,4..nothing changed)

 

m.quantity__c = (m.quantity__c).setScale(4);

 

The value would appear as ie. 10.0

 

If m.quantity__c was a string field I believe the setScale(4) works but i dont want to create unnecessary fields..

Hello,

 

The example provided by Salesforce:

 

<!-- Page: --> 
    

<apex:page controller="repeatCon" id="thePage">

    <apex:repeat value="{!strings}" var="string" id="theRepeat">

        <apex:outputText value="{!string}" id="theValue"/><br/>

    </apex:repeat>

</apex:page>

			

/*** Controller: ***/ 
    

public class repeatCon {



    public String[] getStrings() {

        return new String[]{'ONE','TWO','THREE'};

    }

}

 Displays 

 

<span id="thePage:theRepeat:0:theValue">ONE</span><br/>

<span id="thePage:theRepeat:1:theValue">TWO</span><br/>

<span id="thePage:theRepeat:2:theValue">THREE</span><br/>

 

How can I code it in a way it'll show the following:


ONE

TWO

THREE

 

Instead of

 

<span id="thePage:theRepeat:0:theValue">ONE</span><br/>

 

I plan on doing an export on the VF page using contentType and will display the following

 

<salorder>
"sForce",,,"The Landmark @ One Market",,"San Francisco","CA","94087","US"
"1","00004757" ,"7-9-2012","7-9-2012","0.00","0.00" 
"","1.0000","0.0000","0.00" Fieldworker Rate
</salorder>

 

I should be able to display the following above in the same format, spacing etc. The above would be considered one record so there will be multiple <salorder> </salorder> based off my data construction.

Hello,

 

I've recently installed our app into the client's production environment. We first had the app in their sandbox environment for testing before installing into production, however, when I went to uninstall the beta package due to an update on our app i got the following error:

 

This extension depends on the package you are trying to uninstall. [Name]

 

Do we need to refresh the sandbox because we have already installed the package on production?

 

If so, can I uninstall it on the sandbox and install a brand new one?

 

Thanks!

        
        <apex:selectList value="{!company}"  size="1" >
            <apex:selectOptions value="{!items}"/> 
       </apex:selectList>  

 

Is there a way to merge the rerender + action from the command button into the Select List. Currently, the Button refreshes the service Calendar based on the selected option, but I want it refreshed based on whatever was selected on the picklist instead of using the button

 

the companyView method has the getItems method from the selected options.

      

      <apex:commandButton rerender="serviceCalendarPanel"action="{!companyView}"value="Refresh Calendar"status="loadingStatus"/>

 

       

Hello Community. 

 

I have the following List.

 

List<jbbfc2__Fieldworker_Name__c> team = new List <jbbfc2__Fieldworker_Name__c>([Select Team__c From jbbfc2__Fieldworker_Name__c]);
 

 

 I can't do Select Distinct for SOQL, so how can I remove all the duplicate Team__c. I need the values to be inserted into a List collection.

 

I'm not that great in coding, so go easy on me :)

 

Thank you,

Davidjbb

Hi Community,

 

I'm looking to get a Apex Input Field on a VF page called, ex Page1

<apex:inputFieldid="fromDate"value="{!Workorder__c.Start_Date__c}"required="true"/>


and use it for whatever I want in an Apex Class then output that Input field on Page 2

 

I'm not sure how to setup the Apex Class to grab the Input Field from Page one, manipulate the Input Field in the Apex Class, and then Display it on Page 2

 

 

 

Hi Guys,

 

I need help writing a test method without using "delete,insert, or update" in the test method. 

 

The trigger activates another trigger that does a web call out so I want to make sure it doesn't

 

trigger AccToFieldworkerBD on Account (before delete) {

set<String> setAccUser = new set <String> ();

for (Account a :trigger.old){ 
if (a.teamlead__c==true)  { 
setAccUSER.add(a.username__c); 
}
}
list <jbbfc2__Fieldworker_name__c> toDel = new list <jbbfc2__Fieldworker_name__c> ([select jbbfc2__username__c from jbbfc2__Fieldworker_name__c where jbbfc2__username__c in :setAccUser]);

if (toDel.isEmpty() == false){
delete toDel;   
}
}

 

Hello.

 

I need help removing all the picklist values from the following. I'm not sure how to do that. I want to be able to clear the selected picklist value then add a new one

 

 

jbbfc2__FieldworkersId__c = picklist field

mapWO = is a map



mapWO.get(v.id).jbbfc2__FieldworkersId__c = (remove all the values or unselect the value currently selected)

 

//add new value

mapWO.get(v.id).jbbfc2__FieldworkersId__c = v.Team_LeaderFWD__c;

Hello,

 

What's a good way to write test cases for fields that you've created within a class.

 

i've created alot of fields that are used on a VF page..I've already used all the methods within the Test case, but Salesforce shows a red line on the bolded.

 

My test method is also used within the same class.

 

so..

public with sharing class UMaterialController 

{

private string test;

test = 'asdf';

etc..etc..

 

public string getTest()
{
return test;
}

 

 

static testMethod void UMaterialControllerTest(){

 

}

}

 

 

Hello,

 

I have a trigger that creates a new record in another object.

 

The Name field is an autonumber with a display format of R-{0000}

 

This needs to display into another field of the other object. However, when that record is created the field is generated with the autonumber but not the display format of R-{0000}.


Any ideas on how I can still show the display format?


Cheers

Davidjbb