Automatic selection of record from linked table
I have a table called Sales invoices and this is linked to nominal ledger table. This allows me to select the relevant account for the sales transaction. However I'd like this to default to the sales account for every transaction as it will never change. Can anyone tell me if this is possible? I know I can use constraint so that the only acount visible is "sales" but I want to remove the step of actually selecting the account.
Thanks Noel
4 replies
-
Noel, If I understand correctly, you can use this...
Sales := 1
in "Trigger on create" in the nominal ledger table. This automatically selects the first and, I'm assuming, only record of the Sales table.
-
Noel,
Assuming your data model looks something like
And let us assume you have an Account Ledger that looks something like
Then within your Sales Invoice Trigger On Create ... put something like the following:
Now when you create a Sales Inovice row.. it will default to the Sales account..
-
Tanks guys - I'll give this a try
-
Thanks Mconneen - I tried this and it worked (after quite a lot of experimentation)
Here's the syntax I arrived at that worked for me:
let t := this;
t.('Nominal Ledger' := first((select 'Nominal Ledger')[Name = "Sales"]))For some reason when it creates the new document it selects the date picker which isn't a show stopper
Content aside
- 5 yrs agoLast active
- 4Replies
- 1683Views