• Apurva Dutta 8
  • 0 Points
  • Member since 2014

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
  • 1
Hi Guys,

Need your hep and advice here. I have a custom button on Case object that has been overridden with a custom url. Also, earlier we had only 1 record type in Case. So, when a user click's the custom case button from Opportunity he is by default redirected to case creation page hence the solutions work flawlessly. But now we have introduced another record type in Case. So, the issue is whenever a user is clicking on the custom case button from opportunity, he doesnot get to select the record type and is re-directed to deflaut record type that is selected in in profile.

So, my doubt here is 

1. Can we write a javascript to update the code on the custom button to show the user the record type selection page.
2. After user selects the desired record type can we pass some information from opportunity to Case through javascript? 

Here is the code that exsitited before










&cas3_lkid={! NULLVALUE (Case.ContactId, Contact.Id )}

&cas3={! NULLVALUE (Case.Contact, Contact.Name )}


Also, if you experts have any psuedu code for the same i would be really gratefull. 

Thanks A Lot.

I have two Objects Case and Case_Action__c. Whenever a case's Contract status is changed to Rejected, it should create a record in Case Action Object. Now, if the Case Action status is changed to "Resubmitted", the case's contract status should also be updated to "Resubmitted" and in a Date time field the Date/Time should get capture. Now, if Case's Contract statsu is again changed to "Rejected", it should again create a Case Action record. Now, if 2nd Case action status record is updated to "Resubmitted", it should update the case's contract status field to "Resubmitted" , but the date/time should be capture in the second date/time field. 

I have come up with below trigger, which populates the 1st date/time field but not the second one.  Could anybody please tell me what i am doing wrong here?

trigger updateCaseOwner on Case_Action__c (before update)
    Map<Id,Case_Action__c> casActonMap = new Map<Id,Case_Action__c>();
    casActonMap = Trigger.OldMap;
    Set<Id> casID = new Set<Id>();
    Integer Count =0;
    List<Case> casLst = new List<Case>();
    for(Case_Action__c casActon : trigger.new)
    List<Case> casObjLst = [Select Id,Contract_Status__c,Sales_Resubmit_Comments__c,Sales_Resubmission_Date__c,X2nd_Sales_Resubmission_Date__c from Case where Id in : casID];
    for(Case_Action__c casActonObj : Trigger.new)
        Case_Action__c casActnOld = new Case_Action__c();
        casActnOld = casActonMap.get(casActonObj.Id);
        if(casActonObj.Status__c == 'Resubmitted' && casActnOld.Status__c != 'Resubmitted')
            for(case cas :casObjLst)
            //Count = 0;
                if(Count == 0 && cas.Sales_Resubmission_Date__c == null)
                    System.debug('Checking if entering into the loop-------');
                    cas.Contract_Status__c = 'Resubmitted';
                    cas.Sales_Resubmit_Comments__c = casActonObj.Resubmit_Comments__c;
                    cas.Sales_Resubmission_Date__c = System.now();
                else if( count == 1 && cas.Sales_Resubmission_Date__c != null)
                   System.debug('Checking else entering into the loop----1---');
                   cas.Contract_Status__c = 'Resubmitted';
                   cas.Sales_Resubmit_Comments__c = casActonObj.Resubmit_Comments__c;
                   cas.X2nd_Sales_Resubmission_Date__c = System.now();
    update casLst;

Thank You.

I have a requirement. I have a lookup field(user) on opportunity which when filled and opportunity is saved, the user should be automatically inserted into opportunity team members with edit access. Could anyone please help me in achaiving this. I know we have to write an apex trigger so any help would be really appriciated.

Hi All,

I am unable to pass the custom field values to the below alert box. My scenario is like when i click on the custom button, i need to pass item_id__c via url to open the visual page. 

var Account = "{!Account.Id}";
var AccountName = "{!Account.Name}";
var ItemName= "{!Account.Item_ID__c}";
  • February 04, 2015
  • Like
  • 0