This topic contains 7 replies, has 0 voices, and was last updated by michoel 9 years ago.

  • Author
    Posts
  • #2114

    Stuart Barnaby

    Hi Guys,

    Can anyone tell me how to get item.itemId for a line item in BFO?

    The only way I can get the itemid for each item is by using {item.item?split(‘ ‘)[0]} (see below for example).

    ${item.item?split(‘ ‘)[0]} ${item.description} ${item.rate} ${item.quantity} ${item.amount}

    Can you let me know if there is a better way to get the itemId of a line item?

    Kind regards,

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

  • #2115

    blarson@MesaLabs.com

    Short of turning off displayname, we were only able to find one solution: create a custom transaction column field that sources from Item->Name, and use that value in your template.

  • #2116

    ALAGARSAMY

    Hello Stuart,

    To get the field values from the item you can use something like {item.item.itemid}.

    item – sub-list in the transaction.

    item – from item record.

    itemid – internalid of the itemid field in item master.

    Hope it will help…

  • #2117

    sney

    I couldn’t get this working either. To get data from another field on the item’s record, I had to use custom Transaction Column Fields. Set the field to source from the item’s record, don’t store the value, and when adding it to your form make sure the Label is completely blank which will hide it but leave it open to scripting.

    Once this is done, you can refer to it like any field already visible on your form. For example if your custom field’s ID was custcolitemid, inside the item #list you can just refer to it using ${item.custcolitemid}.

    The limitation is that in a sublist you can only refer to fields on the form itself – even though it’s linked to that item record you can’t take advantage of that link. This is unlike some body fields from which you can link through to the related record (e.g. you could get the Customer’s email address, even if it’s not on the transaction form itself).

    Btw I’m assuming by ‘item id’ you mean NetSuite’s internal ID for the item record. For item Name I just used ${item.item}, but to get the display name and internal id I had to use the above method.

  • #2118

    michoel

    To get the field values from the item you can use something like {item.item.itemid}.

    ALAGARSAMY – I’ve found this only works correctly to source the first line item in a sublist, but will output the same thing for each subsequent line.

  • #2119

    ALAGARSAMY

    michoel

    Find the Below Reference which is mentioned in NetSuite Document “SuiteBuilder”. I have tried the same, it is not working for me as well.. You can register a case, if it is not working for you.

    Syntax for Fields from Joined Records:

    You can modify advanced templates in the template editor to include fields from records

    directly joined to the current transaction.

    • For example, if you are editing a sales order template, you can add fields from records

    directly joined to sales order, such as items. Supported syntax is ${record..}.

    • To include Sales Description field values from related item records in a sales order

    template, use the syntax: ${record.item.salesdescription}.

  • #2120

    Nelliott

    I’m not in a position to test this right now but if you’re looping through items it certainly used to be {item.item} to retrieve the id, no need to add .internalid / .id or any other shenanigans.

    {item.item.text} should return the user friendly name of the item.

    this does somewhat assume you are looping through and defining the item, in example:

    Code:

    ${item.item@label} ${item.quantity@label} ${item.description@label} ${item.amount@label}
    ${item.item.text} ${item.quantity} ${item.description} ${item.amount}

    It may have changed to {item.item.itemid} but if that is the case then the loop above should still work and not pull back the same itemid repeatedly.

    Sorry, a lot of “should could would” in this reply!

    Neil

  • #2121

    michoel

    Nelliott –

    {item.item} will print either just the Item Name/Number (‘itemid’) or the Display Name/Code (‘display name’) as well, depending on the account setting for ‘SHOW DISPLAY NAME WITH ITEM CODES’ (in Setup -> Company -> General Preferences). The problem comes up if you want to have this enabled in general but not on printed forms.

    Here is some example code to show the issue – it will print out the UPC code for the first item each time.

    PHP Code:

     
        
            ${item.item} – ${item.item.upccode}
        
     

    Sure, expected behaviour would definitely be to either to source each line correctly or to not source at all.. I went through all this with PS during implementation and the only way I could get it to work is to have the field sourced in the Transaction.

You must be logged in to reply to this topic.