Order.ExistingLien.Recording.Dated

Discussions concerning general integration topics.

Moderator: Phil Barton

Post Reply
vaetgt1
Posts: 11
Joined: Thu Aug 27, 2009 12:00 pm

Order.ExistingLien.Recording.Dated

Post by vaetgt1 »

I am trying to create new existing liens however whenever I try an update the recording.dated field I get the error

Method invocation failed because 'Public Property Dated() As System.Nullable(Of Date)' cannot be called with these arguments: Argument matching parameter '' cannot convert from 'Date' to 'Nullable(Of Date)'.

How can I set this field. My code is in VBNet, and here is a snippet
Dim spsExistingLien As Object
Try
If spsOrder.ExistingLiens.Count > 0 Then
spsOrder.ExistingLiens.Clear()
End If
spsExistingLien = DirectCast(spsOrder, IOrder).CreateNew("ExistingLien")
spsExistingLien.Recording.BookNumber = "1111"
spsExistingLien.Recording.PageNumber = "22222"
spsExistingLien.Mortgagee = "Bill bloggs"
spsExistingLien.Recording.Dated =CDate("MAY 1, 2015")
Phil Barton
Posts: 54
Joined: Wed Sep 24, 2008 2:37 pm
Location: Raleigh, NC
Contact:

Re: Order.ExistingLien.Recording.Dated

Post by Phil Barton »

When interacting with the API, you should be using the IOrder and IOrderItem interfaces to get/set property values. So, your code snippet would be translated into the following (NOTE: I have a variable named 'order' that is of type IOrder):

Code: Select all

                
                Dim existingLiens As IList = DirectCast(order("ExistingLiens"), IList)

                ' Even though we clear this, the rules will put one back in. So, may want to consider
                ' just getting the first one from the list instead of creating the new one.
                If existingLiens.Count > 0 Then
                    existingLiens.Clear()
                End If

                Dim newLien As IOrderItem = order.CreateNew("ExistingLien")

                existingLiens.Add(newLien)
                newLien("Mortgagee") = "Bill Bloggs"

                Dim recording As IOrderItem = DirectCast(newLien("Recording"), IOrderItem)

                recording("BookNumber") = "11111"
                recording("PageNumber") = "22222"
                recording("Dated") = CDate("MAY 1, 2015")
This code executes without error.
Phil Barton
Software Architect
SoftPro
Post Reply