• vineet kumar
  • NEWBIE
  • 79 Points
  • Member since 2018
  • Salesforce Developer

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 17
    Questions
  • 24
    Replies
In the below query: SELECT Id, Name, Industry, AnnualRevenue,     ( SELECT Name, Email, BirthDate FROM Contacts )     FROM Account where name != null limit 5, why writing owner does not return records and we have to write owner.name. While writing name returns records
Hi All,

I have a scenario where i need to get a field(Notes_of_request__c) from Child object(Request) where the master is Case.
The Email template is in Case.
Where the case and requests are Master-detail, case is master and Detail is request.

How to get the field from child in Case Email templete, i mean in HTML templates.

Thanks in advance
How to use fields of an object in lookup filters which is not from a target lookup object and even not the current record (Source)?
How can we choose a Queue as an approver on the Account object? When I know that Queue can't be created on Account. Is there any way?
Getting the following error in flow: 
This error occurred when the flow tried to create records: FIELD_CUSTOM_VALIDATION_EXCEPTION: PO Balance is running low, please select another PO for this invoice. You can look up ExceptionCode values in the SOAP API Developer Guide.

Want to show an actual trigger error message in flow(added in addError at code level).

Any suggestions would be appreciated.
Thanks
Hi All,

Scenario is given below. 

On Account, I have an approval process. and it's multistep approval. 
Let's assume its a 2 step approval.
but in the approval steps, No approvers are mentioned.
for the approvers, we are not having user lookups on Account but
We have an Account Role object (Child of Account) from where approvers will be picked up dynamically based on the role (field on the object level) of the user.

Now suppose in the Account Role we have 3 users (3 records which contains user with the role) with the role Manager so in that case, approvers in the "first step" will be these 3 users and any of them can approve the record, and once approved the record will go in the next step to be approved.

Now I want to assign approvers dynamically in each step of the approval as explained in the above scenario.

Can I call the same defined approval in apex and then in apex set the approvers in different steps and fire the approval??

Any suggestions would be appreciated.

Thanks.

 
Hi Techies,

I want to create a custom table with multi-level grouping. Pls suggest how can we achieve it.

Created one HTML table and a dropdown to select the field for grouping.

Thanks.
Hi Team,

Chatter post is not working for Site Guest User.
Please let me know if there is any workaround.


Thanks.
Hi Team,

Please let me know if there is any way to turn off system validations.


Thanks.
Hi All,

As we can tag partners from partner related list on the Account record. So there I want to restrict tagging up to 3 only.

Please suggest how we can achieve that except trigger.

Thanks.
Suppose I refresh the page on any page, it should remain on that page only and should not go back to 1st page.If I am on 2nd page it should stay on 2nd after refresh.
 
When i search record by name or i change the pagesize or i try to delete a record by clicking the delete link no controller action gets called.
vf Page
=======================
<apex:page controller="pagination" docType="html-5.0">
  
    <apex:form >
        
        search opportunity by name:    <apex:inputText value="{!searchByString}">
                          <apex:actionSupport event="onchange" action="{!searchOpportunity}" reRender="Display"/>
                          </apex:inputText>
        
        opportunities per page:  <apex:input value="{!size}" type="number" id="number_of_days" html-step="10"  html-min="10" html-max="100"> 
                            <apex:actionSupport event="onchange" action="{!afterSizePageChange}" reRender="Display"/>
                            </apex:input>
        
            <apex:sectionHeader title="Pagination"/>
               
                  <apex:pageBlock id="Display" >
                      <apex:inlineEditSupport />
                         <apex:pageBlockButtons >
                             <apex:commandButton value="First" action="{!controller.first}" rendered="{!controller.hasprevious}" reRender="Display"/>
                             <apex:commandButton value="Previous" action="{!controller.previous}"  rendered="{!controller.hasprevious}" reRender="Display"/>
                            <apex:commandButton value="Next" action="{!controller.next}"  rendered="{!controller.hasnext}" reRender="Display"/>
                            <apex:commandButton value="Last" action="{!controller.last}"  rendered="{!controller.hasnext}" reRender="Display"/>
                  
                         </apex:pageBlockButtons>
                      
            <!-- if there is no record than show a message -->
             <apex:outputText rendered="{!IF(wrapperRecordList.size==0,'true','false')}">No Record Found </apex:outputText>
            
       <apex:pageBlockTable value="{!wrapperRecordList}" var="a" rendered="{!IF(wrapperRecordList.size>0,'true','false')}">
            <apex:column >
            <apex:facet name="header"><apex:selectCheckboxes /></apex:facet>
            <apex:selectCheckboxes value="{!a.isSelected}"/>
            </apex:column>
            
            <apex:column headervalue="Action">
                <apex:commandLink value="Delete" action="{!deleteRecord}"  reRender="Display">
                    <apex:param value="{!a.oppRecord.id}" assignTo="{!id}" />
                </apex:commandLink>
             </apex:column>
             <apex:column value="{!a.oppRecord.name}"/>
             <apex:column value="{!a.oppRecord.stagename}"/>
             <apex:column value="{!a.oppRecord.closeDate}"/>
            

        </apex:pageBlockTable><br/><br/>
    <apex:outputText rendered="{!IF(wrapperRecordList.size>0,'true','false')}">{!(controller.pageNumber * size)+1-size}-{!IF((controller.pageNumber * size)>controller.resultsize, controller.resultsize,(controller.pageNumber * size))} of {!controller.resultsize}</apex:outputText>

            </apex:pageBlock>
       
    </apex:form>
 </apex:page>
 
public class pagination {
    
    
    public  ApexPages.StandardSetController controller {set;get;} 
    public string searchByString {set;get;}
    public Integer size {set;get;}
    public string id {set;get;}

    
    public List<opportunity> optyList {set;get;}
   
    
    public List<WrapperClass> wrapperRecordList {set;get;}
    
    public pagination(){
          size=10;
         wrapperRecordList=new List<WrapperClass>();
         optyList=[select name,stagename,closeDate from opportunity order by name ASC];
        
         controller=new Apexpages.StandardSetController(optyList);
         controller.setPageSize(size);
         List<opportunity>  opty=(List<Opportunity>)controller.getRecords();
        for(opportunity op:opty)
        {
            wrapperRecordList.add(new WrapperClass(op, false));
        }
       }
    
    public void afterSizePageChange()
    {
        optyList=[select name,stagename,closeDate from Opportunity order by name ASC];
        
        controller=new Apexpages.StandardSetController(optyList);
        controller.setPageSize(size);
        
        List<opportunity>  opty=(List<Opportunity>)controller.getRecords();
        for(opportunity op:opty)
        {
            wrapperRecordList.add(new WrapperClass(op, false));
        }
    }
    public void searchOpportunity()
    {

        string  name=searchByString+'%';    
        optylist=[select name,stagename,closeDate from Opportunity where name like : name order by name ASC];
        controller=new Apexpages.StandardSetController(optyList);
        controller.setPageSize(size);
        List<opportunity>  opty=(List<Opportunity>)controller.getRecords();
        for(opportunity op:opty)
        {
            wrapperRecordList.add(new WrapperClass(op, false));
        }
    }
    
    public void deleteRecord()
    {
        
        list<opportunity> opp =[select id,name from opportunity where id =:id];
        delete opp;
        optyList=[select name,stagename,closeDate from Opportunity order by name ASC];

 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: KFHVIYKQ
Getting the following error in flow: 
This error occurred when the flow tried to create records: FIELD_CUSTOM_VALIDATION_EXCEPTION: PO Balance is running low, please select another PO for this invoice. You can look up ExceptionCode values in the SOAP API Developer Guide.

Want to show an actual trigger error message in flow(added in addError at code level).

Any suggestions would be appreciated.
Thanks
In the below query: SELECT Id, Name, Industry, AnnualRevenue,     ( SELECT Name, Email, BirthDate FROM Contacts )     FROM Account where name != null limit 5, why writing owner does not return records and we have to write owner.name. While writing name returns records
I am in the transition from Admin to Developer. Though we can handle all the validations using Validation Rule, why we are handling in coding/classes?
I generate some custom fields in contact object, now how can i wirte query to get data from SOQL?
Hi All,

I have a scenario where i need to get a field(Notes_of_request__c) from Child object(Request) where the master is Case.
The Email template is in Case.
Where the case and requests are Master-detail, case is master and Detail is request.

How to get the field from child in Case Email templete, i mean in HTML templates.

Thanks in advance
Hello,

I have created a trigger which is supposed to create multiple records.
 
trigger CreateMultipleContacts on Contract  (after insert,  after update) {
    
    List<Contract_Renewal__c> contractFinalListToInsert = New List<Contract_Renewal__c>();
    
    if(Trigger.isInsert || Trigger.isUpdate){
        for(Contract  c : Trigger.New) {
            if(c.Renew__c == true) {
                Integer fetchingAlreadyExistedRecords = [SELECT count() FROM Contract_Renewal__c WHERE Contract__c=:c.Id and Not_Renewed__c=:false and Multi_Year__c=:true];
                
                if(fetchingAlreadyExistedRecords!=null) {
                    // We are only creating a records when there at least one Contract record exists.
                    for(Integer i=0; i<fetchingAlreadyExistedRecords; i++) {
                        Contract_Renewal__c con = new Contract_Renewal__c();
                        con.Contract__c = c.Id;
                        contractFinalListToInsert.add(con);
                        
                    }
                }
            }
            
            try{
                if(!contractFinalListToInsert.IsEmpty()){
                    INSERT contractFinalListToInsert;
                }
            }
            catch(Exception e){
                System.debug('The thrown exception for CreatingAutoRecords is:: ' + e.getMessage());
            }
        }
    }
}
I have the Contracts object and the Contract Renewals which is related to Contracts(Contracts master object)
When i check the box renew in contracts, records of contract renewal which are its children are created. However, when i do that no records are created. I check the contract renewals object just in case records arecreated without being assigned to the contracts. any ideas of what might be missing here?

when i

I have one que.
In approval process, approver 1 is X and approver 2 is Y. I have submited the record for approval and it is pending with the approver 1 X. After this I changed approver 2 as Z.

Then my Que is If approver 1 is approve the record then it will goes to Y or Z ?

Hello, I am trying to create a custom list buttom to call a Visualforce Page, but I can't see the VF on the list when creating the button. I've checked out other similar questions in the developers Forums and I made sure the standardController for the object is already created. What else am I missing to call this VF page from the custom button? How can I can add this action/button to each record on the Master related list?
User-added image
I want the new custom button to apper in the related list for each record. See image below.

User-added image
in advance for your help!
Hi Team,

Please let me know if there is any way to turn off system validations.


Thanks.