Hello All, OS experts - Greetings !
I am trying to complete the following code to extract the year and month from a given date. To help with validation and debugging, I've enabled BRAPI.ErrorLog.Lo...
Yes, I am receiving the output from the 'else' condition, which states 'Date is null or empty'. However, the Date field does have a value in the record, and it seems to be ignoring this and still executing the 'else' condition.
I have highlighted the column we intend to use for the logic. Below are the record details from the Thing Register, along with the error log for further clarity.
Given this a Thing Planning register field, I believe you need to be referencing the "internal" register filed name (such as Code1, TermDate, etc), and not the user visible "alias" of the field. If you are unsure what the internal register field name is, go to Thing Planning Settings, and then Register Field List to see how the internal field names have been mapped to the visible field aliases.
If you are still in doubt, dump out the dictionary keys or keys and values found in args.NameValuePairs, as you are currently trying to access a dictionary key that does not exist in the dictionary.
I attempted to use both the alias and the actual register field names, but neither worked.
ActiveDate is the actual register field name.
LetDate is the alias name for ActiveDate.
===============================
Dim wLetdate As String = args.NameValuePairs.XFGetValue("ActiveDate") '' e.g., "01/01/2025" (MM/DD/YYYY format) '' Log the retrieved Date for debugging 'BRAPI.ErrorLog.LogMessage(si, "wLetdate is: " & wLetdate)
KR, Then write a couple lines of code to cycle through all the items in the args.NameValuePairs dictionary, and output each Key (Name) and Value pair to the log. This will quickly tell you what parameters have been passed to this business rule, in the event the value is in fact in a differently named Key (Name). If it is not anywhere in the args.NameValePairs dictionary, then you know the problem is upstream.