SSIS currency field is not able to set

Unanswered SSIS currency field is not able to set

  • Wednesday, May 23, 2012 6:57 PM
     
     
    I'm integrating data using SSIS, when I'm trying to insert data of type Currency it is not inserted and giving any error.....!
    Any solution help me.

    Prajwal

All Replies

  • Wednesday, May 23, 2012 10:44 PM
     
     

    Hi there

    did you add it as a lookup with the the type, value and name ?


    Jonathan Nachman MBSP, MCTS

    Microsoft CRM Technical Blog

    CRM Solutions Architect for Pythagoras

  • Thursday, May 24, 2012 7:16 AM
    Moderator
     
     

    Hello,

    How do you populate currency field in your code? Can you please provide code?


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Follow Andriy on Twitter

  • Thursday, May 24, 2012 7:28 AM
     
     

    Hello Jonathan and Andrii

    Sry for confusing post, Actually I want to set Amount value whoes data type is currency.

    objEntity["fieldName"]= Row.columnName

    fieldName -->  data type is Currency

    No error is there but data is not inserted into that field.

  • Thursday, May 24, 2012 7:37 AM
    Moderator
     
     

    1. To populate money field you should use following code:

    objEntity["fieldName"]= new Money(<decimal value here>);

    2. To work with money fields in common you should populate currency lookup with code like:

    objEntity["transactioncurrencyid"] = new EntityReference("transactioncurrency", <Guid of currency here>);


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Follow Andriy on Twitter

  • Thursday, May 24, 2012 9:36 AM
     
     

    Hello Andrii

    Can you please give me details on 2nd point

    new EntityReference("transactioncurrency", <Guid of currency here>);

    Not able to set currency by that way.


  • Thursday, May 24, 2012 9:44 AM
    Moderator
     
     

    Hello Andrii

    Can you please give me details on 2nd point

    new EntityReference("transactioncurrency", <Guid of currency here>);

    Not able to set currency by that way.


    Why are you unable to do it?

    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Follow Andriy on Twitter

  • Thursday, May 24, 2012 9:57 AM
     
     

    Syntax Error

    newPendingOrder[

    "transactioncurrencyid"] = new EntityReference("transactioncurrency",B263C948-F63F-E111-9ED5-22F921F76C3A);

  • Thursday, May 24, 2012 10:28 AM
    Moderator
     
      Has Code

    Can you try to use following code instead:

    newPendingOrder["transactioncurrencyid"] = new EntityReference("transactioncurrency",new Guid("B263C948-F63F-E111-9ED5-22F921F76C3A"));

    or

    newPendingOrder["transactioncurrencyid"] = new EntityReference(){LogicalName = "transactioncurrency", Id = new Guid("B263C948-F63F-E111-9ED5-22F921F76C3A")};


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Follow Andriy on Twitter

  • Thursday, May 24, 2012 11:44 AM
     
     

    Showing error like

    My code is

    Guid

    cID = new Guid("B263C948-F63F-E111-9ED5-22F921F76C3A");

    EntityReference currency = new EntityReference() { Name="transactioncurrency", Id=cID,};

    newPendingOrder[

    "new_basicamount"] = new Money() { Value = 5000};

    There was an error while trying to serialize parameter http://schemas.microsoft.com/xrm/2011/Contracts/Services:entity. The InnerException message was 'Type 'CrmProxy.Crm.Money' with data contract name 'Money:http://schemas.microsoft.com/xrm/2011/Contracts' is not expected. Add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.'.  Please see InnerException for more details.

  • Thursday, May 24, 2012 11:51 AM
    Moderator
     
      Has Code

    In case you wrote your code based on my sample you should open extensions file, find OrganizationRequest class and add Money as well-known type like:

        [KnownType(typeof(Money))]
        partial class OrganizationRequest


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Follow Andriy on Twitter

  • Thursday, May 24, 2012 12:10 PM
     
     
    Can you please give more details
    Step By Step Im new to all these
  • Thursday, May 24, 2012 12:15 PM
     
     
    From Where I can Update that.
  • Thursday, May 24, 2012 12:22 PM
    Moderator
     
     
    Ok. In this case I need input. Can you please write step-by-step what have you done sine project has been started?

    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Follow Andriy on Twitter

  • Thursday, May 24, 2012 12:53 PM
     
     

    [KnownType(typeof(Money))]public partial class OrganizationRequest : object, System.Runtime.Serialization.IExtensibleDataObject,

    System.ComponentModel.INotifyPropertyChanged {

    Then also it is not workingI update organizationrequest like
  • Thursday, May 24, 2012 1:13 PM
    Moderator
     
     
    Strange. Try to add the same attribute to Entity and OrganizationClient as well.

    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Follow Andriy on Twitter

  • Thursday, May 24, 2012 1:16 PM
     
     

    Hi Andrii and Prajwal,

    sorry for the interferring,even i am also struck with currency field and optionset field.

    I followed your discussions about this topic.

    and i add your code in CrmProxy solution of Reference.cs file.

    even Money field is not working in Script component of SSIS

    please help me.


    Gangadhar