penone
penone

Reputation: 792

Task field that links to the originating transaction

I have a custom task form that has a field which displays the transaction id (in this case a sales order)for the record the task was created in.

I would like to have this field be a hyperlink to that specific transaction but am lost on how to do this.

Is this possible?

Upvotes: 1

Views: 577

Answers (2)

bknights
bknights

Reputation: 15462

In view mode on the task any records linked under the 'related records' tab are links to the respective record. This is automatic.

If you want on the main section you can add one with a user event script possibly coupled with a client event script.

In the Before Load user event script detect that a transaction is assigned and create a new field of type URL and use the N/url module to derive the url of the transaction.

If the user who needs the link is allowed to change the linked transaction then you could also add a client script that uses a fieldChanged event to update the value of the custom field added in the User Event script.

If you need the client script and want to eliminated duplicate code then you could set the value of the url custom field in the pageInit event of the client script (i.e. both the pageInit and fieldChanged events could use the same url resolution code.

Upvotes: 1

zerecees
zerecees

Reputation: 699

The field must be of type List/Record pointing to a Transaction list, or an HTML type set using an <a href="url"> attribute.

I would advise against hard-coding links in the system though, and try to use the List/Record field type first.

Hope that helps! If not, feel free to comment back and I'll see what other help I can provide. If possible, please provide screenshots.

Upvotes: 0

Related Questions