function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KKJaxBeachKKJaxBeach 

Need help with a field update formula

Ok, lets see if I can explain this one.

 

I have a custom object called "Customer Changes"  The first part of the form shows the existing account information - address, program type, etc.  This information is in formula fields that look to the account tab for the information.

 

The second part of the form is detailing the type of request you want to make to the account - new address, new program group, etc.  these are regular pick list fields.

 

The problem I am having is after the change is approved and the account is updated - it pulls that new information over in the formula fields so it now looks like the previous address is the same as the requested change to the new address.

 

Is there a way to limit the field updating to just when the record is created and then prevent it from updating again when the account information changes?

 

Thanks!

Pravesh RanaPravesh Rana

Hi, there are two ways to slove your problem..

 

1) Either use two address fields say "original_Address" and "New_Address" fields(you can use default address field).

and use Original_Address fields in Formula and during Creation of record and use "New_Address" while updating address.

 

2) Or Create workflow that execute on insertion of record and do all the modifications there that way if the address is updated you don't have to worry about any unwanted changes.

 

Hope that helps.

KKJaxBeachKKJaxBeach

I tried creating a workflow field update upon record creation, but it didn't bring the address over.  what is original_address?  I can use the formula fields I have right now as the original's, but I don't know how to prevent it from updating when changes are made to the account object.  Is there a way to limit the formula to just copy it over once and then stop?

Pravesh RanaPravesh Rana

Hi,

 

There is no standard functionality available for the type of functionality you want for FORMULA field.

 

I was thinking about having two separate address fields with the name of  for example : "Original Address" and "New address" and work with "Original address" in the FORMULA fields and store new address value in "New Address" field separately.

 

I think there can be one more solution try checking "Created Date" in the formula field because on the time of insert record either will have no "created date" or the last "Modified date" will be equal to "created date"  this way you can check if the record is inserted first time or not.

 

This will be some thing like this...

 

if(OR(object.createdDate == null, object.createdDate == object.LastModifiedDate), <apply your functionality>, false)