简体   繁体   English

如何使用Force.com-Toolkit-for-NET创建机会和报价

[英]How to create an opportunity and quote using Force.com-Toolkit-for-NET

I connected to salesforce and I got the auth token How can I create a opportunity and quote using Force.com-Toolkit-for-NET. 我连接到salesforce并获得了身份验证令牌。如何使用Force.com-Toolkit-for-NET创建机会并报价。

Thanks in advance. 提前致谢。

For interacting with Salesforce you can use ForceClient class which provide methods for all CRUD operations with SF Objects. 为了与Salesforce进行交互,可以使用ForceClient类,该类为使用SF Objects的所有CRUD操作提供方法。 For creation objects you should use CreateAsync() method. 对于创建对象,应使用CreateAsync()方法。 Here are few examples: 以下是一些示例:

 dynamic quote = new ExpandoObject();
      quote.Name = QuoteName;
      quote.OpportunityId = OpportunityId;

      var createQuoteResponse = await client.CreateAsync( "Quote", quote );
      quote.Id = createQuoteResponse.Id;
      if ( quote.Id != null ) {
        Console.WriteLine( "Quote  created with Opportunity Id : " + OpportunityId + " , Quote Name : " + quote.Name );
      }

This works. 这可行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM