• jason.wan
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 3
    Replies

Anyone know of a way to get the Week of the Month (number 1 to 5 depending on month/calendar) in Apex Classes?

If there is custom code that someone has built, please let me know.  THANKS.

 

 

I only found Day of Year for the Salesforce datetime methods.

 

example:  Day of Year

 

Datetime myDate = datetime.newInstance(2008, 2, 5, 8, 30, 12);
system.assertEquals(myDate.dayOfYear(), 36);

 

<apex:pageBlock title="Labor Lines" rendered="{!if(TargetRecType=='Usage/Consumption',true,false)}"  id="PageBlock1"> <!-- mode="edit" -->
			<apex:pageBlockButtons style="text-align: left;" location="top">
                <apex:commandButton action="{!AddLaborLine2}" reRender="PageBlock1, PageBlock2" value="Add Labor Line" id="APLbutton" status="LodingStdStatus" />
                <apex:commandButton action="{!DeleteLine}" value="Delete Lines" id="DLbutton" status="LodingStdStatus"/>
            </apex:pageBlockButtons>
           	
            <apex:outputPanel id="PageBlock2">
            <table border="1">
            <tr>
            <th>Add Part</th>
            </tr>
            <apex:repeat value="{!NewWORDPartLine}" var="WOPL1" > 
            	<apex:outputPanel rendered="{!WOPL1.SVMXP__Line_Type__c='Labor'}" >
            	<tr> 
            	<th>LabOp Code</th>
            	<td><apex:inputField value="{!WOPL1.SVMXP__Product__c}"/></td>
            	</tr>
            	</apex:outputPanel>
            </apex:repeat>   
            </table>
            </apex:outputPanel>

 

Initially I can see the list under the <apex:repeat>
When attempting to run the Add Labor Line commandbutton, I expect it to rerender the outputPanel id="PageBlock2".  Instead the list just disappears.   I do see the header <th>Add Part</th> but that is it.   If I just rerender PageBlock2, I end up with the list showing up multiple times of the same data!

 

Any ideas?   

 

We have a sites URL http://ourcompany.force.com/XYZZY  Some users are trying to access http://ourcompany.force.com/xyzzy and they are getting thrown to a generic page not found.

 

I could put in a redirect from http://ourcompany.force.com/xyzzy to http://ourcompany.force.com/XYZZY but that would work only for that one specific case.  If a user tried http://outcompany.force.com/XYzzy they would still get a page not found.

 

Is there any way to make a sites URL case insensitive or have some sort of case-insenstitve redirect?

I don't understand why I get this error when the limit for callouts is normally 10 per transaction.

 

I am calling the following code with 1 record as a test.  The createObject() method will make 2 callouts.

 

global class S3Batchable implements Database.Batchable<CF_Purchase_Order__c>, Database.AllowsCallouts { List<CF_Purchase_Order__c> orders; global S3Batchable(List<CF_Purchase_Order__c> o){ orders = o.clone(); } global Iterable<CF_Purchase_Order__c> start(Database.batchableContext BC){ return orders; } global void execute(Database.BatchableContext BC, CF_Purchase_Order__c[] scope){ List<CF_Purchase_Order__c> ordersToUpdate = new List<CF_Purchase_Order__c>(); VF_SiteUploadController controller; boolean result; for(CF_Purchase_Order__c order : scope){ controller = new VF_SiteUploadController(order.id); controller.body = Blob.valueof(order.Script__c); controller.fileName = order.Partner__r.Final_Cut_Filename__c+'_'+order.SPON__c+'_Script.txt'; controller.fileSize = controller.body.size(); controller.bucketName='FCSinbound'; result = controller.createObject(); if(result){ order.CFNotes__c = controller.fileDownloadURL; ordersToUpdate.add(order); } } update ordersToUpdate; } global void finish(Database.BatchableContext BC){ Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); mail.setToAddresses(new String[] {'gnewman@spotzer.com'}); mail.setReplyTo('batch@acme.com'); mail.setSenderDisplayName('Batch Processing'); mail.setSubject('Batch Process Completed'); mail.setPlainTextBody('Batch Process has completed'); Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail }); } public static testMethod void testBatch() { List<CF_Purchase_Order__c> myTestOrders = [select id from CF_Purchase_Order__c limit 5]; S3Batchable scriptBatch = new S3Batchable(myTestOrders); ID batchprocessid = Database.executeBatch(scriptBatch); } }

 

Hi ,
is there any way to login from one Salesforce.com org into another Salesforce.com org using Apex. Actually, i have written one Apex class and wanted to login into a different SFDC org from that class.

Please post me if anyone have any solution.

Thanks in advance,
NG
  • February 28, 2008
  • Like
  • 0

We have a sites URL http://ourcompany.force.com/XYZZY  Some users are trying to access http://ourcompany.force.com/xyzzy and they are getting thrown to a generic page not found.

 

I could put in a redirect from http://ourcompany.force.com/xyzzy to http://ourcompany.force.com/XYZZY but that would work only for that one specific case.  If a user tried http://outcompany.force.com/XYzzy they would still get a page not found.

 

Is there any way to make a sites URL case insensitive or have some sort of case-insenstitve redirect?