• SamuelRobert
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 11
    Replies
I am very new to the rest Web services . I have a requirement That I need to update the rally "Client code" field with the value of the salesforce case object field Value.
Please find the image below.

User-added image

User-added image

These are the two fields I need to update the salesforce Client code value to Rally Client code field.
We have a S-control that is managed package "Create Artifact" by clicking this an User story will get created in rally. When this operation happens I want to update the update the Case Client code value to Rally Client Code.
Please find the case record detail page that has the Create Artifact S-control

User-added image

Please Advise
I’m having a hard time visualising how this would work. I need the ability to type up an SOW in Salesforce. Once I finish typing the SOW and want to send it to the customer, I should have a button that sends to a specific recipient. The client then should have the ability to sign the SOW and save it. One it is saved by the client, it should automatically attach to the Development request form(Custom object) in Salesforce for Billing.
Here is the process.
Account Management receives or creates a development request form(VF page- sales the value in Salesforce custom object) (RF-XXXXXX).
Account Management types up an SOW and clicks send to the client.
The client reviews and signs the SOW. (We need the ability for the client to leave notes on the SOW. We need the ability to retract or update the SOW in case of errors)
SOW automatically finds its way to the initial request form and attaches itself there.
Accounting bills for the Development.
Please advise
I have written a formula to calculate the difference between two Date/Time fields,
Please find the formula
 
ROUND(24*( 
(5*FLOOR((DATEVALUE(First_Response__c)-DATE(1996,01,01))/7) + 
MIN(5, 
MOD(DATEVALUE(First_Response__c)-DATE(1996,01,01), 7) + 
MIN(1, 24/24*(MOD(First_Response__c-DATETIMEVALUE('1996-01-01 12:00:00'), 1))) 
)) 
- 
(5*FLOOR((DATEVALUE(CreatedDate)-DATE(1996,01,01))/7) + 
MIN(5, 
MOD(DATEVALUE(CreatedDate)-DATE(1996,01,01), 7) + 
MIN(1, 24/24*(MOD(CreatedDate-DATETIMEVALUE('1996-01-01 12:00:00'), 1))) 
)) 
), 2)

Here I have a case whose created date is 12/12/2016 2:16AM and Firstresponse date is 12/12/2016 10:54 AM now the case response hour formula field shows me the difference between the above as -15.37 .

I tried to calculate the difference between two date Time for 24 hours not for a business hours, I only want to exclude weekends, 

The hour calculation should be from 12:00 AM today to 11:59 PM the next day.

Please advise
Hi I have to query a record information of the customer. Based on the number of Order the customer submits it should retrieve the same.
Please find my query below.
 
if(OrderNumbers!=null){
         String[] splits = OrderNumbers.split(',');
        String succMes = (splits.size() >1 ? 'Thank you for your order request.  Your Order Numbers are ' : 'Thank you for your order request.  Your Order Number is ');
        Set<String> orderIds = new Set<String>();
        for(Integer i = 0; i< splits.size(); i++){
            orderIds.add(splits[i]);
        }
        newOrders = [Select id,
                     Order_Contact__c,
                     OrderNumber,
                     Order_Contact_Phone__c,
                     Order_Contact_Email__c,
                     Type,
                     Rush_Order__c,
                     Type_Of_Order__c,
                     Training_Required__c,
                     Type_Of_Clock__c,
                     Number_of_Clock_Required__c,
                     Ship_to__c,Shipping_Attention__c,
                     Shipping_Attention_Email__c,
                     Shipping_Attention_Phone__c,
                     Shipping_Street__c,
                     Suite_Floor_Address_2__c,
                     Shipping_City__c,
                     Shipping_State__c,
                     Shipping_Postal_Code__c,
                     Shipping_Country__c,
                     Clock_Location_Restriction__c,
                     IP_Restricted__c,
                     Type_of_Clock_Requested__c,
                     Connection_Type__c,
                     Static_IP_Address__c,
                     Static_Subnet_Mask__c,
                     Static_Gateway_Adress__c,
                     DNS1__c,
                     DNS2__c,
                     Branch_Name__c,
                     Branch_number__c,
                     Associates_to_enter_time__c,
                     First_email_reminder_day__c,
                     Second_email_reminder_day__c,
                     PTA_First_email_Day__c,
                     PTA_Second_email_Day__c,
                     PTA_Escalation_email_Day__c,
                     StartTime_for_the_Last_shift_week_time__c,
                     PTA_First_email_Time__c,
                     PTA_Second_email_Time__c,
                     PTA_Escalation_email_Time__c,
                     First_shift_of_the_week_s_start_time__c,
                     Associates_to_enter_late_time__c,
                     i_How_Many_Weeks__c,
                     Last_day_of_your_pay_week__c,
                     Set_up_for_Group_Timesheet__c,
                     Clients_Branch_Name__c,
                     Clients_Branch_ID__c,
                     GT_How_do_they_need_to_enter_time__c,
                     GT_First_name_of_time_submitter__c,
                     GT_Last_name_of_time_submitter__c,
                     Submitter_s_email_address__c,
                     Submitter_First_reminder_day__c,
                     Submitter_Second_reminder_day__c,
                     Auto_approved_submitted_Group_Timesheet__c,
                     Over_Time_Rules__c,
                     Notes__c,
                     Customer_Name__c,
                     Business_Unit_Or_Accounting_number__c,
                     Site_ID_or_Branch_ID_Number__c,
                     Name_of_Clock_Location__c,
                     Site_Street_Address_1__c,
                     Site_Street_Address_2__c,
                     Site_City__c,
                     Site_State__c,
                     Site_ZIP__c,
                     Site_Country_if_not_USA__c,
                     Site_TimeZone__c,
                     Number_of_Employees__c,
                     Pay_Period__c,
                     First_Day_of_payroll_Week__c,
                     First_shift_of_the_week_s_start_day__c,
                     StartTime_for_the_Last_shift_of_the_week__c,
                     Third_Shift_employee_at_the_site__c,
                     OverTime_Rules__c,
                     State_OT_Rules__c,
                     Daily_OT_after_How_many_hours__c,
                     Weekly_OT_after_how_many_hours__c,
                     Does_the_7th_day_rule_apply__c,
                     Non_Standard_Notes__c,
                     Time_Tracking_Options__c,
                     Grace_Period_Before_Shift__c,
                     Grace_Period_After_Shift__c,
                     Meal_Break__c,
                     Length_of_the_meal_break__c,
                     Min_hours_worked_for_auto_meal_deduction__c,
                     California_Meal_Prompts__c,
                     Are_Departments_sent_in_Integration_file__c,
                     Special_Pay_Policies_or_Requests__c 
                     from Order where OrderNumber IN :orderIds];

In the above code i am using the static value to get the same record. I want to make it Dynamic. Please Advise.
I tried the Below logic it still returns me only one at a time.
Hi I have a Form that will be submitted by our customer. At the end of the Form they will have submit button that will call the Apex class to insert the record in the Salesforce order object.
Here I have tried a Print functionality so before submitting Customer can print the order summary.
Now I was asked to make the print functionality in background and it should be sent to Customer along with the Mail after they submit the form.
 
public PageReference OrderSave(){                        



    if(!validateOrderContactInformation() )
        return pageF();

    if(order.Type!='Web Timesheet' && order.Type_Of_Order__c=='New Client or Web Time Branch'|| order.Type_Of_Order__c== 'Redeploy' || order.Type_Of_Order__c== 'Reactivation')
        if(!validateShippingAndNetworkInformation())
        return pageS();        
    else if(order.Type=='Web Timesheet' && order.Type_Of_Order__c=='New Client or Web Time Branch'|| order.Type_Of_Order__c== 'Redeploy' || order.Type_Of_Order__c== 'Reactivation')
        if(!validateWebTimesheetInformation())
        return pageS();

    if(order.Type!='Web Timesheet' && order.Type_Of_Order__c=='New Client or Web Time Branch'|| order.Type_Of_Order__c== 'Redeploy' || order.Type_Of_Order__c== 'Reactivation')
        if(!validateClockConfiguration())
        return pageT();                

    if(order.Type=='Web Timesheet' || Test.isRunningTest())
        order.Number_of_Clock_Required__c = 1;
    List<Order> orderList = fillNumberOfOrders(); 
    try {     
        //order.Group_Name__c = GroupLookUp;
        insert orderList;

    } catch (DMLException e) {     
        System.debug('Error creating new Order.' + e.getMessage() + ' : ' + e.getLineNumber());
        ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Error creating new Order.' + e.getMessage() + ' : ' + e.getLineNumber()));            
        if(!Test.isRunningTest())
            return null;
    }

The above code is my save method.
 
if(orderList!=null && !orderList.isEmpty() ){        

        if(order.Training_Required__c=='Yes')
            fillAndSaveTrainingDetails(true,orderList.get(0).Id); 

        if(order.Type_Of_Order__c=='New Client or Web Time Branch'|| order.Type_Of_Order__c== 'Redeploy' || order.Type_Of_Order__c== 'Reactivation' && order.Type!='Web Timesheet' )
        {     
            try{
            fillAndSaveDepartmentDetails(true,orderList.get(0).Id);            

            for(SoftSchedulingShift__c sss : softschedulingss)                                                        
                sss.OrderId__c = orderList.get(0).Id;                                              
            insert softschedulingss; 
            }
            catch(Exception ex)
        {      
            System.debug('Line Number is = '+ex.getLineNumber()+' Message is = ' +ex.getMessage());
        }
            if(order.IP_Restricted__c == 'Yes')
                fillAndSaveIPaddressDetails(true, orderList.get(0).Id);

        }

        if(order.Type_Of_Order__c=='New Client or Web Time Branch'|| order.Type_Of_Order__c== 'Redeploy' || order.Type_Of_Order__c== 'Reactivation' && order.Type=='Web Timesheet')
        {
            if(groupTClients!=null && !groupTClients.isEmpty())
            {
                for(GroupTimeSheet_Client__c client : groupTClients)
                    client.OrderId__c = orderList.get(0).Id;   
                insert groupTClients;
            }
        }

        if(order.Type_Of_Order__c=='New Client or Web Time Branch'|| order.Type_Of_Order__c== 'Redeploy' || order.Type_Of_Order__c== 'Reactivation' || order.Type_Of_Order__c=='Add-On to Existing Site' || order.Type_Of_Order__c=='Upgrade (Change in Hardware) to Existing Site')
        {
            //string attachmentName = '';
            try{
                if(attachment!=null && attachment.Name!=null){   
                    attachment.IsPrivate = true;        
                    //uploadFileName = attachment.Name;
                    mail_attach_yes_no ='Yes';
                    attachment.ParentId = orderList.get(0).Id;
                    insert attachment;
                    attachment =null;
                }
                mail_attach_yes_no =  'No';
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO, 'Thanks for submitting your request!'));          
            }
            catch (DMLException e) {   
                attachment = new Attachment();
                System.debug('Attachment issue: ' + e.getMessage() + ' : ' + e.getLineNumber());                        
            }
        }

        String succMes = (orderList.size()>1 ? 'Thank you for your order request.  Your Order Numbers are ' : 'Thank you for your order request.  Your Order Number is ');
        String OrderNumbers = '';

        List<Id> ids = new List<Id>();
        for(Order ord : orderList)            
            ids.add(ord.Id);

        List<Order> newOrders = [select Id, OrderNumber,Order_Contact__c,Order_Contact_Email__c from order where Id in :ids];            
        if(newOrders!=null && !newOrders.isEmpty())
            for(Order ord : newOrders)            
            OrderNumbers = (OrderNumbers=='' ? OrderNumbers + ord.OrderNumber : OrderNumbers +  ', ' + ord.OrderNumber);

        // Email Trigger
        String userName  = (conts!=null && !conts.isEmpty()) ? conts.get(0).name : 'Customer' ;
        emailTrigger(newOrders, OrderNumbers,userName);

        ApexPages.addMessage(new ApexPages.message(ApexPages.severity.CONFIRM,succMes + OrderNumbers));
        order = new Order();
        orderList = new List<Order>();
        newOrders = new List<Order>();

        String pageref = '/apex/OOFormImpSuccess?OrderNumbers=' + OrderNumbers + ';CID=' + accountId;        
        PageReference pgRef =  new PageReference(pageref);     
        pgRef.setRedirect(true);
        return pgRef;

        //return movePage('OOFormImpSuccess'); 
    }

The above code is where the Order number will be generated and the page will move to the Success page.
 
public void emailTrigger(List<Order> orders, String orderNumbers, String orderContactName)
{                        
    String subject = orders.size() >1 ? ('Your Orders are created and Numbers are : ' + orderNumbers ): ('Your Order is created and Number is : ' + orderNumbers ) ;
        String toEmail = contactEmail;

    System.debug('toEmailtoEmail : ' + toEmail);
    String bot_firstLine = 'Dear ' + orderContactName +','; 

    String succMes = (orders.size()>1 ? 'Thank you for your order request.  Your Order Numbers are ' : 'Thank you for your order request.  Your Order Number is ');

    String bot_firstLine_1 = succMes + orderNumbers; 

    String bot_secondLine= 'Thank you for your Peoplenet order.';
    String bot_thirdLine='An Implementation Consultant (IC) will be assigned to assist you with this implementation and will contact you if they have any questions about the information provided on the form.';        
    String bot_fourthLine = 'If you have questions regarding this order, please contact your IC and reference the order number provided above.';        
    String bot_fifthLine  = 'If you do not know who your assigned IC is, please email Orders@peoplenet.com';                        
    String bot_sixthLine = 'Thank you,';        
    String bot_seventhLine = 'Peoplenet Implementation Services';                

    String space = '<br>';

    String paraStart = '<html><body><div><p>';
    String paraEnd = '</p></div></body></html>';

    String bot =paraStart + bot_firstLine + space + space + bot_firstLine_1+ space + space + bot_secondLine + space + bot_thirdLine + space +space + bot_fourthLine + space +space+ bot_fifthLine + space +space + bot_sixthLine + space +bot_seventhLine + space +space + paraEnd;
    if(toEmail!=null){
        System.debug('toEmailtoEmail : ' + toEmail);
        Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage();
        String[] sendingTo = new String[]{toEmail};
            semail.setToAddresses(sendingTo);
        String[] sendingCC =  new String[]{'orders@peoplenet.com'};
            semail.setCcAddresses(sendingCC);
        semail.setSubject(subject);                                                
        semail.setHtmlBody(bot);   

        Messaging.sendEmail(new Messaging.SingleEmailMessage[] {semail});     
    }
}

The above code is for to Send a Email trigger to the customer once the Order is submitted.
Here I have to include the Attachment of the order summary and send mail to the Customer.
Please advise how this can be achieved.
 
Hi there are two lookup fields one is Group__c and Site__c the lookup filter for Group__c is : (Group: TypeEQUALSGROUP-PNET) AND (Group: Parent Account IDEQUALSOrder: Account Name ID)
Site__c:(Site Name: TypeEQUALSSITE-PNET) AND (Site Name: Parent Account IDEQUALSOrder: Group ID)
We have Account with few Hierarchy, there is Field called Type. If Type = Customer then it is head for the Account that has the Type = GROUP-PNET the Account that has GROUP-PNET type will have the Parent Name(lookup) as Account name or ID of the the Account with Type= Customer.
2nd Scenario: We have another Account Type = SITE-PNET. these Account will Comes under the Account Type= "GROUP-PNET" hence the parent Name of the Account Type= SITE-PNET will have the Account name or ID of the Account type which is = GROUP-PNET.
Already Order object by default has a Account lookup field,Based upon the above scenarios the Filter is set up.
Now this is working fine in the order edit and detail page. I want this to be available in the VF page and i tried few logic which did not worked out for me.
VF::
<table>
                <tr>
                  <td colspan="3" style="text-align:left;width:100px!important;font-weight:bold;font-size:12px;color: #4a4a56;padding-right: 2px;">
                      <apex:outputLabel value="Group" for="lookup"/>
                    </td>
                    <table>
                        <apex:inputField value="{!order.Group__c}" label="Group" id="grp"/>
                        <apex:actionSupport event="onchange" action="{!grouplookup}" reRender="siteinfo"/>
                    </table>
                </tr>
            </table>

APEX:
 
public NewOrderController() {
    Order order = new Order();
    order.Group__c = accts.ParentId;
    accts=[select Id,ParentId,type,AccountNumber from Account where type='GROUP-PNET' and Id =:accts.ParentId];
}
public pageReference grouplookup() {
    accts = [select Id,ParentId,type,AccountNumber from Account where Id=:order.Group__c];
    return null;
}

 
Hi iam trying to transfer file from Salesforce Case object to Rally defect.

Currently we have S-control to create Defect in rally by one click in the Case record detail page.

It should also take attachment from case to Rally.

Please assist is this possible.
I am trying to add attachment to a defect in Rally using http post from Salesforce class.  Has anyone done this successfully to provide me with an example.  Thanks in advance.
Hi,

please find the code below here we have invoked a help text for a custom field in Orders, I tried using the keyword <c:helpicon to show the test hwever in the page it shows the text arranged in a improper way.
 
<apex:outputPanel rendered="{!order.Type=='Mobile Clock'}">
                    <apex:actionRegion >
                        <table style="width:50%;">
                            <tr>
                                <td style="text-align:right;width:35%;font-weight:bold;font-size:11px;color:#4a4a56;padding-right: 2px;">
                                   
                                    <c:helpicon helpText="NOT REQUIRED:The Employee can punch in and out anywhere and the app does not track where the punch took place.
                                                          
                                    GEO-LOCATION REQUIRED:Allows punches from anywhere.Requires location services to be enabled on the employees cell phone.The app will record where the punch took place.
                                                          
                                    GEO-FENCE WARNING:A geo fence is set around a location.IF any employee punches outside this location a warning will appear.The employee has the option to continue to punch in or they can choose not to punch in.
                                                          
                                    GEO-FENCE REQUIRED:Employee is required to be within the geo fence location in order to punch into or out using the application"/>
                                        
                                    Clock Location Restrictions
                           
                                </td>
                                <td style="padding-left: 10px;">
                                    <apex:outputLabel value="." styleClass="required"></apex:outputLabel>
                                    <apex:inputField value="{!order.Clock_Location_Restriction__c}">
                                        <apex:actionSupport event="onchange" reRender="clockinformation" oncomplete="this.focus();" status="ocstatus"/>
                                    </apex:inputField>
                                </td>
                            </tr>
                        </table>
                    </apex:actionRegion>
                </apex:outputPanel>

Please find the screenshot for this view.
User-added image
Iam looking for a solution how to make this helptext look good and Nice.
Hi,

I have created a Time based workflow to trigger email 5 days later from the Case record Opened Date. On the condition based on when Priority= Normal AND Status != Closed,swap-Return . then it should trigger. Elase it should not trigger.

But even after the case is Closed the email is getting triggered on the 5th day.User-added imageUser-added image
Put your thoughts on this.
Hi, We have dashboard that was created in Visual force page, over last 2 weeks we see a date in the x-axis is showing in a misplaced manner.

Please find the highlighted date

I tried to do order by as well still this Data is Showing at the end of the chart.


 

Please advise.#
I have a challenge to close the case , by onclicking the Save&Close button on the edit page of the case record. However when we hit on the Save&Close button it will take us to the next editable bage and aske for the mandatory field to be filled and then we have to save it. the requirement is We need to save and close the record on single click on Save&Close. Please suggest how this can be Acheived.
I’m having a hard time visualising how this would work. I need the ability to type up an SOW in Salesforce. Once I finish typing the SOW and want to send it to the customer, I should have a button that sends to a specific recipient. The client then should have the ability to sign the SOW and save it. One it is saved by the client, it should automatically attach to the Development request form(Custom object) in Salesforce for Billing.
Here is the process.
Account Management receives or creates a development request form(VF page- sales the value in Salesforce custom object) (RF-XXXXXX).
Account Management types up an SOW and clicks send to the client.
The client reviews and signs the SOW. (We need the ability for the client to leave notes on the SOW. We need the ability to retract or update the SOW in case of errors)
SOW automatically finds its way to the initial request form and attaches itself there.
Accounting bills for the Development.
Please advise
I have written a formula to calculate the difference between two Date/Time fields,
Please find the formula
 
ROUND(24*( 
(5*FLOOR((DATEVALUE(First_Response__c)-DATE(1996,01,01))/7) + 
MIN(5, 
MOD(DATEVALUE(First_Response__c)-DATE(1996,01,01), 7) + 
MIN(1, 24/24*(MOD(First_Response__c-DATETIMEVALUE('1996-01-01 12:00:00'), 1))) 
)) 
- 
(5*FLOOR((DATEVALUE(CreatedDate)-DATE(1996,01,01))/7) + 
MIN(5, 
MOD(DATEVALUE(CreatedDate)-DATE(1996,01,01), 7) + 
MIN(1, 24/24*(MOD(CreatedDate-DATETIMEVALUE('1996-01-01 12:00:00'), 1))) 
)) 
), 2)

Here I have a case whose created date is 12/12/2016 2:16AM and Firstresponse date is 12/12/2016 10:54 AM now the case response hour formula field shows me the difference between the above as -15.37 .

I tried to calculate the difference between two date Time for 24 hours not for a business hours, I only want to exclude weekends, 

The hour calculation should be from 12:00 AM today to 11:59 PM the next day.

Please advise
Hi iam trying to transfer file from Salesforce Case object to Rally defect.

Currently we have S-control to create Defect in rally by one click in the Case record detail page.

It should also take attachment from case to Rally.

Please assist is this possible.
Hi,

I have created a Time based workflow to trigger email 5 days later from the Case record Opened Date. On the condition based on when Priority= Normal AND Status != Closed,swap-Return . then it should trigger. Elase it should not trigger.

But even after the case is Closed the email is getting triggered on the 5th day.User-added imageUser-added image
Put your thoughts on this.
Hi, We have dashboard that was created in Visual force page, over last 2 weeks we see a date in the x-axis is showing in a misplaced manner.

Please find the highlighted date

I tried to do order by as well still this Data is Showing at the end of the chart.


 

Please advise.#