• SANKET KUMAR 28
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 6
    Replies
When you run a Lightning experience readiness report, you will get a note that windows function will not work in Lightning.
function Close1(){
        window.close();
    }


I tried with apex:outputlink, sforce.one.navigation but the issue is when we redirect to the parent page from the child page, it gives a refreshed view of the parent page. But I have the scenario to keep the current state of parent and just close the child page tab.
One more thing, when we tried with apex:outputlink, we are not able to set the width and height of window, How we can achieve that?

similarly,
window.onload():- 
What is the tag available for Vf page that we can replace window.onload() using that tag ?


I want to make a lightning component which makes clone of opportunity in edit mode and it should have some default value. I dont want as standard clone functionality. it should open as popup like when we click on edit or new opportunity. Can you tell how to achieve this?
When you run a Lightning experience readiness report, you will get a note that windows function will not work in Lightning.
function Close1(){
        window.close();
    }


I tried with apex:outputlink, sforce.one.navigation but the issue is when we redirect to the parent page from the child page, it gives a refreshed view of the parent page. But I have the scenario to keep the current state of parent and just close the child page tab.
One more thing, when we tried with apex:outputlink, we are not able to set the width and height of window, How we can achieve that?

similarly,
window.onload():- 
What is the tag available for Vf page that we can replace window.onload() using that tag ?
Hi, I have two objects Parent__c and Child__c in Master-Detail relationship.
There is need that create a trigger on Child__c which can automatically create parent record when child records are insert or update.
Is that possible?
My understanding is a child record cannot be inserted without parent record ID.
I am trying to mass update records using dataloader. Once a record is updated, the trigger should be fired. I tried to update records but the trigger is not fired when used dataloader. When I manually update the record, the trigger is fired. Here's my code:
Trigger
    if(trigger.isafter && (trigger.isinsert || trigger.isupdate))
      {         
            UpdateExpirydate.UpdateCertDetails(Trigger.new);
      }
Apex controller:
   public static void UpdateCertDetails(List<Certification_Attendees__c> lstcertattendees)
{
    
        List<String> cerType = new List<String>{'Certification','Exam Retake','Recertification'};
        List<String> certLevel = new List<String>{'1','2','3'};
        List<Contact> lstcontacts = new List<Contact>();
        Set<Id> contactIds = new Set<ID>();
        if(lstcertattendees != null && lstcertattendees.size() > 0)
        {
            for(Certification_Attendees__c att : lstcertattendees)
            {
            contactIds.add(att.Attendee__c);
            }
            System.debug('ContactIds' + contactIds.size());
            if ( contactIds != null && contactIds.size() >0)
            {
                    for(Certification_Attendees__c attendee : [Select c.Name, c.Level__c , c.Attendee__c,c.Certified_on__c,c.Expiry_Date__c,c.Type__c,c.Exam_Result__c   from Certification_Attendees__c c where c.Attendee__c in: contactIds and
                    c.Exam_Result__c =: 'Passed' and c.Type__c in: cerType and c.Level__c in: certLevel order by c.Certified_on__c desc LIMIT 1])
                {
                     if(attendee != null)
                     {
                     Contact con = new Contact();
                     con.Id = attendee.Attendee__c;
                     con.Certified_On__c = attendee.Certified_on__c;
                     con.Expiry_Date__c = attendee.Expiry_Date__c;
                    lstcontacts.add(con);
                    }
                }   
            }
        System.debug('lstcontacts.size()' + lstcontacts.size());
            if(lstcontacts !=null && lstcontacts.size() > 0)
            {   
                    update lstcontacts;
                 system.debug('Certification details on Contact Records updated successfully');
            }
        }

}

Thanks in advance!
SOQL statements cannot query more than 20 different child types.

So how do I merge the Contacts from two different queries? 

For eg. 
List<Contact> querychilds1 = [select id,Orphan__c ,
                                     (Select id from PrimaryContact__r ),
                                      (Select id from Attachments ),
                                      (Select id from CampaignMembers ),
                                      (Select id from Cases ),
                                      (Select id from CaseContactRoles ) 
                                         and few more totaling to twenty....
                                      from contact 
                                      WHERE id IN :listofcontacts]; 

          List<Contact> querychilds2 = [select id,Orphan__c ,
                                      (Select id from Feeds ),
                                      (Select id from Histories ),
                                      (Select id from DeclinedEventRelations ),
                                      (Select id from DuplicateRecordItems ),
                                      (Select id from EmailMessageRelations ),
                                      (Select id from FeedSubscriptionsForEntity ) 
                                      from contact 
                                      WHERE id IN :listofcontacts];


       
How write the calculator program in salesforces


I want to make a lightning component which makes clone of opportunity in edit mode and it should have some default value. I dont want as standard clone functionality. it should open as popup like when we click on edit or new opportunity. Can you tell how to achieve this?