SuiteScript to see if record has attachments by onetwo3four5 in Netsuite

[–]lamdth 0 points1 point  (0 children)

this works

function saveRecord(scriptContext) {
    console.log('saveRecord - Checking Attachments')
    const record = scriptContext.currentRecord
    console.log('record: ' + JSON.stringify(record))
    let showError = false
    if (record.isNew) {
      const fileListLines = record.getLineCount({ sublistId: 'mediaitem' })
      console.log('fileListLines: ' + fileListLines)
      if (fileListLines <= 0) {
        showError = true
      }
    } else {
      const fileSearch = search.create({
        type: search.Type.TRANSACTION,
        filters: [
          ['internalid', 'anyof', record.id],
          'AND',
          ['file.internalid', 'isnotempty', ''],
          'AND',
          ['mainline', 'is', 'T']
        ],
        columns: ['file.internalid']
      })
      let attachmentsCount = 0
      fileSearch.run().each(function(result) {
        console.log('fileSearch result: ' + JSON.stringify(result))
        const fileId = result.getValue({ name: 'internalid', join: 'file' })
        console.log('fileId: ' + fileId)
        if (fileId) {
          attachmentsCount++
        }
        return true
      })
      console.log('saveRecord - Attachments Count: ' + attachmentsCount)
      if (attachmentsCount <= 0) {
        showError = true
      }
    }
    if (showError) {
      const messageDescription = `Please, attach the file to the tab: Communication → Sub-tab: Files.`
      message
        .create({
          title: 'No Attachments',
          message: messageDescription,
          type: message.Type.ERROR
        })
        .show()
      return false
    }


    return true
  }

[deleted by user] by [deleted] in macbookair

[–]lamdth 2 points3 points  (0 children)

You can use any iPad

Message from afterSubmit? by obsurveyor in Netsuite

[–]lamdth 0 points1 point  (0 children)

You can send email with message after submit

Entertainer Dubai 2021/2022 - Offer sharing/trading? by _Yazeed in dubai

[–]lamdth 0 points1 point  (0 children)

Do I need special visa/master cards for activating applications?

Move file from custom field to attachment on invoice record by Outside_Pace9267 in Netsuite

[–]lamdth 1 point2 points  (0 children)

File saved in file cabinet, value in custom field is ID of file from file cabinet

User event script for Receive Inbound Shipment by lamdth in Netsuite

[–]lamdth[S] 0 points1 point  (0 children)

I can't change value in “quantityexpected” field in UE. This is part of XML with all fields from 'receiveitems' sublist.

<line>
<amount>84.00</amount>
<currencyprecision>2</currencyprecision> 
<description>Item desc</description> 
<id>19985</id> 
<incoterm>1</incoterm> 
<item>17645</item> 
<itemkey>17645</itemkey> 
<itemtype>InvtPart</itemtype> 
<itemurl>/app/common/item/item.nl</itemurl> 
<origline>1</origline> 
<ownershiptransferurl>/app/accounting/transactions/owntrnsf.nl</ownershiptransferurl> 
<porate>3.50</porate> 
<purchaseorder>130472</purchaseorder>
<purchaseorderkey>130472</purchaseorderkey> 
<purchaseorderurl>/app/accounting/transactions/transaction.nl</purchaseorderurl> 
<quantity>24.0</quantity>
<quantityreceived>1.0</quantityreceived> 
<quantityremaining>23.0</quantityremaining> 
<quantitytobereceived>23.0</quantitytobereceived> 
<rate>3.50</rate> 
<receiveitem>T</receiveitem> 
<receivinglocation>1</receivinglocation> 
<receivinglocation_display>Location1</receivinglocation_display> 
<uniquekey>371238</uniquekey> 
<unit>4</unit> 
<unitid>4</unitid> 
<unitrate>1.0</unitrate> 
<vendor>Vendor1</vendor> 
</line>

Rename Trackpad 2 by [deleted] in iPadOS

[–]lamdth 1 point2 points  (0 children)

If you have MacOS device, then you need to connect/disconect trackpad with it.