I would try to accomplish your goal by extending the control logic in the article to fetch the original id off the clipboard and then parse by the - token and then appending the first element from the parse to the string seen in the current control.
Posted: 4 years ago
Posted: 16 Feb 2017 14:15 EST
Ron Lee (RonLee_GCS)
Principal Software Solutions Engineer
If you cannot get the above suggestion to work, I have a very kludgy method that might, depending on whether the necessary SQL functions are available for the proposed function alias:
1) For the function alias, have a return type of text.
2) In the FA, for each ID, prepend a string of the following format:
"<WO prefix><length of numeric part of ID>-"
So an ID of "W-1" would become "W1-W-1", "W-10" would become "W2-W-10", "W-100" would become "W3-W-100", etc. If you are going to have 10 billion or more of any work object type, then you will have to use leading zeros for the numeric part of the prepended string (e.g., "W01-").
3) As strings, these will sort correctly - first alphabetically by prefix, then numerically by length of the numerical part of the prepended string (1 digit before 2 digit before 3 digit, etc.) and in numerical order within each numerical length (1 before 2, 10 before 11, etc.).
4) In the format control, remove the prepended string.
Basically, you are prepending a string in the FA that will force an alphabetical sort that is correct with respect to both the alpha prefixes ("A-..." befor "B-...") and the numeric part of the ID within each prefix (9 before 10, 99 before 100).
It's not elegant (remember, I did say it was a kludge) but I believe it will work.