10.1.400.23
Hello all,
I’m building an editable dashboard to make it easy to complete and close Jobs, specifically phase jobs.
I make the JobClosed and JobComplete fields as to what is updated. No problem. I can get the dashboard to deploy and it works.
I don’t want want the user to also have to set today’s date on each. So I go the the Update Processing tab in BAQ and open Expression Editor. If I change the CompletiponDate and ClosedDate expressions from the default ttResult… to “Constants.Today” it will put todays date in the field upon update. But because it updates both even if only one if the two is selected, then I’m still not there. But it works, in general.
The Expression Editor is called “Business Object Update C# Expression”. I figure I can throw an “If” statement in there to evaluate if the specific checkbox was checked for the corresponding date. Google says the C# expression is this:
if (condition)
{
Console.WriteLine("The variable is set to true.");
}
else
{
Console.WriteLine("The variable is set to false.");
}
So I try this for the JobHead_ClosedDate:
if (ttResult.JobHead_JobClosed)
{
Constants.Today;
}
else
{
ttResult.JobHead_ClosedDate;
}
I get several errors when I try to save:
Error CS1525: Invalid expression term ‘,’ [Update.Base.##BASE##.cs(107,83)]
Error CS1002: ; expected [Update.Base.##BASE##.cs(107,84)]
Error CS1002: ; expected [Update.Base.##BASE##.cs(108,89)]
Error CS1525: Invalid expression term ‘,’ [Update.Base.##BASE##.cs(108,89)]
Error CS1002: ; expected [Update.Base.##BASE##.cs(108,90)]
Error CS1002: ; expected [Update.Base.##BASE##.cs(109,91)]
Error CS1525: Invalid expression term ‘,’ [Update.Base.##BASE##.cs(109,91)]
Error CS1002: ; expected [Update.Base.##BASE##.cs(109,92)]
Error CS1002: ; expected [Update.Base.##BASE##.cs(110,87)]
Error CS1525: Invalid expression term ‘,’ [Update.Base.##BASE##.cs(110,87)]
Error CS1002: ; expected [Update.Base.##BASE##.cs(110,88)]
Error CS1514: { expected [Update.Base.##BASE##.cs(156,18)]
Can anyone explain the syntax in that editor? I clearly don’t know how to put an “If” statement in there. I could use some guidance.
Thanks,
Ben