• Bhavin Mehta 20
  • NEWBIE
  • 135 Points
  • Member since 2015

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 12
    Replies
I have put a Custom Button on a page which triggers an Approval Process, so I want to remove the Submit for Approval button from the Approval History section.

I found several posts suggesting using of a jquery to remove the button, but those did not work.
https://developer.salesforce.com/forums/?id=906F00000009F8IIAU
https://developer.salesforce.com/forums/?id=906F00000008pZMIAY

I have put the following jQuery code in a VF Page and added it to the Sidebar of the Home Page Component, but the Submit for Approval button did not get removed:
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script>
      $j = jQuery.noConflict();
      $j(document).ready(function(){   
        $j("input[name='piSubmit']").hide();
      });
    </script>

If someone knows what I am missing, please let me know.
Also any other alternative idea to achieve this is very much welcome.
  • October 27, 2016
  • Like
  • 0
Hi Friends ,

How can i display the date format like 21st October 2016 .

Here i my origional coding 

<apex:outputtext value="{0, date,dd' 'MMMM' 'YYYY}">
      <apex:param value="{!Inspection_Sheet__c.Date__c}">
      </apex:param>
</apex:outputtext>

Output Is : 25 October 2016

Could you please help me , how can i display this format on visualforce page 25th october 2016

Many Thanks in Advance...!!!

Regards ,
Soundar ,
I have got a pageblock table with all parents records and all of them has a lineitem button linked to it, now the requirement is to display child records in the same pageblock table under the particular parent recordwhen this button is clicked.Both parent and child belongs to same object and they have self relationship.Thanks in advance
I am trying to add one order product as default whenever a custom field in Order Object (Service_Type__c) is Postpaid. I am stuck at below step. Please help to complete the same as to how can I insert product name, code etc.



trigger createlineitems on Order (after insert) {
    list<Orderitem> lineitems = new list<Orderitem>();
    for (Order o : trigger.new){
        if(o.Service_Type__c == 'Postpaid')
        {
            Orderitem oitem = new Orderitem();
              oitem.OrderId = o.id;
           oitem.Quantity = 1;
            oitem.UnitPrice = 200;
  oitem.PricebookEntryId =?????
     
lineitems.add(oitem);
 
   }
        
     insert lineitems;   
    }
    
}
 I have Custom Button on Account Detail Page which has URL of the VF Page with Standard Controller as Order. I want to autopopulate account name lookup field of this page to the name of the account through which the button was pressed. Please let me know what should be concanated to the URL after /apex/myorder?(i.e VFpage)
 I have Custom Button on Account Detail Page which has URL of the VF Page with Standard Controller as Order. I want to autopopulate account name lookup field of this page to the name of the account through which the button was pressed. Please let me know what should be concanated to the URL after /apex/myorder?(i.e VFpage)
1. Associate the content delivery with Salesforce record
2. Password Protect content delivery that contain sensitive data
3. Customize the URL assigned to the Content delivery
4. Encrypt certain content delivery files

Kindly Help!

 
I have tried posting this question, but unfortunately have not got the answer still. My requirement is that i need to change the visibility of the field for a user based on the change of field value of a field on that object.

Please help me understand. Thanks.
Hi,I have a scenario wherein my requirement is that I have over 5 million records, I need to fire an update on all the records. 
Can anyone suggest the best approch to do it.
Thanks.
I am trying to display an output field value in VF page before saving the record. If user select checkIn & checkOut date  (both are date field), display the "Length of stay". Length of Stay is a formula field which is equal to (Check out date - check in date)
User-added image

Below is whatever I have tried so far (no error in any code): 
Method 1:
VF
<table id="check-table">
    <thead> <td style="font-weight:bold"> Check In </td>       <td style="font-weight:bold"> Check Out </td> <td> </td> <td></td> </thead>                       
    <tr>
        <td> <c:NoDateLink > <apex:inputField value="{!objectReservation.Check_In__c }" id="startdate" style="width:10rem; margin-right:1rem;"  /> </c:NoDateLink> </td> <!--  rerender="lengthOfStay" background:url('DateIcon.png'); background-size: 1px 2px; background-repeat: no-repeat; -->
        <apex:actionRegion >
            <apex:outputPanel >
                <td><c:NoDateLink > <apex:inputField value="{!objectReservation.Check_Out__c }"   id="enddate" style="width:10rem;"  > 
                    <apex:actionSupport event="onchange" rerender="lengthOfStay"   />                                  
                    </apex:inputField> </c:NoDateLink> </td>   
            </apex:outputPanel>
        </apex:actionRegion>
        <td style="padding:0 2rem 0 2rem;" >  Length of Stay </td>
        <td >  <apex:outputField value="{!objectReservation.Length_of_Stay__c}" id="lengthOfStay"/> </td>
    </tr>
</table> <!-- End of Check-table -->

No error in VF page, but, onchange in CheckOut field, nothing changes. 

Method 2:
I also tried to put value from Apex class, but not sure about the syntax as follow: 
public void onChangeFnCall(){
        if(objectReservation.Check_Out__c  != null){
  
            Integer numberOfStay = (objectReservation.Check_In__c).daysBetween(objectReservation.Check_Out__c);
    //      objectReservation.Length_of_Stay__c = numberOfStay;
        }

VF
<table id="check-table">
    <thead> <td style="font-weight:bold"> Check In </td>       <td style="font-weight:bold"> Check Out </td> <td> </td> <td></td> </thead>                       
    <tr>
        <td> <c:NoDateLink > <apex:inputField value="{!objectReservation.Check_In__c }" id="startdate" style="width:10rem; margin-right:1rem;"  /> </c:NoDateLink> </td> <!--  rerender="lengthOfStay" background:url('DateIcon.png'); background-size: 1px 2px; background-repeat: no-repeat; -->
        <apex:actionRegion >
            <apex:outputPanel >
                <td><c:NoDateLink > <apex:inputField value="{!objectReservation.Check_Out__c }"   id="enddate" style="width:10rem;"  > 
                    <apex:actionSupport event="onchange" action="{!onchangefncall}" rerender="lengthOfStay"   />                                  
                    </apex:inputField> </c:NoDateLink> </td>   
            </apex:outputPanel>
        </apex:actionRegion>
        <td style="padding:0 2rem 0 2rem;" >  Length of Stay </td>
        <td >  <apex:outputField value="{!objectReservation.Length_of_Stay__c}" id="lengthOfStay"/> </td>
    </tr>
</table> <!-- End of Check-table -->


 
  • December 11, 2016
  • Like
  • 0
I have put a Custom Button on a page which triggers an Approval Process, so I want to remove the Submit for Approval button from the Approval History section.

I found several posts suggesting using of a jquery to remove the button, but those did not work.
https://developer.salesforce.com/forums/?id=906F00000009F8IIAU
https://developer.salesforce.com/forums/?id=906F00000008pZMIAY

I have put the following jQuery code in a VF Page and added it to the Sidebar of the Home Page Component, but the Submit for Approval button did not get removed:
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script>
      $j = jQuery.noConflict();
      $j(document).ready(function(){   
        $j("input[name='piSubmit']").hide();
      });
    </script>

If someone knows what I am missing, please let me know.
Also any other alternative idea to achieve this is very much welcome.
  • October 27, 2016
  • Like
  • 0
--------------------------Apex Class---------------------------
public class IA_scrum_apex_class {
public IA_Scrum__c scrum_class_var{get;set;}
public boolean chk1 { get; set; } 
public IA_Scrum__c scrumtime{get; private set;}


public IA_scrum_apex_class(ApexPages.StandardController controller) {
scrumtime = new IA_Scrum__c( Date_time_Scrum__c = DateTime.now() );
scrum_class_var = new IA_Scrum__c(); 
       
if(chk1==true){
scrum_class_var.Dump_test_field__c = 'Test check';
insert scrum_class_var;

}
}         
}

------------------------Trigger---------------
trigger IA_Scrum_Trigger on IA_Scrum__c (before update,before insert) {
for(IA_Scrum__c testclassapex1 : trigger.new){
//IA_scrum_apex_class =new IA_scrum_apex_class();---Show this error------Variable does not exist: IA_scrum_apex_class---------
// need sum vaue to be show & read visual force page vaues in Apex class then it invoked in trigger...........  
}
 
Hi Friends ,

How can i display the date format like 21st October 2016 .

Here i my origional coding 

<apex:outputtext value="{0, date,dd' 'MMMM' 'YYYY}">
      <apex:param value="{!Inspection_Sheet__c.Date__c}">
      </apex:param>
</apex:outputtext>

Output Is : 25 October 2016

Could you please help me , how can i display this format on visualforce page 25th october 2016

Many Thanks in Advance...!!!

Regards ,
Soundar ,
Hi All,

with below code I have completed the challenge thanks!!...When I tried to add this componet to Application and tried to check the UI part..I got below error, Can some one please let me know what the mistake is???

Something has gone wrong. [NoErrorObjectAvailable] Aura.loadComponent(): Failed to initialize application. An internal server error has occurred Error ID: 991118890-131685 (-1741317831) . Please try again.

APP:

<aura:application >
    <c:campingListItem />
</aura:application>


COMPONENT:

<aura:component >

    <aura:attribute name="item" type="Camping_Item__c" required="true"/>
    <ui:outputText value="{!v.item}"/>
    <ui:outputText value="{!v.item.Name}"/>
    <ui:outputCheckbox value="{!v.item.Packed__c}"/>
    <ui:outputCurrency value="{!v.item.Price__c}"/>
    <ui:outputNumber value="{!v.item.Quantity__c}"/>
    
    <ui:button label="packed!" press="{!c.packItem}" > 
    </ui:button>
</aura:component>


CONTROLLER:
({
    packItem: function(component, event, helper) {
        var a = component.get("v.item",true);
       
        a.Packed__c = true;
        component.set("v.item",a);
        var btnClicked = event.getSource();
        btnClicked.set("v.disabled",true);
    }
})


Thanks
Here is the Question


Create an Apex class that implements the Schedulable interface to update Lead records with a specific LeadSource. Write unit tests that achieve 100% code coverage for the class. This is very similar to what you did for Batch Apex.
Create an Apex class called 'DailyLeadProcessor' that uses the Schedulable interface.
The execute method must find the first 200 Leads with a blank LeadSource field and update them with the LeadSource value of 'Dreamforce'.
Create an Apex test class called 'DailyLeadProcessorTest'.
In the test class, insert 200 Lead records, schedule the DailyLeadProcessor class to run and test that all Lead records were updated correctly.
The unit tests must cover all lines of code included in the DailyLeadProcessor class, resulting in 100% code coverage.
Run your test class at least once (via 'Run All' tests the Developer Console) before attempting to verify this challenge.


Here is my code so far

global class DailyLeadProcessor implements Schedulable {

    global void execute(SchedulableContext ctx) {
        list<leads>Lead = [select leadSource from lead where isnull= true]
        
         for (Integer i = 0; i < 200; i++) {
            Leads.add(new lead(
                name='Dream force'+i
            ));
        }
        insert Leads;
    }

I am not sure what is wrong here
I have got a pageblock table with all parents records and all of them has a lineitem button linked to it, now the requirement is to display child records in the same pageblock table under the particular parent recordwhen this button is clicked.Both parent and child belongs to same object and they have self relationship.Thanks in advance
I am trying to add one order product as default whenever a custom field in Order Object (Service_Type__c) is Postpaid. I am stuck at below step. Please help to complete the same as to how can I insert product name, code etc.



trigger createlineitems on Order (after insert) {
    list<Orderitem> lineitems = new list<Orderitem>();
    for (Order o : trigger.new){
        if(o.Service_Type__c == 'Postpaid')
        {
            Orderitem oitem = new Orderitem();
              oitem.OrderId = o.id;
           oitem.Quantity = 1;
            oitem.UnitPrice = 200;
  oitem.PricebookEntryId =?????
     
lineitems.add(oitem);
 
   }
        
     insert lineitems;   
    }
    
}