随笔 Carl Notes

IT科技 技术解决方案 NetSuite ERP

netsuite弹出窗体的数据回传例子这样如果顺利,你就能很多开发出一个 弹出的窗体(实现特殊的货品列表),回传单个或多项的货品会销售或采购订单。------------------------------------User Event suitescript beforeloadform.getSubList('item').addButton('custpage_name_print', '...
阅读全文 »

刚发现一个未公布的对象,拿purchaseorder举例,就是Receipts & Bills这个subtab有于当前业务单据,所有相关联的流程数据。对于系统流程的断定很有帮助。我们在nlapiLoadRecord的返回中可以找到这样对象[undefined, [undefined total=380.00 type=Bill linktype=Order Bill/Invoice]] ;id,l...
阅读全文 »

&xml=T https://system.netsuite.com/app/accounting/transactions/transaction.nl?id=3179&e=T use &xml=T below to display xml 用于排除故障用的测试地址, 把xml输出 既可查询一些数值情况,优先于UI的动作。 zeng.cz 20090421 1508
阅读全文 »

背景与展望: 比如:公司要上市往往会要求提供过去几年的营业数据和报表等信息, 而这些信息来源于正在一直运营使用的ERP和财务系统是最可靠与真实的。 NetSuite实现的ERP和财务系统的完美结合,随着多年的经营积累和业务流程升级, NetSuite系统会不断改造和适应新的企业流程和应用。 其中免不
阅读全文 »

在system的 Enhancement Voting > Search Results > Enhancement Voting 中,我们能看到Netsuite是如何实现一个系统的评论功能,个人分析如下: 1.在Netsuite总账户中,主站点的'标签'中建立New Release Info 和 Enhancement Voting的标签,配置相应的权限,2.建立记录类型,大致字段内容如下:...
阅读全文 »

我们知道 netsuite的url构造https://system.netsuite.com/app/accounting/transactions/opprtnty.nl?whence=都是有规律的! 这些nl 您传递什么参数给他, 它肯定就要要什么规律来执行了今天发现了一个新的内置参数:selectedtab例如:selectedtab=accessselectedtab=history在ur...
阅读全文 »

Quick TECHNICAL Note

Reality: UPS only support WebServices integration(or window platform exe application: FedEx Ship Manager® Lite), friendly for JAVA, PHP or C#.

We need to calling UPS SOAP services in NetSuite directly, so there is JSON -> XML for input expected XML parameters and parse API return result XML -> JSON action. 

Different from UPS, There is high request for xml’s element order/sequence for FedEx API.

This’s a re-usable framework for intergration with WebServices platform/application.

Registration for the Developer Keys

We will need registration on webside got

Developer Test Key: PFPtfQE9ME1N****
Required for FedEx Web Services for Intra Country Shipping in US and Global

and the Email Box:

Title: Your Developer Test Key Registration is complete

Test Account Information
<spacer.gif>
Test URL: https://wsbeta.fedex.com:443/web-services
Test Password: H6F4kyFrYIQxALXOTbH53****

FedEx Web Services Testing Information:
FedEx Shipping Account Number: **0088000
FedEx Meter Number: ***2012**

On NetSuite Side we are targeting to achieve xml files like the sample:

Example 1:Rate Request

<SOAP-ENV:Envelope xmlns:SOAP-ENV=”http://schemas.xmlsoap.org/soap/envelope/“ xmlns:SOAP-
ENC=”http://schemas.xmlsoap.org/soap/encoding/“ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance“ xmlns:xsd=”http://www.w3.org/2001/XMLSchema“ xmlns=”http://fedex.com/ws/rate/v28">
SOAP-ENV:Body



XXXXXX
XXXXXX


XXXXXX
XXXXXX



XXXXXX
XXXXXX


RateRequest_v28


crs
28
0
0


2020-02-25T12:34:56-06:00
REGULAR_PICKUP
PRIORITY_OVERNIGHT
FEDEX_BOX

LB 20.0 XXXXXX FedEx-WAPI XXXXXX
SN2000 Test Meter 8 10 Fedex Parkway AUSTIN TX XXXXXX US
XXXXXX Recipient Contact XXXXXX
Recipient Address Line 1 Recipient Address Line 2 Collierville TN XXXXXX US
SENDER XXXXXX BUSINESS\_STATE 123456 LIST 1 1 1 1 LB 20.0 12 12 12 IN XXXXXX XXXXXX 12 ContentDescription

And all above xml element is dynamically transfered from NetSuite Sales Order data(and also data from location, currency, custom record types, settings), We got those data(in expected order), using the Google Project’s X2JS to convert from JSON to XML.

Next resolve the across domain ajax call by using NetSuite 2.0 API https.post

var response = https.post({
url: ‘https://wsbeta.fedex.com:443/web-services‘,
body: new X2JS().json2xml_str(PostDataObj),
headers: {
“Accept”: “image/gif, image/jpeg, image/pjpeg, text/plain, text/html, */*“,
“Content-Type”: “text/xml”,
“Access-Control-Allow-Origin”: ‘*‘,
}
});

Need to thanks this thread for useful notes: https://stackoverflow.com/questions/62523251/creating-a-http-post-call-for-fedex-web-services  

FedEx Webservices Errors

  • Response Code 400 or 500

    • Accross domain Error
    • Schema Error

     

  • UnrecoverableClientError
    SchemaError
    validation failure for RateRequest Error:cvc-complex-type.2.4.a: Invalid content was found starting with element

    • Check the XML object sent to FedEx, the order of the element MUST match to the WDSL schema
    • Check the XML object elements if there is addtional property
  • FedEx 404 Unrecoverable ClientError

Share tools used between XML and JSON

Estimate Rate

Integrate with existing UPS integration

While end-use switching shipping carries, we need to clean up the backend package list data and rebuild for current shipping carrier, since UPS and FedEx are using DIFFERENT formating and propertys.


NetSuite’s javascript engine is Rhino(I.e. Rhino 1.7), we can not run node-based code on NetSuite, however,

write your code as, say, an npm module, and run npm scripts from the command line. I have done this in the past for unit testing, doc generation, eslint, etc. In order to actually run code in NetSuite, though, it must be in a plain .js file that NetSuite can interpret and load as a Library on your Script record.

Node.js in SuiteCommerce

downloading Node.js to use for SuiteCommerce.

How can I use Node.js in Netsuite?

20231008 Server端没有开启解释器,没配置环境,就无法识别原生的Node.js代码


Install WebStorm 2020.1 to Mac

2021-11 Notes

  1. The latest version of SuiteCloud IDE plugin from NetSuite is incompatible with WebStorm 2021 or Intellij IDEA; the key to resolve this is: using the old version’s plugin. copy the plugin file(com.netsuite.ide.webstorm) to editor’s plugins folder. Steps:
  2. unzip file com.netsuite.ide.webstorm.app-2020.2.0.zip, got a file call: com.netsuite.ide.webstorm
  3. Copy this com.netsuite.ide.webstorm to plugins folder on Mac: /Users/{username}/Library/Application Support/JetBrains/WebStorm2020.1/plugins
    1. There are all other versions of WebStorm under JetBrains folder. I.e. IntelliJIdea2020.1, WebStorm2020.1 etc…
    2. Make sure copy the plugin file com.netsuite.ide.webstorm to the plugins folder, restart your IDE, the NetSuite menu and feature is available.
  4. Please note: these are only for research, don’t use for other purpose.

 


1. Download the old version 2020.1 in https://www.jetbrains.com/idea/download

2. Purchase the license or Download https://www.macfz.com/a/Jetbrainscrack.html or https://www.lanzoux.com/iGI7kfzyy6j

  • Sample: 
  • Finally got a jetbrains-agent.zip

    本Agent仅供学习研究之用,请勿用于商业用途!
    商业用途请联系Jetbrains购买正版,请支持正版!

    2. https://www.macfz.com/a/agent.html

    3. 开始激活

    1. 以下以 「IDEAIntelliJ IDEA」为例,JetBrains 系列安装激活方法都是一样的。
    2. 运行你的 IDE,进行基本的配置后会弹出激活窗口,选择Evaluate for free,然后点击Evaluate按钮。(如果试用过期请点击「OK」或者「Enter Key」)
    3. 点击后会关闭试用窗口并出现「项目创建管理窗口」(也就是「Welcome to IDEAIntelliJ IDEA」窗口),先不要动。(如果你之前创建过项目可能会直接进入项目,把项目关掉就会出现啦)
    4. 将安装包内的「破解补丁」文件夹下面的 jetbrains-agent.zip 拖拽到你喜欢的位置(此文件你拖到你喜欢的位置后未来不能删除!)
    5. 将 jetbrains-agent.zip 拖拽到「项目创建管理窗口」中,然后点击 Restart 按钮重新启动。
    6. 重新启动后出现「JetbrainsAgent 配置助手」窗口,在安装参数处复制粘贴下面的安装参数,然后点击为 IDEAIntelliJ IDEA 安装,最后点击 是,会重新启动。
    7. 重新启动后点击菜单栏的「IDEAIntelliJ IDEA」,再点击「Preferences…」打开软件的偏好设置,左上角的搜索框处输入「update」,取消勾选右侧的「Automatically check updates」,然后点击「OK」(为了不必要的麻烦,请务必操作!)

    安装参数

    1
    Qr7EpuKzNtnTuEmGcLg/YnYyVEcnvR4iflCYTHc6dwuB8Jbx7e6E43CPRA+KjL2O/D/C+hj/rDFrwCNgGAvLcJd3bcaJ8UTMh8FPxd2EfjDt0eopoRIRQKtw8Ua3hlm2i+GvhYnaJ5/F1XN7H/8uEtYqFQlJc9auMxAL3gdnsmY

    写在最后

    此方法来自于:zhile.io 小麦在这里要感谢大佬们的辛苦开发。

    后要申明的是:

Install NetSuite SuiteCloud plug-in to WebStorm

3. Download SuiteCloud IDE http://system.netsuite.com/download/suitecloud-sdk/ideplugin/webstorm/20.2/com.netsuite.ide.webstorm.app-2020.2.0.zip

  1. This link is not available anymore, I can provide this version’s file persently, for research only.

4. Open WebStorm and create(or open) a project. Drag and Drop com.netsuite.ide.webstorm.app-2020.2.0.zip to WebStorm to manual install the plug-in.


1. Install SuiteCloud IDE(Eclipse + Plugin)

1.1 https://www.eclipse.org/downloads/packages/release/mars/2/eclipse-ide-java-ee-developers.
1.2 Updating Eclipse for Use with SuiteCloud IDE
1.3 Enable NS Features, SDF,
Setup > Company > Enable Features > SuiteCloud > SUITECLOUD DEVELOPMENT FRAMEWORK

2. Create SuiteCloud IDE, Project

File > New > SuiteCloud Project,
Account Customization
Project Name

3. NETSUITE UI, Assign Current Employee Record with “SDF Developer - 2FA Off” role

Create an custom role, make sure the 2FA is off(mandatory uncheck and ‘Not required’) in: Setup > Users/Roles > Two-Factor Authentication Roles

4. Configure SuiteCloud IDE to connect with NS (One-Time Setup)

NetSuite
Manage Account
Add Account(s)
Setup > Company > Company Information
Issue Token (Token has been issued)

5. Eclipse, Right click, NetSuite > Change Project Setting.

6. Eclipse, NetSuite > Import Bundle Components

List Bundles

Select which Bundle to download

7. How to use suitecloud for deployment?

Please reference to https://www.cnblogs.com/backuper/p/sdf\_cli\_for\_node\_js.html How to use NetSuite SDF CLI, CLI for Node.js on Mac, suitecloud command


//传入一个table的id,将table的全部内容导出excel文件function AutomateExcel(objTable){// Start Excel and get Application object.var oXL = new ActiveXObject("Excel.Application");// Get a new workbook.var oWB = oXL.Workb...
阅读全文 »

NETSUITE ERROR: Invalid department reference key 24 处理办法: 分析原因,1,这个24的internalid for Field department 是肯定有的,而系统却给出了出错提示, 说明系统在做类似下拉菜单选中department为24的部门的时候 出现了无法选择的项 , 所以系统认为这个下拉框中没有内容, so error popup....
阅读全文 »

0%