• learn_sfdc
  • NEWBIE
  • 55 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 31
    Replies
Hello Team,

Can anyone tell, what are the ways of integrating HPQC and salesforce.

Thanks
Hello,

I have used limitation in query still i am facing the same problem, can anyone help me here please.

global class POCreationBatch implements Database.Batchable<sObject>
{

    global Database.QueryLocator start(Database.BatchableContext DBC)
    {
         return Database.getQueryLocator([Select Id,Name,Purchase_Order_Type__c,ActiveContractAsset_Count__c from Account where Purchase_Order_Type__c='Required for Invoice' limit 5000]);

             
    }

    global void execute(Database.batchableContext bc,List<sObject> scope)
    {

        List<Account> accountList = (List<Account>)scope;
        Set<Id> accountIdSet = new Set<Id>();

        for(Account accountRecord : accountList)
        {
            accountIdSet.add(accountRecord.id);
        }

        ProductOrderUtils POU = new ProductOrderUtils();
        POU.createPurchaseOrders(accountIdSet);
    }


    global void finish(Database.batchableContext BC){}

}
Hi,

I am new to Trigger, i have tried writing simple trigger, but don't know what is the problem.

trigger Contact on Account (after update) {

for(Account acc : Trigger.new){
         
    Contact con = new Contact();
    con.FirstName = 'test';
    con.Lastname  = 'name';
    con.AccountID  = acc.id;
    
      insert con;

     }

}
I have a formula field on opportunity which calculates(addition) the field A and Field B and put it in Formula field, for some reason its not working for one opportunity, can anyone advise me on this.
Hi,

Im using below formula to populate the values based term estimate months field, it calculates till 83 but if its beyond 83 then it doesn calculate, can you please help me where im going wrong

IF(Team_Value__c!=0,Team_Value__c, 
IF(Opportunity.Estimate_Months__c < 12, SellPrice * 0, 
IF(AND(12 <= Opportunity.Estimate_Months__c,Opportunity.Estimate_Months__c <=35), SellPrice * 1, 
IF(AND(36 <= Opportunity.Estimate_Months__c,Opportunity.Estimate_Months__c <=59), SellPrice * 2, 
IF(AND(60 <= Opportunity.Estimate_Months__c,Opportunity.Estimate_Months__c <=83), SellPrice * 2.5, 
IF(84 >= Opportunity.Estimate_Months__c,SellPrice * 3.0,0))))))

Thanks
how can i create test class for below code,
 
public static void updateOLIWhenTermMonthsChanged(List<Opportunity> newList, Map<Id, Opportunity> oldMap) {

        Set<Id> setOppId = new Set<Id>();
        Map<Id,OpportunityLineItem> map_OppLineItem = new Map<Id,OpportunityLineItem>();

        for (opportunity opp : newList) {
            if (opp.Term_Estimate_Months__c != oldMap.get(opp.Id).Term_Estimate_Months__c) {
                setOppId.add(opp.id);
            }
        }

        if(!setOppId.isEmpty()) {
            List<OpportunityLineItem> oppLineItems = [Select Id,OpportunityId from OpportunityLineItem where OpportunityId IN:setOppId];
            // we're updating OLIs to trigger rollup for commission values
            if (!oppLineItems.isEmpty()) {
                update oppLineItems;
            }
        }


 
I am trying to copy value from Opportunity product to Opportunity

Field is TotalPrice on Opportunity Product to RSF_CLD_CB_CommValue__c on Opportunity

below is the code i am using but im getting error


Error: Compile Error:
id,RSF_CLD_CB_CommValue__c from Opportunity)
^
ERROR at Row:1:Column:62
Didn't understand relationship 'Opportunity' 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. at line 5 column 51


 
trigger CommValue on OpportunityLineItem (after insert,after update) {

            List<Opportunity> lstOppUpdate = new List<Opportunity>();
                    
               List<OpportunityLineItem> lstOli = [select id,TotalPrice,(select id,RSF_CLD_CB_CommValue__c from Opportunity) 
                        from OpportunityLineItem where id in: trigger.newmap.keyset()];
                    
                
                       
                for(OpportunityLineItem oli : lstOli){
                
                if(oli.TotalPrice != NULL){

            for(Opportunity opp: oli.Opportunity__r){              

                opp.RSF_CLD_CB_CommValue__c += oli.TotalPrice;
                
                lstOppUpdate.add(opp); 
                }
        }

    }

    if(lstOppUpdate.size() > 0){

        update lstOppUpdate;

    }

 
Hello,

We have Three objects like Account, Contract Asset, Purchase Order.

In An account there are many contract assets which i have to link it to Purchase Order.

example:  There is a Contact Asset with following condition
          Status = Active
          Product family = Banking

      
Then Associate this Contract Asset To Purchase Order, where Product Family field on Purchase Order is Banking.     

Thanks      
 
Can anyone help me to achieve below scenario

I have a set of Roll Up fields in Opportunity Object (Example - RSF_Bank_APAC_A, RSF_Bank_APAC_B, RSF_BANK_EUR_A, RSF_BANK_EUR_B)
Opportunity Line item(Opportunity Product) has set of fields like ProductFamily(Formula Field)and Currency(Currency Field)
So when ever ProductFamily is RSF_Bank_APAC_A and Currency field is not null in Opportunity Product it has to update RSF_Bank_APAC_A in Opportunity object.

I have tried process builder but i have some where around 25 RollUp Summary field where it doesnt make me sure it works.
Even the workflow Rule is not fine here because i have too many workflows in my org.

Can anyone help me with other ways.

Thanks
Hello,
I have got - First error: line 1:90 no viable alternative at character '<EOF>'

Below is the code where the error referenced


global class batchCaseAttachmentDeletionClass implements Database.Batchable<SObject>  
{
    global String CaseQuery;
    global Date custom_closed_date;
   
    
    
    global batchCaseAttachmentDeletionClass()
     {
CaseQuery = 'Select Id,custom_closed_date__c from Case where custom_closed_date__c= '+ Date.Today().AddDays(-8);
     }
     
global Database.QueryLocator start(Database.BatchableContext bcMain) {
  return Database.getQueryLocator(CaseQuery);
}

         global void finish(Database.BatchableContext bFinish)
{

}
    


// "Execute" is what is being run as a separate process per batch
global void execute(Database.BatchableContext bcMain, List<SObject> lstBatchRecords) 
{
    Set<Id> caseId = new set<Id>();
    List<Case> cs_List = (List<Case>)lstBatchRecords;
    List<CaseComment> lst_CaseComment = new List<CaseComment>();
    
    for(Case cs : cs_List)
     {
        caseId.add(cs.id);
     }
     
  List<Attachment> listAttachment = new List<attachment>([Select Id,ParentId,Name,Body from Attachment where ParentId IN:
                                                          caseId]);
                                                          
    
   for(Attachment attachmentRecd : listAttachment) 
    {
      CaseComment cseComment = new CaseComment();
      cseComment.ParentId = attachmentRecd.ParentId;
      cseComment.CommentBody = 'Attachment -'+ attachmentRecd.Name +  'has been deleted';
      lst_CaseComment.add(cseComment);
    }
    

    
    if(listAttachment!=null && listAttachment.size()>0)
     {
        try
         {
        delete listAttachment;
        insert lst_CaseComment;
         }catch(Exception e)
           {
             throw e;
           }
     }
     
     }
     
     }
 Hello,  

I have a around 10 workflows and there are 9 creteria in all the 10 workflow (in each and every workflow 8 creteria are the same but only one 1 criteria is different), i would like to combine reduce number of workflows created and would like to replace the similar functonality.  

Is it possible through Visual Flow / Process Builder, which is the best way,?  Can any one suggest me.  
Does Visual Flow also provides - Time dependent email alert?

Thanks
Hello,

I have installed eclipse IDE and cretaed a force.com project but im not getting Workflows and validation rule components though its there in the package XML, if i try to install it again im getting error(while installing im installing through components from Metadata)

Can anyone help me to install the force.com project properly which has full components.

Thanks
Hi,

How to get query and relationship between two objects(standard and custom)

i have below details

standard object - case
custom object - product version

 TESTCase = [Select  
                           c.AccountId, 
                            c.Account.Type,
                            c.RecordTypeId
        from Case c where Id= :ViewingCase.Id];

how do i include product version object fields in to above query.

Thanks
                   
                           
                          
                       
                   
Hello Friends,

I am trying to retrive a data from Custom Object A to Standard Object B

for standard object i can use if function like below

 if(MoreCase.Account.Type != null && MoreCase.Account.Type != '')
            {
                if(MoreCase.Account.Type.contains('Customer')){
                    ShowCustomer = true;
                }else if(MoreCase.Account.Type.Contains('Ex-Customer')){
                    ShowExCustomer = true;

I am using Account object and type is field which standard object but for my custom object and field how would i use 

custom object  API Name - Product_Version_Master__c
field name is - Existing_Version 

how will i use this in my function?

Thanks
 
Hello,

How to make checkbox field mandatory when ever the status changes.

i have written sample validation rule

IF(AND( 
ISPICKVAL(Status,"Open"), ISPICKVAL(PRIORVALUE(Status),"Closed"),
(Flag__c = True)))

Thanks
I have created a java script if my checkbox field is true then pop up will appear, 
to update this checkbox i have created a workflow when ever the status changes from closed to open then checkbox field will get updated and pop up will appear.

since checkbox is true as per above rule criteria, pop up appear everytime for any update in case object, which i really do not required.

i have tried below formula

AND( 
ISPICKVAL(Status,"Open"), 
OR( 
ISPICKVAL(PRIORVALUE(Status),"Closed") 

)

and field update is

New Field Value = "True"

so how will i handle this?

Thanks
Hello Friends,

I am trying to build a pop up alert box in my case object. Whenever my status field is changed to closed, I want to display a pop up. Here's what I have tried so far:

<apex:page standardController="case">
<script>
windows.document.onload = new function(e) {
if({case.JIRA_Status__c= 'Closed'})
{
alert("True");
} else
{ alert("false";) }
}
</script>
</apex:page>
Hello,

Can anyone help me to do below action.
When ever the status changes in case ,how to display pop up on case screen using java script. 

Thanks
 
Hello Friends,

I am new to development and i am trying to build pop up screen .

when ever i change my status from closed to open before clicking on save button i would like to get a java script pop up to show the message.

Can anyone help me please.

Thanks

 
Hi,

Im using below formula to populate the values based term estimate months field, it calculates till 83 but if its beyond 83 then it doesn calculate, can you please help me where im going wrong

IF(Team_Value__c!=0,Team_Value__c, 
IF(Opportunity.Estimate_Months__c < 12, SellPrice * 0, 
IF(AND(12 <= Opportunity.Estimate_Months__c,Opportunity.Estimate_Months__c <=35), SellPrice * 1, 
IF(AND(36 <= Opportunity.Estimate_Months__c,Opportunity.Estimate_Months__c <=59), SellPrice * 2, 
IF(AND(60 <= Opportunity.Estimate_Months__c,Opportunity.Estimate_Months__c <=83), SellPrice * 2.5, 
IF(84 >= Opportunity.Estimate_Months__c,SellPrice * 3.0,0))))))

Thanks
what is cross object in salesforce
Hello,

I have used limitation in query still i am facing the same problem, can anyone help me here please.

global class POCreationBatch implements Database.Batchable<sObject>
{

    global Database.QueryLocator start(Database.BatchableContext DBC)
    {
         return Database.getQueryLocator([Select Id,Name,Purchase_Order_Type__c,ActiveContractAsset_Count__c from Account where Purchase_Order_Type__c='Required for Invoice' limit 5000]);

             
    }

    global void execute(Database.batchableContext bc,List<sObject> scope)
    {

        List<Account> accountList = (List<Account>)scope;
        Set<Id> accountIdSet = new Set<Id>();

        for(Account accountRecord : accountList)
        {
            accountIdSet.add(accountRecord.id);
        }

        ProductOrderUtils POU = new ProductOrderUtils();
        POU.createPurchaseOrders(accountIdSet);
    }


    global void finish(Database.batchableContext BC){}

}
Hi,

I am new to Trigger, i have tried writing simple trigger, but don't know what is the problem.

trigger Contact on Account (after update) {

for(Account acc : Trigger.new){
         
    Contact con = new Contact();
    con.FirstName = 'test';
    con.Lastname  = 'name';
    con.AccountID  = acc.id;
    
      insert con;

     }

}
Hi,

Im using below formula to populate the values based term estimate months field, it calculates till 83 but if its beyond 83 then it doesn calculate, can you please help me where im going wrong

IF(Team_Value__c!=0,Team_Value__c, 
IF(Opportunity.Estimate_Months__c < 12, SellPrice * 0, 
IF(AND(12 <= Opportunity.Estimate_Months__c,Opportunity.Estimate_Months__c <=35), SellPrice * 1, 
IF(AND(36 <= Opportunity.Estimate_Months__c,Opportunity.Estimate_Months__c <=59), SellPrice * 2, 
IF(AND(60 <= Opportunity.Estimate_Months__c,Opportunity.Estimate_Months__c <=83), SellPrice * 2.5, 
IF(84 >= Opportunity.Estimate_Months__c,SellPrice * 3.0,0))))))

Thanks
I am trying to copy value from Opportunity product to Opportunity

Field is TotalPrice on Opportunity Product to RSF_CLD_CB_CommValue__c on Opportunity

below is the code i am using but im getting error


Error: Compile Error:
id,RSF_CLD_CB_CommValue__c from Opportunity)
^
ERROR at Row:1:Column:62
Didn't understand relationship 'Opportunity' 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. at line 5 column 51


 
trigger CommValue on OpportunityLineItem (after insert,after update) {

            List<Opportunity> lstOppUpdate = new List<Opportunity>();
                    
               List<OpportunityLineItem> lstOli = [select id,TotalPrice,(select id,RSF_CLD_CB_CommValue__c from Opportunity) 
                        from OpportunityLineItem where id in: trigger.newmap.keyset()];
                    
                
                       
                for(OpportunityLineItem oli : lstOli){
                
                if(oli.TotalPrice != NULL){

            for(Opportunity opp: oli.Opportunity__r){              

                opp.RSF_CLD_CB_CommValue__c += oli.TotalPrice;
                
                lstOppUpdate.add(opp); 
                }
        }

    }

    if(lstOppUpdate.size() > 0){

        update lstOppUpdate;

    }

 
Hello,
I have got - First error: line 1:90 no viable alternative at character '<EOF>'

Below is the code where the error referenced


global class batchCaseAttachmentDeletionClass implements Database.Batchable<SObject>  
{
    global String CaseQuery;
    global Date custom_closed_date;
   
    
    
    global batchCaseAttachmentDeletionClass()
     {
CaseQuery = 'Select Id,custom_closed_date__c from Case where custom_closed_date__c= '+ Date.Today().AddDays(-8);
     }
     
global Database.QueryLocator start(Database.BatchableContext bcMain) {
  return Database.getQueryLocator(CaseQuery);
}

         global void finish(Database.BatchableContext bFinish)
{

}
    


// "Execute" is what is being run as a separate process per batch
global void execute(Database.BatchableContext bcMain, List<SObject> lstBatchRecords) 
{
    Set<Id> caseId = new set<Id>();
    List<Case> cs_List = (List<Case>)lstBatchRecords;
    List<CaseComment> lst_CaseComment = new List<CaseComment>();
    
    for(Case cs : cs_List)
     {
        caseId.add(cs.id);
     }
     
  List<Attachment> listAttachment = new List<attachment>([Select Id,ParentId,Name,Body from Attachment where ParentId IN:
                                                          caseId]);
                                                          
    
   for(Attachment attachmentRecd : listAttachment) 
    {
      CaseComment cseComment = new CaseComment();
      cseComment.ParentId = attachmentRecd.ParentId;
      cseComment.CommentBody = 'Attachment -'+ attachmentRecd.Name +  'has been deleted';
      lst_CaseComment.add(cseComment);
    }
    

    
    if(listAttachment!=null && listAttachment.size()>0)
     {
        try
         {
        delete listAttachment;
        insert lst_CaseComment;
         }catch(Exception e)
           {
             throw e;
           }
     }
     
     }
     
     }
 Hello,  

I have a around 10 workflows and there are 9 creteria in all the 10 workflow (in each and every workflow 8 creteria are the same but only one 1 criteria is different), i would like to combine reduce number of workflows created and would like to replace the similar functonality.  

Is it possible through Visual Flow / Process Builder, which is the best way,?  Can any one suggest me.  
Does Visual Flow also provides - Time dependent email alert?

Thanks
Hi,

How to get query and relationship between two objects(standard and custom)

i have below details

standard object - case
custom object - product version

 TESTCase = [Select  
                           c.AccountId, 
                            c.Account.Type,
                            c.RecordTypeId
        from Case c where Id= :ViewingCase.Id];

how do i include product version object fields in to above query.

Thanks
                   
                           
                          
                       
                   
Hello Friends,

I am trying to retrive a data from Custom Object A to Standard Object B

for standard object i can use if function like below

 if(MoreCase.Account.Type != null && MoreCase.Account.Type != '')
            {
                if(MoreCase.Account.Type.contains('Customer')){
                    ShowCustomer = true;
                }else if(MoreCase.Account.Type.Contains('Ex-Customer')){
                    ShowExCustomer = true;

I am using Account object and type is field which standard object but for my custom object and field how would i use 

custom object  API Name - Product_Version_Master__c
field name is - Existing_Version 

how will i use this in my function?

Thanks
 
Hello,

How to make checkbox field mandatory when ever the status changes.

i have written sample validation rule

IF(AND( 
ISPICKVAL(Status,"Open"), ISPICKVAL(PRIORVALUE(Status),"Closed"),
(Flag__c = True)))

Thanks