Hello all, I need to find a way to get the Interna...
# suitescript
b
Hello all, I need to find a way to get the Internal id of the Print Template used from the current Custom Transaction Form. Via the current Custom Transaction Form, let’s take the invoice as an example, I can get the Internal id from the Custom Transaction Form. But the thing now is, how can I get the internal id from the Print template field via script?
message has been deleted
n
On the custom transaction form that field is "advformlayout". If you open teh console and do nlapiGetFieldValue("advformlayout"); you will see the print form id. The underlying recordtype seems to be "custform". I tried doing a lookup on the advformlayout using the transaction form id and that field but the record type was not recognised. To further confuse the issue I can load the custform record using the id but when I do that the advformlayout field is not mentioned. So I'm afraid I'm not convinced you can get at it but at the same time I feel like you should be able to and maybe I'm missing something. Hopefully you can take this further
This is what I used in debugger to establish what I mentioned above, The show id's pref revealed the field id and apart form the url of the form, if you add &xml=T to the form url you can see the underlying fields. Good luck.
b
@NElliott yes, the first thing what I’ve tried was to use the XML=t url parameter to check the underlying data. Thereafter I tried to get the XML contents to use the URL via a https.get but I couldn’t managed to make it work since I kept receiving the http response from NS that I needed to login.
Otherwise I would be fairly simple to get the needed data.
n
you were trying to use https.get to retrieve a form?
I suspect the value is dynamically populated in the UI and that's why it's not available when you load the record directly. If that is the case you're stuck. unless you build out a table and reference that and store the print template id on a custom field on the transaction. Would be do-able but not exactly a fun experience maintaining the table, particularly as it seems searches do not expose that detail.
b
Yep, that’s what I was afraid of. Bummer
r
Hello @NElliott or @Budy Sutjijati just wondering if you ever discovered a way of doing this?
n
No mate that was the end of my interest in the issue, bigger fish to fry I'm afraid. 🙂