This topic contains 2 replies, has 0 voices, and was last updated by tect22 7 years, 11 months ago.

  • Author
    Posts
  • #5663

    ryan.austria

    I have a script for Vendor Payment and I want to fet the value (‘tranid’) of Vendor BIll and apply it to Vendor Payment printout. I tried so many times but I got a result of null or undefined.

    Code:

    Code:
    var apply = record.getLineItemCount(‘apply’);

    for (var x=1; x‘;
    layout += ‘

    ‘+iE(date)+’

    ‘;
    layout += ‘

    ‘+type+’#’+iE(refnum)+’

    ‘;
    layout += ‘

    ‘+memo+’

    ‘;
    layout += ‘

    ‘+addCommas(amount)+’

    ‘;
    layout += ‘

    ‘;

    }
    This is a cached copy. Click here to see the original post.

  • #5664

    Chuan Zhuo

    View source HTNL code of NS vendorpayment page,

    you might found the correct column internalid there.

  • #5665

    tect22

    Hi Ryan,

    I’m assuming you want to show the memo of the Bill, your Bill Payment is applying. Try this code.

    Code:
    var apply = record.getLineItemCount(‘apply’);

    for (var x=1; x<=apply; x++){
    if(record.getLineItemValue('apply','apply',x)=='T' ){
    var date = record.getLineItemValue('apply','applydate',x);
    var type = record.getLineItemValue('apply','type',x);
    var amount = record.getLineItemValue('apply','due',x);
    var id= record.getLineItemValue('apply','internalid',x);
    var refnum= record.getLineItemValue('apply','refnum',x);
    var memo = nlapiLookupField('vendorbill',id,'memo');
    layout += '

    ‘; layout += ‘ ‘+iE(date)+’

    ‘; layout += ‘

    ‘+type+’#’+iE(refnum)+’

    ‘; layout += ‘

    ‘+memo+’

    ‘; layout += ‘

    ‘+addCommas(amount)+’

    ‘; layout += ‘

    ‘; } }

You must be logged in to reply to this topic.