Skip to content
+1-888-319-3663

COMMUNITY FORUM

Sales Payment Entry Expiration Date Empty when mapping to a calculated field (MMYY)

Yassin asked 3 years ago
I have a calculated field which I am trying to map to the Sales Entry Payment Expiration Date field but does not seem to get populated. I am basically try to take a MMYY value convert it to GP Date time. Below is the Calculated field 
 
if fn.ISEMPTY(_NEW_EXPIRATIONDATE) then
    return “”
else
  dim expdate = Date.ParseExact(_NEW_EXPIRATIONDATE, “dd/MM/yyyy”, 
            System.Globalization.DateTimeFormatInfo.InvariantInfo)
 
  return fn.GPDATE(expdate)
end if
Answers
Ethan Sorenson Staff answered 3 years ago
Yassin,
 
SmartConnect doesn’t recognize MMYY as a valid date format. If you instead use a substring method it will work correctly.
 
if fn.ISEMPTY(_NEW_EXPIRATIONDATE) then
    return “”
else
   return _NEW_EXPIRATIONDATE.SubString(0,2) + “/01/” + _NEW_EXPIRATIONDATE.SubString(3,2)
end if

If you would like to submit an answer or comment, please sign in to the eOne portal.