Hi Benji,
Upon first review of your post, my first idea would be to use an event on the Purchase Header table depending on how the Dimension Valuis determined.
But you may not need even that. Did you know that you can assign a Dimension Value to your vendors on the Vendor Card? If the Dimension 1 value is different per vendor (or group of vendors), then ypu could put it there.
Otherwise, these events on the Vendor table come to mind:
OnAfterInsertRecord
Vendor."No" - OnAfterValidate
Vendor Posting Group - OnAfterValidate
All these can be used with a web service call, too - again, it depends on how you want to integrate your external system. Some users choose a batch import of some type (numerous options here too).
I hope this gives you some ideas.
------------------------------
Ron Saritzky
Generate Life Sciences
Los Angeles CA
------------------------------
Original Message:
Sent: Feb 07, 2021 03:30 PM
From: Benji Jasik
Subject: design pattern help - create a purchase order with dimension value 1 pre-filled in from another system
Hi,
I'm trying to make creating a purchase order for our users easier and want to be able to create PO from another system with the Dimension 1 shortcut we have setup pre-filled
Ideally I'd like to create a page that I'd like to like this
https://MyIntstance/Live/?page=50&dc=0&mode=create&company=12345&Dimension1=abc
What I'm trying to figure out is
- Do I need a custom page to do this or ist there a way with AL that I can intercept the current page creation and default the shortcut dimension 1 value and if so what events do I need to override?
- If I need a custom page, can the custom page create a temp record with this set and redirect to it?
- do I need the external system to create a record via web services and set the dimension value and then redirct to open the record in edit mode?
Business Central 17 wave 2 on premise (azure cloud hosted) is what I'm working with.
Thank you
------------------------------
Benji Jasik
Generate Capital
------------------------------