Hello everyone and @WCrihfield . I have a similar need for this but running into snags getting it to work. I'm trying to copy the Part Number iProperty to a custom iProperty named "NUMBER" but I only want to retain the first 10 characters from the Part Number iProperty if it starts with U. I need the same ability if the part number starts with PS but I only want to retain the first 13 characters in that case.
See below for what I’m trying to achieve:
Part Number iProperty = U100-00006R-N
If Part Number iProperty starts with U, then only retain the first 10 characters, and populate to Custom iProperty named “NUMBER”.
NUMBER custom iProperty should look like = U100-00006
Part Number iProperty = PS501-BAA0001L-G
If Part Number iProperty starts with PS, then only retain the first 13 characters, and populate to Custom iProperty named “NUMBER”.
NUMBER custom iProperty should look like = PS501-BAA0001
I was trying to go this route shown below but rather than remove characters from the end of the part number, I’d rather define what to retain from the beginning of the part number just in case someone accidentally has too many characters or not enough.
Dim sPN1 As String = iProperties.Value("Project", "Part Number")
If sPN1.StartsWith("FS") = True And sPN1.StartsWith("U") = True Then
iProperties.Value("Custom", "NUMBER") = Left(sPN1, Len(sPN1)-1)
iProperties.Value("Custom", "NUMBER") = Left(sPN1, Len(sPN1)-1)
End If
Any help would be greatly appreciated!!
Regards,
Kenny
If this post solved your issue please mark "Accept as Solution". It helps everyone...really!