Home Ask Login Register

Developers Planet

Your answer is one click away!

ianbailey February 2016

Dynamic disclaimer on transaction form html/pdf

I'm having some issues with making the disclaimer (or message!) on the transaction forms dynamic. I basically need it to show a different message based on the state of the shipping address (which is an issue in itself).

I'm having a tough time with any examples or docs. I'm either looking in the wrong place, or just not understanding it. They are currently using the legacy basic forms, which probably doesn't help.

These are the options.. I think:

1) I need to write a script to parse the shipping address as retrieved by an API call, then I figure I could use the setFieldValue to set the value of the disclaimer? Or set it to a custom field and display that?

2) Use an Advanced HTML/PDF form and do a hardcoded if statement.. maybe? tbh I'm not even sure how I can get the state, as all the address fields I have seem to be just 'Address'.

Unless I'm barking up the wrong tree and it's much simpler than that altogether. I've kinda been chucked in the deep end, having had no NS experience before!

If anyone has an examples, that'd be swell.

Thanks in advance!


Lez Yeoh February 2016

I think both your options are spot on. If I had to do this, I would probably do point 2, only because I like the HTML option and flexibility of Advanced HTML/PDF. To get the state, you can can use: ${record.billaddress} or ${record.shipaddress} as part of your if statement and then put the html of your disclaimer.

Another option if point 1 and 2 doesn't float your boat, is to create separate forms with different disclaimers on each of the forms...although this seems like a lot of rework.

Just some options. Good luck!

Rusty Shackles February 2016

Does the disclaimer have to appear when the User is creating the transaction?

If you need it in the UI, then you will need to use option 1.

If you just want the disclaimer to show on the PDF, then option 2 like Lez Yeoh said is the best.

Post Status

Asked in February 2016
Viewed 1,988 times
Voted 7
Answered 2 times


Leave an answer

Quote of the day: live life