You can accomplish this with the GetObjectByAttribute Function.
e.g. Incident.GetObjectByAttribute("System.User", "Name", "JSmith1")
Thank you for the reply. Function GetObjectByAttribute requires a value of the attribute and I'm unsure what value I have.
What I'm trying to do is on an opening window, have a date field that the analyst fills in as a proposed date - propDate. propDate is an attribute from a Change object. Later in the process, I present another window to the analyst to put in the approved date - appDate. appDate is an attribute from an Approval object. On this later window I want the propDate value to be there, but allow the analyst to change it, if desired, and if changed appDate != propDate. I then want to reconcile these dates, meaning I want appDate to update the propDate value in the Change object. I've conceived of a third date, calcDate in the Change object to be able to allow the reconciliation. However, I don't know how to make the calculations.
- initially propDate is set by analyst on Change window
- appDate is set to propDate (calculated)
- appDate gets changed by analyst on Approval window
- calcDate is set to appDate (calculated) on Change window (probably a "not shown on window" field)
- if calcDate != propDate, calculation changes propDate value to calcDate on Change window
The reason for calcDate is because my first attempt failed. I made Change a collection of Approval so I could use the propDate from Change in the Approval window. This only made the field in Approval Read-Only with no value; which I understand from support is the way something like that would work. I can't use an attribute from another object like that. So it was suggested I use calculations and have three different fields. One on Approval and two on Change. The first date attribute on change sets the original, proposed date, the second date attribute on change gets the value from the Approval date and compares/modifies the first date attribute.
All that said, I'm not sure how to the get value from the date objects using GetObjectByAttribute function.
as you initial question suggested that you do not hold any references between your =dataObject= and the Change or approval Object (in this case you could have just used the reference to get access to their referenced objects), I suggested GetObjectByAttribute.
So how do you know which Change and which Approval is linked to your =dataObject= ?