• bhanu prakash 153
  • NEWBIE
  • 220 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 4
    Likes Received
  • 0
    Likes Given
  • 93
    Questions
  • 56
    Replies
Hi Team,

we need add attachmnet of cases into salesforce from angular js .
Ex : In that page i will search with case number then cases will come and click on attachment, popup will open and attachment need to added.
Now we need to move that attachments into particluar case in salesforce

How can i acheive it ?

Thanks for advance 
Hi team,

Iam trying to upload documents in salesforce by using rest services from angular js , I need to know what are best pratices without hitting governor limits ?

Thanks for advance
Hi team,

we need migrate data from freshdesk to salesforce, help me to how to move data from freshdesk to salesforce need to avoid duplication records.
what are best pratices to acheive these ?

Thanks for advance
 
Hi,

I need to track Alexa rank of custom field automatically need to update when got increased or decreased by Alexa rank
Ex: Name : google
      Url__c : www.google.com
      Rank__c :. ??? Need to auto populate ( ex:1)

If rank got changed to 2 .. need to update field as 2 automatically.
How can we achieve it ?
And need to generate a report that can show out side of salesforce

Thanks for advance
How can we track case status timing 
1. Every time case status got changed 
2. If case status is changed to previous also add to previous time
Ex : case status - assigned to working at 11:00 to 12:00 (changed to working) under assigned 1hr
12:00 to 1:00 (changed to assign )
Need to show 
Working as 1hr and assigned as 2hrs

How can we achieve it ?

Thanks for advance
 
Hi Guys,

On Campagin objects i have 3 custom fields like 
open           :
contacted    :
progress     :

Now we need to get all leads which are associated to that campagin records.
Suppose, I have  marketing campagin, which contact 10 leads . in them 5 leads in open status,3 is in contacted and 2 is in progress.
So now on marketing campagin record, i need to be output as
open : 5
contacted : 3
progress : 2

Thanks for advance

 
Hi foks,

•    IF  Product Name = x (on quotation object) 
                                          AND Current Year AM is true 
                                          AND Opportunity stage = Closed Won,                                           
                                          then add the AM Year and   AM amount from the AM Object                               
                                          to quotation Line Item ID fields( AM Year and   AM Amount)
                                          
                                          
•    IF  Product Name =  Y (on Opportunity Line Item object) 
                                             AND   Current Year AM is true 
                                             AND Opportunity stage = Closed Won, 
        
          add the AM date and AM amount from the AM Object to
                    Opportunity Line Item ID fields(AM Year and AM Amount)
                    
                    
    Can we acheive it via workflow with field update or need to design trigger ?
    
    If i need to write trigger, can i design both in one trigger 

Thanks for advance

 
Hi folks,

I have installed drop box from app exchange and i have uploded 5 Pdf files into dropbox. Now i need to transfer those 5 pdf into my aws org, How can i move that ?

Thanks for advance.

Regards,
Bhanu Prakash
Hi,

Iam getting error : soql 101 error on test class
@isTest
private class LastCommentComponentTest {
    @isTest
    static void publicOnlyTest(){
        Case c = new Case(subject = 'apex test case');
        insert c;
        CaseComment comment1 = new CaseComment(isPublished = false, parentId = c.id, commentBody = 'private apex test comment');
        insert comment1;
        CaseComment comment2 = new CaseComment(isPublished = true, parentId = c.id, commentBody = 'public apex test comment');
        insert comment2;
        CaseComment comment3 = new CaseCOmment(isPublished = false, parentId = c.id, commentBody = 'private apex test comment #2');
        insert comment3;
        
        Test.startTest();
        LastCommentComponent controller = new LastCommentComponent();
        controller.caseId = c.id;
        controller.onlyPublic = true;
        CaseComment result = controller.getComment();
        Test.stopTest();
        
        System.assertEquals(result.id,comment2.id);
    }
    
    @isTest
    static void allTest(){
        Case c = new Case(subject = 'apex test case');
        insert c;
        CaseComment comment1 = new CaseComment(isPublished = false, parentId = c.id, commentBody = 'private apex test comment');
        insert comment1;
        CaseComment comment2 = new CaseComment(isPublished = true, parentId = c.id, commentBody = 'public apex test comment');
        insert comment2;
        CaseComment comment3 = new CaseComment(isPublished = false, parentId = c.id, commentBody = 'private apex test comment #2');
        insert comment3;
        
        Test.startTest();
        LastCommentComponent controller = new LastCommentComponent();
        controller.caseId = c.id;
        controller.onlyPublic = false;
        CaseComment result = controller.getComment();
        Test.stopTest();
        System.assertEquals(result.id,comment3.id,'Got :'+result+' instead of '+[SELECT id, createdDate, commentBody FROM CaseComment WHERE id = :comment3.id LIMIT 1]);
    }
    
    @isTest
    static void noCommentTest(){
        Case c = new Case(subject = 'apex test case');
        insert c;
        CaseComment comment1 = new CaseComment(isPublished = false, parentId = c.id, commentBody = 'private apex test comment');
        insert comment1;
        
        Test.startTest();
        LastCommentComponent controller = new LastCommentComponent();
        controller.caseId = c.id;
        controller.onlyPublic = true;
        CaseComment result = controller.getComment();
        Test.stopTest();
        
        System.assertEquals(null,result);
    }
}

Help me to fix these issue:)

Thanks for advance
Hi,
Iam new to development, please help me to write test class ?
 
trigger StandardContactRoleCreation on Contact_Role__c (before insert,before update) {
  
    List<OpportunityContactRole> oppConRoleList = new List<OpportunityContactRole>();
    Id OldContactId = null;
    
    if(trigger.isInsert){
        for(Contact_Role__c con: trigger.new){
            OpportunityContactRole oppConRole = new OpportunityContactRole();
            if(con.Contact__c !=Null)
                oppConRole.ContactId = con.Contact__c;
            if(con.Opportunity__c !=Null)
                oppConRole.OpportunityId = con.Opportunity__c;
            if(con.Primary__c !=Null)
                oppConRole.IsPrimary = con.Primary__c;
            if(con.Role__c !=Null)
                oppConRole.Role = con.Role__c;
            
            oppConRoleList.add(oppConRole);
        }
    }
    if(Trigger.isUpdate){
        for(Contact_Role__c conRole: Trigger.new){
            if(conRole.Contact__c != Trigger.oldMap.get(conRole.Id).Contact__c || 
              conRole.Opportunity__c != Trigger.oldMap.get(conRole.Id).Opportunity__c ||
              conRole.Primary__c != Trigger.oldMap.get(conRole.Id).Primary__c ||
              conRole.Role__c != Trigger.oldMap.get(conRole.Id).Role__c){
                   OldContactId = Trigger.oldMap.get(conRole.Id).Contact__c ;
               }
        }
        
        if(OldContactId != Null){
            OpportunityContactRole updateOppConRole = [Select ContactId,OpportunityId,IsPrimary,Role  from OpportunityContactRole
                                                where ContactId =: OldContactId];
            
            for(Contact_Role__c conRole1: Trigger.new){
                updateOppConRole.ContactId = conRole1.Contact__c;
                updateOppConRole.OpportunityId = conRole1.Opportunity__c;
                updateOppConRole.IsPrimary = conRole1.Primary__c;
                updateOppConRole.Role = conRole1.Role__c;
            }
            oppConRoleList.add(updateOppConRole);
        }
    }
    upsert oppConRoleList;
}



Thanks for advance
I need to create vf page contact 4 checkbox as
Create new account
Create new contact
Create new oppournity
Create new case 
and  next button. If i select any one button need to open create a new acccount/contact/oppournity/case along with search functionality induvidaly ?

How can i acheive it . Bit Urgent Plz




 
we have two object transcation and balance with lookup relationship,
when ever balance child records is more than 50 which is associated to transtion record
if i try to add 51 need to show error . how can i acheive it ?
trigger UpdateItemRollup on Balance__c (after delete, after insert, after update) {

    Set<id> TransactionIds = new Set<id>();
    List<Transaction__c> tr = new List<Transaction__c>();
    List<Balance__c> ba = new List<Balance__c>();

    for (Balance__c item : Trigger.new)
        TransactionIds.add(item.Transaction__c);

    if (Trigger.isUpdate || Trigger.isDelete) {
        for (Balance__c item : Trigger.old)
            TransactionIds.add(item.Transaction__c);
    }

    // get a map of the traments with the number of items
    Map<id,Transaction__c> TransactionMap = new Map<id,Transaction__c>([select id, RollUp_Count__c from Transaction__c where id IN :TransactionIds]);

    // query the traments and the related inventory items and add the size of the inventory items to the trament's RollUp_Count__c
    for (Transaction__c tra : [select Id, Name, RollUp_Count__c,(select id from Balance__r) from Transaction__c where Id IN :TransactionIds]) {
        TransactionMap.get(tra.Id).RollUp_Count__c = tra.Balance__r.size();
        // add the value/trament in the map to a list so we can update it
        tr.add(TransactionMap.get(tra.Id));
    }

    update tr;

}
Showing error at relationship error
 
[select Id, Name, RollUp_Count__c,(select id from Balance__r) from Transaction__c where Id IN :TransactionIds]) {

we cannot want to install third paty rollup helper or similar ..

Thanks on advance
 
Hi ,

I need to integrate my salesforce chatter into wordpress website.
Issue is chatter is working fine with Html when iam using in widget on wordpress it's not displaying and tried in footer.php it's not working

Kindly help us to go forward
Hi,

How to create vf page with dynamic search with download button with pdf ?
How to pull records of account and download in PDF 
Both need to be in same vf page
Hi,
we have a website (Not Salesforce sites) when ever user enter inform data is storing in our database.
Now i want to connect to my salesforce org i need to create a lead from user information.
without distrubing my website page . how can i use web to lead form and which field i need to modify to capture information ?
=====================================================================================================

web to lead form :

<!--  ----------------------------------------------------------------------  -->
<!--  NOTE: Please add the following <META> element to your page <HEAD>.      -->
<!--  If necessary, please modify the charset parameter to specify the        -->
<!--  character set of your HTML page.                                        -->
<!--  ----------------------------------------------------------------------  -->
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8">
<!--  ----------------------------------------------------------------------  -->
<!--  NOTE: Please add the following <FORM> element to your page.             -->
<!--  ----------------------------------------------------------------------  -->
<form action="https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
<input type=hidden name="oid" value="00D280000016jv0">
<input type=hidden name="retURL" value="http://www.forcelearn.com">
<!--  ----------------------------------------------------------------------  -->
<!--  NOTE: These fields are optional debugging elements. Please uncomment    -->
<!--  these lines if you wish to test in debug mode.                          -->
<!--  <input type="hidden" name="debug" value=1>                              -->
<!--  <input type="hidden" name="debugEmail" value="bhanusunny7@gmail.com">   -->
<!--  ----------------------------------------------------------------------  -->

<label for="first_name">First Name</label><input  id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>
<label for="last_name">Last Name</label><input  id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br>
<label for="email">Email</label><input  id="email" maxlength="80" name="email" size="20" type="text" /><br>
<input type="submit" name="submit">
</form>
====================================================================================================

Html :

    <form>
    <input name="name" size="30" type="text"><br> First Name:<br>
     <input name="name" size="30" type="text"><br> Last Name:<br>
    <input name="email" size="30" type="text"><br> Email:<br>
     <input value="Send email" type="submit">
    </form>


Thanks for advance
Hi team,
How to create new oppournity . when leadsource is email automatically .
Help me to create trigger on this

Thanks for advance :)
Hi,
/
our can we create web to oppournity, I have ownsite contact from i need to create a oppournity . How can i acheive with apex
Hi,

How can i create a new oppournity automatically when lead status is active ?
how can i acheive it ?
 
Hi,
How can i create web to oppournity creation from my website contact form ?

 
Hi,

I have contact us info in our site such as
Name :
Email:
Phone number:

When user fill that information . I need to show a popup that "Thanks for contacting US" and need to create a new oppournity . How can i acheive it ?

 
 I have 3 objects   expense report, Region and Resource and all have lookup fields need to update using trigger.
 
 1. Expesene report has fields
 
    Expense Report Name :
    Region                :
    Company                 :
 
 2. Region object has fields
    Region Name:
    Resource   :
 
 3. Resource object has fields
    Resource Name :
    Company       :
    
    
 I need to write trigger that when expense report has created need to update company name automatically from (Expesene_report__r.Region__r.Resource__r.Company__c
 
  1. Expesene report has fields
 
    Expense Report Name :  Travel to company
    Region                :  England
    Company                :
 
 2. Region object has fields
    Region Name:  England
    Resource   :    Rajeev
 
 3. Resource object has fields
    Resource Name :    Rajeev
    Company       : Sunny Industries
    
    
    If Expense report (Travel to comapny ) is saved i need to update company as (Sunny Industries ) automatically..
How to store 700 picklist fileds ?
How can i get only text from words
EX:  Sultan Road
output : Road
How to convert text output into picklist
we have two object transcation and balance with lookup relationship,
when ever balance child records is more than 50 which is associated to transtion record
if i try to add 51 need to show error . how can i acheive it ?
trigger UpdateItemRollup on Balance__c (after delete, after insert, after update) {

    Set<id> TransactionIds = new Set<id>();
    List<Transaction__c> tr = new List<Transaction__c>();
    List<Balance__c> ba = new List<Balance__c>();

    for (Balance__c item : Trigger.new)
        TransactionIds.add(item.Transaction__c);

    if (Trigger.isUpdate || Trigger.isDelete) {
        for (Balance__c item : Trigger.old)
            TransactionIds.add(item.Transaction__c);
    }

    // get a map of the traments with the number of items
    Map<id,Transaction__c> TransactionMap = new Map<id,Transaction__c>([select id, RollUp_Count__c from Transaction__c where id IN :TransactionIds]);

    // query the traments and the related inventory items and add the size of the inventory items to the trament's RollUp_Count__c
    for (Transaction__c tra : [select Id, Name, RollUp_Count__c,(select id from Balance__r) from Transaction__c where Id IN :TransactionIds]) {
        TransactionMap.get(tra.Id).RollUp_Count__c = tra.Balance__r.size();
        // add the value/trament in the map to a list so we can update it
        tr.add(TransactionMap.get(tra.Id));
    }

    update tr;

}
Showing error at relationship error
 
[select Id, Name, RollUp_Count__c,(select id from Balance__r) from Transaction__c where Id IN :TransactionIds]) {

we cannot want to install third paty rollup helper or similar ..

Thanks on advance
 
Hi team,
How to create new oppournity . when leadsource is email automatically .
Help me to create trigger on this

Thanks for advance :)
Hi,

How can i create a new oppournity automatically when lead status is active ?
how can i acheive it ?
 
Hi,
How can i create web to oppournity creation from my website contact form ?

 
Hi,

how to create Send mail button on case button,  when i click that button it need to open standard email salesforce functionality ?
Hi team,

I have written a trigger to update status on case
Note : If none of apporval not accept case status need to became reject

trigger updatestaus1 on Case_Approval_Tracker__c(after update) {Set <ID> case_ids = new Set <ID>();
 for(Case_Approval_Tracker__c c : Trigger.new) {
  case_ids.add(c.caseid);
 }

 List <Case> caList = [SELECT Id, Status, (SELECT Id,Approval_Status__c FROM Case_Approval_Tracker__c) FROM Case WHERE Id IN : case_ids];

 for(Case a : caList){
   integer count=0;
   for(Case_Approval_Tracker__c c : a.Case_Approval_Tracker__c ){
    if(c.Approval_Status__c == 'Approved'){
     a.Status = 'Approved';
    }
    else{
     a.Status = 'Rejected';  
   }  
   if(a.Case_Approval_Tracker__c.size()==count){
       a.Status = 'Rejected';
   }

  }
  update caList;
}
}


Error :  
(SELECT Id,Approval_Status__c FROM Case_Approval_Tracker__c) FROM Case
                                   ^
ERROR at Row:1:Column:55
Didn't understand relationship 'Case_Approval_Tracker__c' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

Help me to fix error :)
Hi ,
we need to send case for submit for approval.
User perspective :
when he click on submit for appproval, User need to able select list approvers to appprove.
1.  it need to multipule user and if he selected 2 approvers both approvers need to approver case.
2. Submitter has to ablilty recall for submission

How can we acheive it ?
Thanks for advance !!

Regards,
Bhanu
Hi Team,

I need to implement bulk transfer of records of case to change owner . How can i acheive it on lightning?

 User-added image

Thanks for advance.

Regards,
Bhanu
Hi team,

I have written a code to when ever record id is not equal to 01230000000PVMN and stage is closed own. I need to update tempate name as Test template(It is record which is already stored on my custom template__c object)

trigger test on Opportunity (before insert,before update) {
         map<Id,Template__c> mapIds = new map<Id,Template__c>();
               for(Opportunity opp : trigger.new){
                    if(opp.recordid__c != '01230000000PVMN' && opp.StageName == 'Closed Won'){
                        Template__c mapIds = [select Id, Name ,Owner from Template__c where Id in: mapIds];;                     
                        mapIds.Name = opp.ffrrtemplate__c;
                        mapIds.put(opp.ffrrtemplate__c,temp);
                    }
            }
    if(!mapIds.isEmpty()){
        update mapIds.values();
    }
}


error :
Line 5 : unexpected syntax: 'mismatched input ';' expecting RCURLY'
line 6: Variable does not exist: Name
line 7 : Variable does not exist: temp
line 10 : unexpected syntax: 'missing EOF at 'if''

Thanks on advance
Hi,

Iam trying to update field on oppournity, where recordid(lookup) is equal to 00528000001KyAT, need to update account id(lookup ) as 0012800000lIenH.
I have written a trigger

trigger updateif on Opportunity (before insert,before update) {
if(trigger.isBefore && (trigger.isInsert || trigger.isUpdate)){ 
          list<string> lstStr = new list<string>();
      for(opportunity opp : trigger.new){
          if(opp.record_id__c = '00528000001KyAT'){
              opp.update__c = '0012800000lIenH';
}
}
}
}

Help me to  fix this
Hi
iam facing below erroron test class actually error with validation rule and it is managed pacakage, how can i fix it but modification my code and i need a test class to reslove that issue

field_custom_validation_exception, assignment project must match expense report project.

trigger UpdateCompany on Expense_Report__c (before insert) {
      Set<Id> resourceId = new Set<Id>();
      Map<Id,Id> resourceIdVsRegionsId = new Map<Id,Id>();
      Map<Id,Id> mapRegionToCompanyName = new Map<Id,Id>();
    
      for(Expense_Report__c  expRep: Trigger.New){
          if(expRep.Resource__c!= Null){
            resourceId.add(expRep.Resource__c);
          }
      }
      
    if(resourceId.size() >0){
      for(Contact resourceObj : [select id,Region__c  from Contact where id in:resourceId]){
          if(resourceObj.Region__c != Null){
              resourceIdVsRegionsId.put(resourceObj.Id, resourceObj.Region__c);
          }
      }
      
      if(resourceIdVsRegionsId.size() >0){
          for(Region__c regionObj :[Select Id,ffpsai__OwnerCompany__c  from Region__c where Id IN: resourceIdVsRegionsId.values()]){
              if(regionObj.ffpsai__OwnerCompany__c != Null){
                mapRegionToCompanyName.put(regionObj.id,regionObj.ffpsai__OwnerCompany__c);
              }
          }
          for(Expense_Report__c  expRepObj: Trigger.New){
        expRepObj.ffpsai__OwnerCompany__c = mapRegionToCompanyName.get(resourceIdVsRegionsId.get(expRepObj.Resource__c));
        }
      }
    }
I have two formula fields
=================================================
IF(MONTH(Date__c) < 12,
IF(DAY(Date__c) > 10, Date__c, DATE(YEAR(Date__c), MONTH(Date__c)-1,+1)),
IF(DAY(Date__c) > 10, Date__c, DATE(YEAR(Date__c) + 1, 1, +1)))

==============================================================
DATE(YEAR(Date__c), MONTH(Date__c) , 1) - 1

if date is below 10th i need to upate previous date and more than 10th i need to update same day
both above formula doing two functions seperatly i need to make into single formula
 
help me to write trigger if date is less than or equal to 10 , i need to upate previous month last date . if it is above 10 we need to update same day

ex: date : 04-Jun-17   output -- 31-may-17
ex: date  : 10-jun-17  output -- 31-may-17
ex: date   11-jun-17    output -- 11-jun-17

i tried this formula
IF(MONTH(Date__c) < 12,
IF(DAY(Date__c) > 10, Date__c, DATE(YEAR(Date__c), MONTH(Date__c)-1,30)),
IF(DAY(Date__c) > 10, Date__c, DATE(YEAR(Date__c) + 1, 1, 30)))

if input is 02-06-17 ,but iam getting output as  01-05-17   i need to be 31-05-17.
help me to write trigger if date is less than or equal to 10 , i need to upate previous month last date . if it is above 10 we need to update same day

ex: date : 04-Jun-17   output -- 31-may-17
ex: date  : 10-jun-17  output -- 31-may-17
ex: date   11-jun-17    output -- 11-jun-17
Hi, I am having trouble with the "Attributes and Expressions" module from trailhead.

Here is the challenge:
Create a Lightning Component to display a single item for your packing list.
  • Create a component called campingListItem that displays the name (ui:outputText) and the three custom fields using the appropriate output components.
  • Add an attribute named 'item' for type Camping_Item__c.
I created an component named campingListItem and this is the code:
<aura:component >
    <aura:attribute name="item" type="<my_domain>__Camping_Item__c"/>
    
    <ui:outputText value="{!v.item.Name}"/>
    <ui:outputCheckbox value="{!v.item.<my_domain>__Packed__c}"/>
    <ui:outputCurrency  value="{!v.item.<my_domain>__Price__c}"/>
    <ui:outputNumber value="{!v.item.<my_domain>__Quantity__c}"/>
</aura:component>

The error that I am getting is: "Challenge Not yet complete... here's what's wrong: 
The packingListItem Lightning Component's attribute tag doesn't exist or its attributes are not set correctly."

With this, I tried to create another component, with the name "packingListItem", but It didn't work.

Can anyone help me?

Thanks,