First, since this is my first post - I’m in love with the Corteza framework - very robust, customizable, and easy to use too.
I want to autofill some fields on the “Jobs” module I created - the person selects an “Account” and is it possible to autofill the address and other fields on “Jobs” with the data on the “Account” based on the selected “Account”?
Edit: Is it easier to make an automation to transfer the “Account” to a “Job” and copy the info to the “Job” while maintaining the selector field to link to the “Account”?
Thank you in advance for your time and attention,
Jorge Matias
So, if I understand correctly you want to autofill other fields based on an account selected? We don’t have a trigger for that particular UI interaction. However, you could put a button on the screen that triggers a workflow. For example, the button could have the label “Prefill address based on selected account”.
That workflow would have the following steps:
A manual trigger with the record as a source
A expression block to get the ID of the selected account
A function block to do a lookup for that account
An expression block to write the values you want to map from the account into the job
A function block to save the record
A prompt to redirect the user to the record page again, in edit mode (or maybe a prompt to refresh values on the screen - that might work as well).
I believe many users are eager to have an UI triggers like (“on page load”, on “on element focus” ). It would resolve numerous situations.
Currently, many of us either create a manual button or inject a JavaScript script and make an API call to execute the workflow, using a trick suggested by @Shmuel here: Corredor client script on page-load
Could you please consider adding this feature? It would greatly simplify our lives.
I would suggest you to map the data into the new record. So yes, it’s a copy of tye data. But, it’s a copy of that moment in time. So, it won’t change if the account data changes.
Let’s say you have an account with an address in Zaragoza. A job is created and the address is mapped to Zaragoza.
Now, a year later, the account’s address has changed to Madrid. Do you want the address on the job be updated to Madrid or should it stay as Zaragoza? I would suggest that it stays as Zaragoza, because that might be related to the description of the job. That description could me: “Diseña un cartel para las fiestas del Pilar”.
However, if you want to show Madrid, than you could just have another “record selector” type field. You could have multiple of those fields linking to the same module in one module, and you would only need to map the ID in each of them (except for the main one that is automatically filled when a child record is created from a main record).