+ Start a Discussion
sfdc.dev.ax856sfdc.dev.ax856 

Help on Lookup filters

Hi,

 

When user edits an old record with an invalid value because of the filter (the value was valid before), if user does not change the lookup field value, the record should be saved. ie, the lookup filter should only apply on creating new record (isnew), or editing the lookup field in an existing record (ischanged), it should not apply when user edits other fields in an existing record(not(ischanged()).

Here is the scenario:
I have purchase items which user can select to add to a purchase requisition record, and I have a lookup filter so user can only select "active" items(if the price changed for an item, the old item will be marked inactive and new record will be created).

The issue is if user edits an old purchase requisition record which has an inactive item, they cannot save because the item is inactive (but it was active at the time of purchase), and they are not changing the item during the editing.

 

Can you please provide alternative for this.

Ispita_NavatarIspita_Navatar

I would like to know the following before I suggest a solution:-

Are you using the standard functionality? If yes, then please do share the object name and the  also add some detail about the functionality you want to achieve.

Also it seems you need to use a custom field for the  for the active/ inactive functionality (if you are using standard functionality) and in the validation rule you need to handle the scenarios accordingly.

 

Hope this helps.