首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

如何使用Netsuite中的restlet获取保存的销售订单搜索,显示公司名称而不是公司内部ID

在Netsuite中使用Restlet获取保存的销售订单搜索并显示公司名称而不是公司内部ID,可以按照以下步骤进行操作:

  1. 创建一个Restlet脚本:
    • 登录到Netsuite管理控制台。
    • 导航到Customization(定制)> Scripting(脚本)> Scripts(脚本)> New(新建)。
    • 选择Script Type(脚本类型)为Restlet。
    • 在Script Deployment(脚本部署)选项中,选择一个适当的部署方式。
    • 编写脚本代码以实现获取保存的销售订单搜索并显示公司名称的功能。
  • 在Restlet脚本中实现获取保存的销售订单搜索:
    • 使用Netsuite的API或SDK,通过Restlet脚本获取保存的销售订单搜索结果。
    • 使用相关API方法或SDK函数,将公司内部ID转换为公司名称。
  • 返回结果:
    • 将转换后的结果返回给调用方,以便显示公司名称而不是公司内部ID。

以下是一个示例Restlet脚本的代码,用于获取保存的销售订单搜索并显示公司名称:

代码语言:txt
复制
/**
 * @NApiVersion 2.x
 * @NScriptType Restlet
 * @NModuleScope SameAccount
 */
define(['N/search', 'N/record'], function(search, record) {
  function getSalesOrderSearch(requestParams) {
    var searchId = 'customsearch_sales_order_search'; // 替换为实际的搜索ID
    var searchObj = search.load({ id: searchId });

    var searchResult = searchObj.run().getRange({
      start: 0,
      end: 100
    });

    var results = [];
    searchResult.forEach(function(result) {
      var companyId = result.getValue({ name: 'company' });
      var companyName = getCompanyName(companyId); // 获取公司名称

      results.push({
        orderId: result.getValue({ name: 'internalid' }),
        companyName: companyName
      });
    });

    return results;
  }

  function getCompanyName(companyId) {
    var companyRecord = record.load({
      type: record.Type.CUSTOMER,
      id: companyId
    });

    return companyRecord.getValue({ fieldId: 'companyname' });
  }

  return {
    get: getSalesOrderSearch
  };
});

在上述示例代码中,我们使用了Netsuite的searchrecord模块来执行销售订单搜索和获取公司名称的操作。首先,我们加载了一个预定义的销售订单搜索,并运行该搜索以获取结果。然后,对于每个搜索结果,我们获取了公司的内部ID,并使用getCompanyName函数将其转换为公司名称。最后,我们将结果作为JSON数组返回给调用方。

请注意,示例代码中的searchId需要替换为实际的销售订单搜索的ID,以及根据实际需求进行适当的调整。

这是一个使用Netsuite中的Restlet获取保存的销售订单搜索并显示公司名称的基本示例。根据具体需求,您可能需要进一步扩展和优化代码。

页面内容是否对你有帮助?
有帮助
没帮助

相关·内容

iOS 上传AppStore 被拒汇总

4. Design: Preamble Design Preamble Your app includes a responsive version button or alerts the user to update the app. To avoid user confusion, app version updates must utilize the iOS built-in update mechanism. Please see attached screenshots for details. Next Steps To resolve this issue, please remove the responsive version button feature from your app. To distribute a new version of your app, upload the new app binary version into the same iTunes Connect record you created for the app’s previous version. Updated versions keep the same Apple ID, iTunes Connect ID (SKU), and bundle ID as the original version, and are available free to customers who purchased a previous version. Resources To create new versions of your app, please review the Create a new version section in iTunes Connect Developer Help. 翻译过来: 4.设计:序言 设计前言 您的应用程式包含响应式版本按钮,或提醒用户更新应用程式。 为了避免用户混淆,应用版本更新必须利用iOS内置的更新机制。 详情请参阅附录截图。 下一步 要解决此问题,请从应用程序中删除响应式版本按钮功能。 要分发新版本的应用程序,请将新的应用程序二进制版本上传到为应用程序的以前版本创建的iTunes Connect记录中。 更新的版本保持相同的Apple ID,iTunes Connect ID(SKU)和捆绑ID作为原始版本,对于购买以前版本的客户可以免费使用。 资源 要创建新版本的应用程序,请查看iTunes Connect开发人员帮助中的创建新版本部分。

03

苹果app怎么上架

1、苹果要求版本更新必须使用iOS版本更新内置更新机制。 Design: Preamble Design Preamble Your app includes a responsive version button or alerts the user to update the app. To avoid user confusion, app version updates must utilize the iOS built-in update mechanism. Please see attached screenshots for details. Next Steps To resolve this issue, please remove the responsive version button feature from your app. To distribute a new version of your app, upload the new app binary version into the same iTunes Connect record you created for the app's previous version. Updated versions keep the same Apple ID, iTunes Connect ID (SKU), and bundle ID as the original version, and are available free to customers who purchased a previous version. Resources To create new versions of your app, please review the Create a new version section in iTunes Connect Developer Help. 翻译过来: 设计:序言 设计前言 您的应用程式包含响应式版本按钮,或提醒用户更新应用程式。 为了避免用户混淆,应用版本更新必须利用iOS内置的更新机制。 详情请参阅附录截图。 下一步 要解决此问题,请从应用程序中删除响应式版本按钮功能。 要分发新版本的应用程序,请将新的应用程序二进制版本上传到为应用程序的以前版本创建的iTunes Connect记录中。 更新的版本保持相同的Apple ID,iTunes Connect ID(SKU)和捆绑ID作为原始版本,对于购买以前版本的客户可以免费使用。 资源 要创建新版本的应用程序,请查看iTunes Connect开发人员帮助中的创建新版本部分。 解决办法:我的做法是给审核的时候隐藏检查版本检查更新功能 2、应用程序是专门为iPhone开发的,用户仍然可以在iPad上使用您的应用程序,而且不能影响正常的功能使用 2. 4 Performance: Hardware Compatibility Guideline 2.4.1 - Performance - Hardware Compatibility We noticed that your app did not run at iPhone resolution when reviewed on iPad running iOS 10.3.2. Specifically, the UI in this iPhone app is cut-off and unaccessible via scrolling on iPad. Please see attached screenshots for details. Next Steps To resolve this issue, please revise your app to ensure it runs and displays properly at iPhone resolution on iPad. Even if your app was developed specifically for iPhone, users should still be able to use your app on iPad. Resources For information on iOS device screen sizes and resolutions, please review the iOS Human Interface Guidelines as well as Points versus Pixels in the View Programming Guide for iOS. 翻译结果: 2.4性能:硬件兼容性 准则2.4.1 - 性能 - 硬件兼容性 我们注意到,在运行iOS 10.3.2的iPad上进

03
领券