Start a new topic

Letter code based on gift amount

Does anyone know of a way to set a virtual field or dictionary for Letter Code based on Gift Amount? Gifts of $1000 or more have one letter code, gifts under $1000 have another code.

To add on to Jeff's response, to have access to another "seed" or field you would need to specifically call it like this:

Import.Fields.GetByName("NameOfField").Value

So something like:

If oField.Value.ToUpper "CANADA" Or Import.Fields.GetByName("GiftAmount").Value sReturn = "Do Not Receipt"
Else
sReturn = "Not Receipted"
End if
Try this:

If oField.Value "Canada" Then

Or even better, this:

If oField.Value.ToUpper "CANADA" Then

Didn't actually try this, so I'm assuming Value is a string that will have the ToUpper function. But this will make sure it works even if the source data is "Canada", "CANADA", or "cAnAdA".
I have this working now. Thanks again for your help, Wayne.
since oField is the amounts field and sReturn is what the Acknowledge Date field will be set to you need to separate the two.

The way the original function was written you set sReturn (value of the Ack Date field) = oField.Value (value of the amount field) at the beginning. Then you only change sReturn if the amount is > $1,000 so it stays set to the amount if it is
Either you can use an Else clause in your If statement (i.e. If sReturn > 1000 Then sReturn = Ack Date ELSE sReturn = "" End If) or you can start by setting sReturn = "" and use oField.Value in your If statement so that if the amount is
I'm having some trouble with this. When the value is less than $1000, it is giving me a dollar value in the acknowledgement date. I will always have a gift value. What I want to do is copy the gift date from another column if the gift amount is less tahn $1000. I'm not sure how to do this.

Hi Marie,


You can use the "seed" functionality to do this pretty easily.  When you set a field as the "seed" for a function then that field becomes the oField in your custom function.  If you do not set a seed field then it is assumed that you want the current field to be the oField value.


So you would need to create a function similar to the last one here and assume that oField is your amount field (because you will set that field as the seed column).  Then the logic is pretty straight-forward, just replace = "" with >= 1000 and you should be most of the way there!


  -Wayne

May I call upon your help one more time?
I have been asked to do the following. If the gift is under $1000, then copy the gift date and populate the Acknowledge Date. If the gift is over $1000, then leave the Acknowledge Date blank.
Thank you!
Amy,

You appear to have lost this portion of the code:

Public Class Profile
Inherits ImportOM.API.ProfileBase

This should go directly after the comment of the code being specific to your profile
Is that very first underscore in your code? It should not be if it is.
Teamwork!
That's the ticket! I have it working now.
Thank you Jeffrey and Wayne.
Actually, you need to move that line to after "End If". The other option is to get rid of sReturn altogether and use Return "OR-Online Receipt" instead of assigning it to variable and returning the variable at the end.
The line that says "Return sReturn" ends the function at that point, returning an empty string and exiting the function. Try removing that line.
This is my code
_
Public Function ComputedColumn_635405005490884063( _
ByVal oField as ImportOM.API.iField, _
ByVal Cancel As ImportOM.API.iCancel) As String
'This function must return a text value
Dim sReturn As String = ""
Return sReturn

If oField.Value sReturn = "OR-Online Receipt"
Else
sReturn = "MCHF-Receipt"
End If
End Function

In my virtual field, I have the function Test Letter Code, and the Seed is N, which is the column for Gift Amount.
Make sure that you selected the function as well as the seed.

If the letter is ending up blank then the function is not running because the function would set one of those values.
Login or Signup to post a comment