headintheclouddev / typings-suitescript-2.0

TypeScript typings for SuiteScript version 2.0
MIT License
145 stars 92 forks source link

resolveRecord for a new netsuite record #258

Open Lekkimone92 opened 12 months ago

Lekkimone92 commented 12 months ago

Could not add a link to a new record because recordId param is required. This pull request fixes the issue

MrRob commented 12 months ago

@Lekkimone92 I appreciate you addressing this! Although resovling a URL to a new record is a common need, we had left this as it was because NetSuite's documentation says that the recordId parameter is required. The way to deal with it is to just set recordId to null for new records.

That being said, I do recognize that it is pretty annoying to have to do that. I don't think there is much danger in omitting the recordId parameter, I doubt they will ever enforce that it is required. But for the commit here, instead of doing a whole new interface, can you just add a ? to make the recordId optional in the resolveRecordOptions interface?

Thanks!