Entity Screen - New Customer - Adding a button next to the 'Name' field

Hello there,

When adding a new customer (actually a company) in the ‘Search Customer’ entity screen, I’d like to easily add a button next to the ‘Name’ field, like in the picture:

The goal is to call an API with the RUC number as parameter, get the data of the company, like Exact name, address and fill the custom fields with these data.

This is mainly a way to avoid typo errors when entering the company RUC’s number.

Is it possible?

Thanks

Now it’s not possible. But I don’t understand what you mean in RUC ?

It’s just a unique number identifying a company in Peru.
That number is used for electronic billing, so it’s important there are no typo mistake when the waiter enters a new company in SambaPOS.

Without the button.

I try to use the rule Entity Updated and do my stuff, but Entity Updated is fired when I change the entity of the ticket. E.g. on the ticket, the entity is Company A and I select Company B, it fires the rule.

So I am a bit confuse with:

  • Entity Updated I thought that it would be fired when DATA of one Entity is updated (corrected, created), but the ticket still have the same entity (just with corrected data).
  • Ticket Entity Changed ??

It looks like that Entity Updated behaves like Ticket Entity Changed works

You can’t add a button like your example, but you can call a script and then have that script return multiple values which can then be mapped to the relevant fields on the entity.

This is how the UK Postcode lookup current works - you can add it via Configuration Tasks. Test out and then you can follow the same way to implement into your system (to use the postcode lookup you’ll need a Google Maps API key which is free to use up to certain high limits, but you could even just modify the script to return dummy data for a proof of concept)

(It takes the contents of the postcode field and passes it to the script, which then calls Google Maps API to get the street name, city, county and returns those values which are then mapped to other fields in the entity custom data.)