• Surya Prakash Tomar
  • NEWBIE
  • 60 Points
  • Member since 2016
  • Salesforce Developer

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 18
    Replies
I have created Push Topics by following steps given in developer guide, while subscribing it into workbench it is not allowing to subscribe and also given error in browser console as follow :- 
 "Uncaught Illegal state: already disconnected".

Please help
Hi All,

I want to know that how can we use inline visualforce page in lightning case record detail page layout.

Thanks,
Parteek

Hi Team,

In "quote line item" Object i need to create one formula fields that are showing the "Total Price" field value but am not able to do this because In "quote line item" Object  "Total Price" field is not Visible in formula fields?

Please let me know this is the limitation from the salesforce side or any suggestion?

trigger CreateRenewal on Opportunity (before update) {

  Map<Id, Opportunity> renewals = new Map<Id, Opportunity>();

  for (Opportunity opp : Trigger.new) {
 
    if (opp.CloseDate <= opp.CloseDate - 30) {
       Opportunity renewal = new Opportunity();
       renewal.AccountId   = 'opp.AccountId';
       renewal.Name        = opp.Name + 'Renewal';
       renewal.CloseDate   = opp.CloseDate + 365;
       renewal.StageName   = 'Open';
       renewal.RecordType  = 'Renewal';
       renewal.OwnerId     = opp.OwnerId;
       renewals.put(renewal.Id, renewal);
    }
  }

   insert renewals;
}

 
Hello,

I've never written a trigger before and was wondering if someone can help. All I need is a trigger on the Account object, on update, that will check to see if Tax ID changed. If this is true, then update the Comments field with something like "Tax ID was last updated on" & Today(). The pseudocode would be something like this:

Trigger TaxIdChanged on Account (On Update)
If ISCHANGED(Tax_id__c) = True
    Comments = "Tax ID was last updated on" & Today()
End

It is important to know that Tax_Id__c is an encrypted field and this is why I'm having to try to create a trigger to do this since I believe is the only way to look at the contents of an ecrypted field. I've tried doing this via a workflow rule or process builder, and unfortunately was not able to do it becuase I'm dealing with an encrupted field.

Thank you so much!!
Hi,
I am new to Apex and SOQL. I tried creating the nested query in workbench and it works fine and return 80K rows. Below is the query
SELECT ID,name,region__c, tracker__c,
(select id,Account__r.name,product__c from product_account__r),
(select year__c from product_year__r)
FROM tracker__c
My issue is how do I export this in excel or csv. I read blog and it was mentioned that we need to write a code. Could someone please help me here.
I want to export the data to excel or csv that is coming from this query.(80K rows)

Thanks.
 
is it posible to create for two unrelated objects in salesforce pleas help me
can we make changes to the custom settings objects in production or shall we do it in sandbox?
  1. public class ControllerFeedback {
  2.     public alu_Opportunity_Matching__c objs {get;set;}
  3.     public void init() {
  4.         Id ids = ApexPages.currentPage().getParameters().get('id');    
  5.         system.debug('Id'+ids);
  6.         alu_Opportunity_Matching__c obj = [select id, Applicant_Student_Record__r.Name, Application_Status__c,Opportunity__r.Name FROM alu_Opportunity_Matching__c WHERE id = :ids];        
  7.         objs = obj;
  8.         system.debug('name'+objs);
  9.         obj.Application_Status__c = 'Opted-out';
  10.         Update obj; 
  11.         return;        
  12.     }
  13.     
 
  1. }
  2. @isTest
  3. public class ControllerFeedbackTests {
  4.     
  5.     static testMethod void test_ControllerFeedback() {
  6.         
  7.     test.startTest();
  8.     
  9.     account acc = new account();
  10.     acc.Name = 'test';
  11.     insert acc;
  12.     
  13.     Contact con = new Contact();
  14.     con.Lastname = 'test con';
  15.     con.Email = 'test@gmail.com';
  16.     con.AccountId = acc.Id;
  17.     insert con;
  18.     
  19.     Opportunity opp = new Opportunity();
  20.     opp.AccountId = acc.Id;
  21.     opp.Name = 'Demo';
  22.     opp.StageName = 'Demo';
  23.     opp.CloseDate = System.Today();
  24.     opp.Key_Contact__c = con.Id;
  25.     insert opp;
  26.  
  27.     alu_Opportunity_Matching__c aluOpp = new alu_Opportunity_Matching__c();
  28.     aluOpp.Applicant_Student_Record__c = opp.Key_Contact__c;
  29.     aluOpp.Opportunity__c = opp.Id;
  30.     aluOpp.Application_Status__c = 'none';
  31.  
  32.     insert aluOpp; 
  33.     
  34.     PageReference testPage = new pagereference('/apex/feedback');
  35.     ApexPages.currentPage().getParameters().put( 'id', aluOpp.id );
  36.     
  37.     ControllerFeedback cf = new ControllerFeedback();
  38.     cf.init(); 
  39.     
  40.     test.stopTest();
  41.     }
  42.     
  43. }
I have four objects 
1.ObjectA
2.ObjectB
3.ObjectC
4.ObjectD
ObjectA is parent ObjectB is child,ObjectB is parent ObjectC is child,ObjectC is parent ObjectD is child 
How to write Apex Class?

 
Hi,

In the past I created a VF page that had 4 buttons on it to do 4 actions. Take Ownership...Flag a Case...etc. When I put the VF page on as a lightning component the buttons do not work. The buttons are controlled with Javascript in the VF code.
I am assuming that I have to redesign the page to be a lightning component. This isn't a question on how to do, I am wondering what to do to get these buttons to work in the Lightning Experience.

Thanks,
-Julio Hernandez
I created one Close Task checkbox in Account. Whenever I checked on Close Task in Account, all task should be closed.
I'm learning how to write triggers. I wrote a trigger but it's not working. Please look at it and help.
 
trigger CloseTaskInAccount on Account (before update) {
    List<Account> acc = [Select Id From Account];
    for(Account acc : Trigger.new) {
        Task t = new Task();
        if(acc.Close_Task__c == True) {
            t.Status = 'Completed';
            t.WhatId = acc.Id;
            update t;
        }
    }
}
I have created Push Topics by following steps given in developer guide, while subscribing it into workbench it is not allowing to subscribe and also given error in browser console as follow :- 
 "Uncaught Illegal state: already disconnected".

Please help
Hi All,

I want to know that how can we use inline visualforce page in lightning case record detail page layout.

Thanks,
Parteek
Employee object is in lookup relation with account,When we will create Event Record with Condition (Event Status = Closed) and once we click on save ,it should create Employee record automatically.What will be the trigger for it?
Hi All,

Can anyone please help me with bellow challenge.


Create an Apex trigger for Account that matches Shipping Address Postal Code with Billing Address Postal Code based on a custom field.
For this challenge, you need to create a trigger that, before insert or update, checks for a checkbox, and if the checkbox field is true, sets the Shipping Postal Code (whose API name is ShippingPostalCode) to be the same as the Billing Postal Code (BillingPostalCode).The Apex trigger must be called 'AccountAddressTrigger'.
The Account object will need a new custom checkbox that should have the Field Label 'Match Billing Address' and Field Name of 'Match_Billing_Address'. The resulting API Name should be 'Match_Billing_Address__c'.
With 'AccountAddressTrigger' active, if an Account has a Billing Postal Code and 'Match_Billing_Address__c' is true, the record should have the Shipping Postal Code set to match on insert or update.

For above challenge i tried with following code but looks like it doesnt mach the requirement.

trigger AccountAddressTrigger on Account (before insert, before update) {
    for(Account a : Trigger.new){
        If (a.Match_Billing_Address__c = true) {
            /*ShippingPostalCode = BillingPostalCode;*/
        }   
    } 

}

Please help me