Clearing the lookup field data, when i go for another field check box then comeback to this field

  • 1
  • Problem
  • Updated 3 years ago
  • Not a Problem
I have got 2 models Application and Contact , where Contact is a lookup
to application.On Application field editor having 2 fields 1 - New Borrower 2. Contact Reference

when i enter existing contact in contact reference lookup field , i am getting the contact details

after that when i click on new borrower check box, existing contact details are cleared and i am getting new contact fields
 
then again when i uncheck the new borrower check box, previous contact id showing in lookup contact reference field. can any one help on this, how to clear the previous contact id in look up field reference.  I need here without data when i uncheck the new borrower check box
Photo of raj

raj

  • 840 Points 500 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
You should be able to set a model action that updates the contact reference field to blank when the checkbox field is updated.
Photo of raj

raj

  • 840 Points 500 badge 2x thumb
we have given it as action type: Update a field on row, model application field contact__c, value=  ;

Still this field giving contact id
Photo of raj

raj

  • 840 Points 500 badge 2x thumb
we have given it as action type: Update a field on row, model application field contact__c, value=  ;

Still this field giving contact id
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
How about action type "remove all rows from model" then requery the model. This would erase everything in the model, which may not be what you want.
Photo of raj

raj

  • 840 Points 500 badge 2x thumb
thanks for ur help. its working fine. previous in that field i left it blank. now i am giving {{Blank}}. its working fine
Photo of raj

raj

  • 840 Points 500 badge 2x thumb
when i add for value={{blank}}, for those field its working fine. but when i check on new borrower check box, existing data coming for model. this happen cause of "value={{blank}}". 
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
I'm not exactly clear on the sequence of events here, but it sounds like you are entering data into the model then toggling the check box off and on and seeing that that unsaved data is still showing up. You may have luck if you "remove all rows from model" as part of your action sequence. Another idea would be to have separate pages for existing borrowers and new borrowers with a button at the top of each that would redirect to one another. So if you click "existing borrower" button it would redirect or open a pop up to your "existing borrower page" and if you click "New Borrower" it will redirect or open a pop up to your New Borrower page".