Get company from a ticket in a macro triggered in the view ticket

I have a script that you trigger in an extra menu on view ticket, that creates a sale from the ticket and links the ticket to that sale. This works as expected. What I like to do is link that sale to a contact based on the contact on the ticket, but neither contact or company id is tet when trigering a macro from the slae screen, and it does not seems like it is possible to get the company or contact id from the loaded request either. :(

Has anyone managed to do this?

RE: Get company from a ticket in a macro triggered in the view ticket

You need to load multiple entities. So try this:

Load ticket -> Load contact -> Load Company -> Create Sale

Load the appropriate ID from the previous stage in each step.

Av: Patrik Larsson 9. des 2019

RE: Get company from a ticket in a macro triggered in the view ticket

Thank you. That solves it :)

Av: Lars-Erik Holtane Bergland 10. des 2019