Old vs New Value for Deleted Lookup Values

Old vs New Value for Deleted Lookup Values

Suppose the following scenario, where a value in a lookup is deleted:
1. User has countries form
2. Form A has a lookup to countries form
3. User selects Italy in Form A and saves it with the Italy ID
4. Form A report shows Italy
5. Italy is inadvertently deleted from countries form
6. Form A report will now display blank or empty country column b/c there's no lookup value
7. User discovers Italy was deleted and re-adds it to the countries form, generating a new ID
8. User re-selects Italy in Form A

If I attempt to retrieve the old value using getFieldValue(), it returns the new ID, even though the lookup field is initially empty onEdit.

I thought getFieldValue() would've returned null or empty?

Here's my code, which returns an empty list for this scenario. Any other change scenario works fine.

// Check if form is dirty
for each  field in auditedFields
{
// Get old and new values for comparison
oldValue = currentRecord.getFieldValue(field);
newValue = getFieldValue(field);
if(oldValue != newValue)
{
changes.add(field);
}
}

      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

                            Writer is a powerful online word processor, designed for collaborative work.

                              Zoho CRM コンテンツ



                                ご検討中の方