• Kristiana Granger
  • NEWBIE
  • 60 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 10
    Replies
On user object - I want to display warning message via VF page, but here the problem is there is no option for Inline VF page on User Layout. is there any workaround?
OR
Apart from VF page is there any other options to display warning?
User object there is no option for Inline VF page

My requirment is - Junction Object (Junction1__c) record should get created when user create new record on "Account"/"Location" object

Data model -
Account Obj 
M_number__c field

Location object
M_number__c field


Junction1 Object
Account__c (M-D Rel with Account)
location__c (M-D rel with location)

When user create new recrod on Account Or Location object, it should automatically create new Rec on Junction Obj
Can any one share some related URL's
Via Azure or any medium how can I deploy my entire repo
Parent Object - AC - field1 Status picklist value 
Child Object Op - When Field1 is "Completed" it should not allowed to create OP record. 

 
Can anyone guide me how to write Validation rule, When Field status is Complete / cancelled at that time child object should not allowed be created
Here is code 
 public static List<RetentionPlan__mdt> fetchAllData() {
        List<RetentionPlan__mdt> dataList = [Select id, Order__c , 
                                                       Retain__c, Limit__c,
                                                      SobjectAPIName__c ,                                                     SobjectAPIName__r.QualifiedApiName,
                                                       Where__c 
                                                       FROM RetentionPlan__mdt 
                                                    WHERE isActive__c = true];

        return dataList;   
    }
    
   public static void operationDataStorageReduction(List<sobject> scope) {
        Database.delete(scope, false);
    }
---------------------------
So basicaly these two methods get call from batch class, (Delete records) Can any one guide me how to write testclass for these 2
Account and Contact One Custom fiedl - "Status"
one Account having multiple contact - if all contact Status fiedl is Active then only update "Active" in Account page. Even if 1 contact inactive then Account also inactive - 
I have written trigger. but it working fine only with 1 record. I mean when user insert new contatc at that whatever status I have given based on that it update on contact. but how to check for All contact ? 
A developer creates a Workflow Rule declaratively that updates a field on an object. An Apex update trigger exists for that object.
What happens when a user updates a record?  

A. No changes are made to the data.
B. Both the Apex Trigger and Workflow Rule are fired only once.
C. The Workflow Rule is fired more than once.
D. The Apex Trigger is fired more than once

Ex - There is one button(action) we have created.

when user clicked that button from LE so it should open view in Lightning ,
when user clicked from classic it should open in classic view
when user clicked from salesforce1 it should be open in respective view.
based on which things we can come to know. can any one gives me sample code ?


 

On user object - I want to display warning message via VF page, but here the problem is there is no option for Inline VF page on User Layout. is there any workaround?
OR
Apart from VF page is there any other options to display warning?
User object there is no option for Inline VF page
i have two master detail object Author__c and Research_Paper__c and one junction object Author-Research_paper__c. Junction object has lookup field Author and Research-paper.. Now i want that after selecting Author name  from Lookup field, author name should be updated automatically in "Name of Author" in Research-paper__c object.
Here is my code:
trigger SampleAuthorPopulate on Author_Research_Paper__c (after insert,after update) {

    set<id> setid=new set<id>();
    set<id> setauthor=new set<id>();
   for(Author_Research_Paper__c ar:trigger.new)
    {
       
        setid.add(ar.Research_Paper__c);
        setauthor.add(ar.Author__c);
    }
     map<id,Research_Paper__c> rmap=new map<id,Research_Paper__c>();
    for(Research_Paper__c rc:[select id,Name_of_Primary_Author__c from Research_Paper__c where id in:setid])
    {
        rmap.put(rc.Id, rc);
    }
    
     list<Author_c> au=[select id,name from Author__c where name in: setauthor];
    list<Research_Paper__c> rlist=new  list<Research_Paper__c>();
    for(Author_Research_Paper__c ar:trigger.new)
    {
       if(rmap.containsKey(ar.Research_Paper__c))
            {
                 if(ar.Is_Primary_Author__c==true)
                {
                  
                 rmap.get(ar.Research_Paper__c).Name_of_Primary_Author__c=au.Name;
                rlist.add(rmap.get(ar.Research_Paper__c));
                }
               
            }
    }
   update rlist;
}
Parent Object - AC - field1 Status picklist value 
Child Object Op - When Field1 is "Completed" it should not allowed to create OP record. 

 
Account and Contact One Custom fiedl - "Status"
one Account having multiple contact - if all contact Status fiedl is Active then only update "Active" in Account page. Even if 1 contact inactive then Account also inactive - 
I have written trigger. but it working fine only with 1 record. I mean when user insert new contatc at that whatever status I have given based on that it update on contact. but how to check for All contact ?