Jump to content
  • 0

Calculated Field Details Page change when checkbox is enabled


GIOVAN

Question

Hello,

We need to approve all overtime hours. We can search from a Tabular report and then open Details Page to approve the overtime.

I want that when I checked BRW_Overtime_Approve. The field BRW_Overtime_Approved_Date = '[@cbTimestamp]' and field BRW_Overtime_Approved_by = '[@authfield:BRW_Employee_Full_Name]'.
I have done this with Calculated Field to get the info. Fields BRW_Overtime_Approved_Date  and  BRW_Overtime_Approved_Date are Hidden and On load, receive: Data Source Field CalculatedField1 and CalculatedField2.

CalculatedField1:

CASE WHEN [@field:BRW_OverTime_Approve]=1
THEN 
'[@authfield:BRW_Employee_Full_Name]'
ELSE
''
END

CalculatedField2:

CASE WHEN [@field:BRW_OverTime_Approve]=1
THEN 
'[@cbTimestamp]'
ELSE
''
END

The problem with this is that it works only when the datapage load, when we unchecked BRW_Overtime_Approve, CalculatedField1 and CalculatedField2 do not change automatically. Can anyone help me with this.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Thanks George for taking the effort to do this.
I forgot that we choice Calculated Value in the Details Page.

I have done this, now I am getting the following 2 problems:

1. The formula for BRW_OverTimeAproved_by is good but the Details Page is showing System.Object instead of the Full_Name.

2. When I used the following formula for BRW_OverTime_Approved_Date the Calculated Value give the error the formula is not good.  BRW_OverTime_Approved_Date is an Date/Time field.

CASE WHEN [@field:BRW_OverTime_Approve]=1
THEN 
[@cbTimestamp]
ELSE
''
END

When I change [@cbTimestamp] in GetDate() the formula seems to be okay but on Details Page is showing also System.Object. I never got this System.Object Before.

Error_1.png

Error_2.png

Link to comment
Share on other sites

  • 0

Hello, I know it's a bit late, but for the other that may come across to this post, 

you need to use SysUTCDateTime() instead of [@cbTimestamp].

I tried this and it validates as expected:

CASE WHEN [@field:BRW_OverTime_Approve]= '1'
THEN 
SysUTCDateTime()
END

Assuming that [@field:BRW_OverTime_Approve] is a Text field that's why there's  quotation marks between 1.

 

Hope this helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...