• Shams Tabrez
  • NEWBIE
  • 30 Points
  • Member since 2022

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 13
    Replies
I need to a way to have a field on custom objects for an alert that will popup when the record is opened.
What is the best way to go about this?
Write a trigger to display all trigger context variables using debug logs.
public class createNewAccount {
    
    public Contact createAcc(string conName){
        
        account acc = new account();
        acc.Name = conName;
        insert acc;
        system.debug(acc);
        
        contact con = new contact contact();
        con.LastName = conName + 'Contact';
        con.AccountId = acc.Id
        insert con;
        system.debug(con);
        
        return Contact;
    }

}

this is the program in which I couldn't find the error. Can somebody please help me?
how to get object name of lookup field in apex
for ex:
I have obj customObj__c
In this obj have lookup field of Account name: customObj Account
Now I have obj Name : customObj__c and lookup field Name:customObj Account.
problem is that how to get releted  object Name(Account) by lookup fieldApiName(customObj_Account__r) and object. name(customObj__c )
Hello All

   I am new salesforce admin/developer. I have a requirement to create a new field(# of Active policy) in Account object which calculate the total no of active policy associated in the account. Whenever a new policy is added or expired, the new field(# of Active policy) in account object  is calculated. I am calculating this in Policy Trigger hander class. It is working fine whenever the policy status is changed or added. Now i need to calculate this field value for all the accounts with existing policy. What is the best way to achieve this?  Dataloader to update field in Policy object ? or Flow builder?

Please suggest ideas.

Thanks
Ramya Balakrishnan
I need to a way to have a field on custom objects for an alert that will popup when the record is opened.
What is the best way to go about this?
I am trying to run SOQL query 

code added in query editor
SELECT
            First_Name__c
            Experience__c

FROM
            Indeed_COm_Job_Form__c

WHERE 
            Experience__c >1

and i am getting error as : Invalid query: The query has to start with 'FIND' or 'SELECT'.
but i have used SELECT word at beginning
 
 Hi Team
 I have a question as I cannot see all the fields for selection of an related object in the related list.
Which fields of an object are available in available fields list of a related list?
  • April 07, 2022
  • Like
  • 0
Hello All,

I have written following code in apex class:

public class StudentSelection {
    Public Static Void StudentSelectionCriteria(List<Student__c> StudentListNew){
        for(Student__c S : StudentListNew){
            if (S.Age__c<=30 && S.Experience__c>8){
                S.Status__c='Selected';
            }
            else if(S.Age__c>30 && S.Experience__c<8){
                S.Status__c='Not Selected';
            }
           
      }       
  }
}

Trigger :
trigger StudentSelectionTrigger on Student__c (before insert) {
    
    if(Trigger.isBefore==True && Trigger.isInsert==True){
        
       StudentSelection.StudentSelectionCriteria(Trigger.New);
    }

}

Can you check while satisfying not selected condition i am gettin error:

StudentSelectionTrigger: data changed by trigger for field Status: data value too large: (value has been hidden)

Also can we use only else instead of if else??