This topic contains 6 replies, has 0 voices, and was last updated by tect22 8 years, 2 months ago.
-
AuthorPosts
-
July 26, 2016 at 8:19 pm #6283
ryan.austriaHello there,
Good day!
I have a problem, and I don’t know yet how to solve this problem. I have a script for Vendor payment and I want to get the value (‘transactionnumber’) of Vendor Bill and apply it to Vendor payment (printout).
Please see sample transaction below :
1. Vendor Payment
2. Vendor Bill
3. Vendor Payment Printout
Thank you so much.
This is a cached copy. Click here to see the original post. -
July 26, 2016 at 8:40 pm #6284
michoelCan be done, but the potential issue here is that there is not a one-to-one relationship between the Bill Payment and Bills. How do you want to handle this in the case that a Bill Payment is for multiple Bills?
-
July 26, 2016 at 9:11 pm #6285
ryan.austriaHello there, thank you for response.
For multiple bills in a single bill payment the transaction number (PV NO) will be indicated in printout separated by commas.
-
July 26, 2016 at 10:26 pm #6286
michoelI would suggest you create a new Custom Transaction Body Field in the Bill Payment to store the transaction numbers.
You can get your script to populate this, and then it should be available on the printout.
-
July 26, 2016 at 10:43 pm #6287
k_duncmichoel is spot on. Given that there could be a many-to-one relationship between Bills and one Bill Payment, you’d need to write some code to handle this. I’d suggest something like a User Event Script to execute on After Submit perhaps. In the code, you’d want to do something like:Get a line count of the number of ‘apply’ sublist line items. E.g.: var lineCount = nlapiGetLineItemCount(‘apply’);
Next, create a for-loop that iterates through this sublist and grabs each line’s transaction number. Just remember that sublists begin at line 1, so it will need to be something like:Code:
for (var sublistLine = 1; sublistLine <= lineCount; sublistLine++)
{
var tranID = nlapiGetLineItemValue('apply','internalid', subListLine);
bills = bills + ', ' + tranID;
}
Now I haven't tested any of that, but I think that will be the general idea. You'd probably also want to ensure 'bills' is not null before adding the comma and space as that will be the first thing you see when you then ultimately store the 'bills' value in your Custom Transaction Field that you want to pull into your Voucher.Hope something like that gets you on the right track.
-
July 26, 2016 at 10:50 pm #6288
k_duncActually, I’ve just come across this answer. This should help you get it done properly: https://netsuite.custhelp.com/app/an…bill%20payment
-
August 31, 2016 at 2:43 am #6289
tect22Hi Ryan,
As k_dunc indicated, there could be a many-to-one relationship, you may make a search for this vendorpayment records, with columns Applied To Transaction : Transaction Number, so that you could get the connected transactions to this vendorpayment. But keep in mind, that it may result many records connected to the vendorpayment and might “overflow” your allotted field on your PDF layout.
Hope this helps.
-
AuthorPosts
You must be logged in to reply to this topic.