Skip to main content
Solved

Prevent Custom Field Value from Updating

  • August 19, 2024
  • 5 replies
  • 76 views

Forum|alt.badge.img+12

We have a Custom Field in Rental Transaction that is pulling Group ID from Serial Object. As Serial Objects gets update it then recalculates and updates the Custom Field in Rental Transactions.

 

We want to know what the Serial Object Group ID was at the point the Rental Transaction is created NOT the current Group ID.

 

How do we prevent the Custom Field from Updating if Serial Object is changed?

 

Thanks in advance,

Lisa

Best answer by Marcel.Ausan

@lisa.gilesAB what you would need to do is as follows:

  • create a persisted CF
  • create a custom event + SQL action to fetch the group id from SN and write into the CF. You also need to define the triggering point of the event → insert on rental transactions table or something else that would fit your business scenario.

5 replies

  • Superhero (Employee)
  • 1487 replies
  • August 19, 2024

Could you make it a persistent field, that only allows insert perhaps?


Forum|alt.badge.img+12
  • Author
  • Sidekick (Customer)
  • 104 replies
  • August 19, 2024

Hi @anmise Thanks for responding.

 

Can I use Persistent Fields to pull the value at creation? Would I do this via a Custom Event? I cannot see an option to create a Persistent Field that pulls a value using SQL?

 

Thanks, 


Marcel.Ausan
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 1298 replies
  • Answer
  • August 19, 2024

@lisa.gilesAB what you would need to do is as follows:

  • create a persisted CF
  • create a custom event + SQL action to fetch the group id from SN and write into the CF. You also need to define the triggering point of the event → insert on rental transactions table or something else that would fit your business scenario.

Forum|alt.badge.img+12
  • Author
  • Sidekick (Customer)
  • 104 replies
  • August 19, 2024

@Marcel.Ausan Thank you so much for responding! That makes perfect sense! I will give it a go and see how I get on :-)

 

Thanks, Lisa


  • Superhero (Employee)
  • 1487 replies
  • August 19, 2024

Hi @anmise Thanks for responding.

 

Can I use Persistent Fields to pull the value at creation? Would I do this via a Custom Event? I cannot see an option to create a Persistent Field that pulls a value using SQL?

 

Thanks, 

I see that @Marcel.Ausan already came to the rescue, but yes, a custom event was what I was thinking. Just need to avoid triggering and inserting on the same table, to avoid mutation errors, but you could possibly trigger based on event history or something.