• vamsi lankisetty
  • NEWBIE
  • 15 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 9
    Replies
Hi all,

There is an email field in Account and contact object.

If the value of Email Field on account is updated, then it should reflect the same on contact.

Can anyone help me, how to achieve this thorugh Apex

Thanks
L Vamsi
Hi all,
I have created one custom object "Friends_Birthday__c" and also created "DOB__c" field so that i can store my friends birthday in "DOB__c" field. Totally i have created 20 Records.

My scenario : When every my friend Bday is coming nearby with in 2 days of it, i have to get email alert. and it should repeat the same for n number of years.

Example : My friends birthday is on 30th Oct. By 28th oct i should receive email alert about my friends birthday.

Note : I tried this one with Workflow rule and Process builder, here the thing is, it is working static

Ex : Suppose today date is 28 oct and my friends bday date is 30th oct. When i am trying with Workflow and PB, i am getting instant email alerts.

Where as, again i am creating one record as bday date with 31st oct and my expected result  i should get email alert on 29th oct. But in reality i am not getting any email alerts.

I am making this scenario as a static one..

Can anyone suggest me solution or with any apex code.

Thanks,
L Vamsi
Here i have created Picklist(Premium_Type :  monthly, quarterly, half-yearly and annually) , Premium_start_Date, End_Date and Premium_Due_Date and with some help updated the code, which is a static one. The code is 

public with sharing class LICDueDate 
{
  public static void DueDateInsert (list<Life_Insurance_Data__c> Due)
    {
        for(Life_Insurance_Data__c D : Due)
            if(D.Premium_Type__c == 'Monthly')
        {
            D.Premium_Due__c = D.Premium_Start_Date__c.addMonths(1) - 5;
        }
        else if(D.Premium_Type__c == 'Quarterly' )
        {
            D.Premium_Due__c = D.Premium_Start_Date__c.addMonths(3) - 5;       
        }
        else if(D.Premium_Type__c == 'Half-Yearly')
        {
            D.Premium_Due__c = D.Premium_Start_Date__c.addMonths(6) - 5;
        }
        else if(D.Premium_Type__c == 'Yearly')
        {
            D.Premium_Due__c = D.Premium_Start_Date__c.addMonths(12) - 5;
        }                                                                 
     }

Here the code works fine and i got one problem. 

I am getting Due Date correctly for the 1st time and it is not working when the due date has paid, it should move on to the next month due date. please refere the image below.

User-added imageHere i need like If i choose (D.Premium_Type__c == 'Monthly') and start date is 01/02/2019.
The premium due will be : 24/02/2019 ( perfect till now)

when i paid my Due amount on or before 24/2/2019 in my "LIC_Payement_Gateways" and considering my "Paid_Date__c", the  due date should change to next month : 27/03/2019 and it should go on with Monthly, quarterly, half-yearly and yearly ( this is what i want to do )

Any one can help me in this ?

Thanks in advance.
 
Hi all,

There is an email field in Account and contact object.

If the value of Email Field on account is updated, then it should reflect the same on contact.

Can anyone help me, how to achieve this thorugh Apex

Thanks
L Vamsi
Dear All,

I am trying to write a workflow for sending an mail on Birthday, so when i am trying to evalute "Formula Evalutes to true" and then writing DATE(YEAR(TODAY()),month(DOB__c),day(DOB__c))<= TODAY(), i want mail to be trigger on date of birth with not with the curent year , but i am not able to get the desired result.
please help

Regards
Pranav
Hello,

I have a CustomObject1__c

I want to put a condition where
IF the Status__c = 'XyW'
  then - CustomDateField is Mandatory && Date cannot be less than current month

Date can not be less than current month means
If today is 25 october2019  the date can be greater thatn 1st October 2019

Thank you for suggestion
          
  • October 25, 2019
  • Like
  • 0
Here i have created Picklist(Premium_Type :  monthly, quarterly, half-yearly and annually) , Premium_start_Date, End_Date and Premium_Due_Date and with some help updated the code, which is a static one. The code is 

public with sharing class LICDueDate 
{
  public static void DueDateInsert (list<Life_Insurance_Data__c> Due)
    {
        for(Life_Insurance_Data__c D : Due)
            if(D.Premium_Type__c == 'Monthly')
        {
            D.Premium_Due__c = D.Premium_Start_Date__c.addMonths(1) - 5;
        }
        else if(D.Premium_Type__c == 'Quarterly' )
        {
            D.Premium_Due__c = D.Premium_Start_Date__c.addMonths(3) - 5;       
        }
        else if(D.Premium_Type__c == 'Half-Yearly')
        {
            D.Premium_Due__c = D.Premium_Start_Date__c.addMonths(6) - 5;
        }
        else if(D.Premium_Type__c == 'Yearly')
        {
            D.Premium_Due__c = D.Premium_Start_Date__c.addMonths(12) - 5;
        }                                                                 
     }

Here the code works fine and i got one problem. 

I am getting Due Date correctly for the 1st time and it is not working when the due date has paid, it should move on to the next month due date. please refere the image below.

User-added imageHere i need like If i choose (D.Premium_Type__c == 'Monthly') and start date is 01/02/2019.
The premium due will be : 24/02/2019 ( perfect till now)

when i paid my Due amount on or before 24/2/2019 in my "LIC_Payement_Gateways" and considering my "Paid_Date__c", the  due date should change to next month : 27/03/2019 and it should go on with Monthly, quarterly, half-yearly and yearly ( this is what i want to do )

Any one can help me in this ?

Thanks in advance.