locked
Initialized a CRMDATETIME field in VBA RRS feed

  • Question

  • Hello,

    I am working in VB.net and I cannot seem to initialize the CRMDATETIME field.

    Dim strDate As String = Mid(strERS_DOB, 1, 2) & "/" & Mid(strERS_DOB, 3, 2) & "/" & Mid(strERS_DOB, 5, 4)
    
    
    
    leadrecord.new_dateofbirth = New CrmDateTime()
    
    
    
    leadrecord.new_dateofbirth.date = CDate(strDate)
    
    
    
    
    On the Middle command, I am getting that it is "CRMDateTime is ambiguous"
    I am not sure what I need to do to get this to work.
    Thanks!! Eddi Rae Melton
    Tuesday, July 5, 2011 3:25 PM

Answers

  • I think I see my problem!!

    I imported both mscrm and the mscrmMetaData.  They both have the CRMDATETIME defined.  Once I fully qualified which one to use, the error went away.

    Imports

    ApplicationProcessERS.mscrm

    Imports

    ApplicationProcessERS.mscrmMetaData

     

    Thanks for your help!!

    Eddi Rae


    Thanks!! Eddi Rae Melton
    • Marked as answer by EddiRaeM Tuesday, July 5, 2011 5:20 PM
    Tuesday, July 5, 2011 4:37 PM
  • Hi,

    If you are only performing createing/retrieving/deleting/updating etc on data and not using doing anything with metadata then you can remove the refrence ApplicationProcessERS.mscrmMetaData or even can use CrmDateTime with full qualified name i.e. ApplicationProcessERS.mscrm.CRMDATETIME

    I bleive this anwers your quesiton.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Proposed as answer by Jehanzeb.Javeed Tuesday, July 5, 2011 4:47 PM
    • Marked as answer by EddiRaeM Tuesday, July 5, 2011 5:20 PM
    Tuesday, July 5, 2011 4:47 PM

All replies

  • Hi,

    Seems like CrmDateTime is defined into more then one name space in VB.Net that you added, can you past the full code with namespaces or just namespaces.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Tuesday, July 5, 2011 4:06 PM
  • I think I see my problem!!

    I imported both mscrm and the mscrmMetaData.  They both have the CRMDATETIME defined.  Once I fully qualified which one to use, the error went away.

    Imports

    ApplicationProcessERS.mscrm

    Imports

    ApplicationProcessERS.mscrmMetaData

     

    Thanks for your help!!

    Eddi Rae


    Thanks!! Eddi Rae Melton
    • Marked as answer by EddiRaeM Tuesday, July 5, 2011 5:20 PM
    Tuesday, July 5, 2011 4:37 PM
  • Hi,

    If you are only performing createing/retrieving/deleting/updating etc on data and not using doing anything with metadata then you can remove the refrence ApplicationProcessERS.mscrmMetaData or even can use CrmDateTime with full qualified name i.e. ApplicationProcessERS.mscrm.CRMDATETIME

    I bleive this anwers your quesiton.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Proposed as answer by Jehanzeb.Javeed Tuesday, July 5, 2011 4:47 PM
    • Marked as answer by EddiRaeM Tuesday, July 5, 2011 5:20 PM
    Tuesday, July 5, 2011 4:47 PM