Hi!
The green "Approve" button only shows black. When I check it from the studio, there is an error wherein it says "Invalid argument type (Record). Expecting a Text value instead." Below are the codes. I'm really not sure if that is the one causing the color of the "Approve Button"
ForAll(
ReqGallery.Selected.GrpDetail,
If(
MgPost.Text = "Reviewer" && ReqGallery.Selected.Request_Status = "Submitted",
Patch(
'Requisition Forms (App)',
{ID: ID},
{Request_Status: "Reviewed"},
{Reviewed_Date: Now()},
{Reviewed_By: User().FullName}
),
MgPost.Text = "Manager" && ReqGallery.Selected.Request_Status = "Reviewed",
Patch(
'Requisition Forms (App)',
{ID: ID},
{Request_Status: "ManagerApproved"},
{ManagerApproved_Date: Now()},
{ManagerApproved_By: User().FullName}
),
MgPost.Text = "Approver" && ReqGallery.Selected.Request_Status = "ManagerApproved" && Value(TotalEstimatedPrice.Text) <= EstAmountLimitVar,
Patch(
'Requisition Forms (App)',
{ID: ID},
{Request_Status: "Processing"},
{Approval_Date: Now()},
{Approved_By: User().FullName}
),
MgPost.Text = "Approver" && ReqGallery.Selected.Request_Status = "ManagerApproved" && Value(TotalEstimatedPrice.Text) > EstAmountLimitVar,
Patch(
'Requisition Forms (App)',
{ID: ID},
{Request_Status: "FinalApproval"},
{Approval_Date: Now()},
{Approved_By: User().FullName}
),
MgPost.Text = "FinalApprover" && ReqGallery.Selected.Request_Status = "FinalApproval" && Value(TotalEstimatedPrice.Text) > EstAmountLimitVar,
Patch(
'Requisition Forms (App)',
{ID: ID},
{Request_Status: "Processing"},
{FinalApproval_Date: Now()},
{FinalApproved_By: User().FullName}
),
MgPost.Text = "ProcStaff" && ReqGallery.Selected.Request_Status = "Processing",
Patch(
'Requisition Forms (App)',
{ID: ID},
{Request_Status: "Completed"},
{Completed_By: User().FullName},
{Completed_Date: Now()}
)
)
);
If(
MgPost.Text = "Reviewer" && ReqGallery.Selected.Request_Status = "Submitted",
REQCKJEmail.Run(
ManagerEmailVar,
"For initial approval: " & Label14.Text & " from " & First(ReqGallery.Selected.GrpDetail).Author.DisplayName,
"New requisition was submitted for your approval. <p><p> REQUEST DETAILS: <p> Request Number: <b>" & Label14.Text & "</b><p> Requsition Title: <b>" & Label14_2.Text & "</b><p> Requestor: <b>" & First(ReqGallery.Selected.GrpDetail).Author.DisplayName & "</b><p> Date Needed: <b>" & Label15.Text & "</b><p> Total Estimated Price: <b>" & TotalEstimatedPrice.Text,
"",
First(ReqGallery.Selected.GrpDetail).Author.Email,
"Manager Approved: " & Label14.Text,
Label14.Text & " has been initially approved on " & First(ReqGallery.Selected.GrpDetail).Reviewed_Date & " and is now forwarded to Procurement Head for next approval."
),
MgPost.Text = "Manager" && ReqGallery.Selected.Request_Status = "Reviewed",
REQCKJEmail.Run(
ApproverEmaillVar,
"For approval: " & Label14.Text & " from " & First(ReqGallery.Selected.GrpDetail).Author.DisplayName,
"New requisition was submitted for your approval. <p><p> REQUEST DETAILS: <p> Request Number: <b>" & Label14.Text & "</b><p> Requsition Title: <b>" & Label14_2.Text & "</b><p> Requestor: <b>" & First(ReqGallery.Selected.GrpDetail).Author.DisplayName & "</b><p> Date Needed: <b>" & Label15.Text & "</b><p> Total Estimated Price: <b>" & TotalEstimatedPrice.Text,
"",
First(ReqGallery.Selected.GrpDetail).Author.Email,
"Procurement Head Approved: " & Label14.Text,
Label14.Text & " has been approved on " & First(ReqGallery.Selected.GrpDetail).ManagerApproved_Date & " and is now forwarded to Procurement Head for next approval."
),
MgPost.Text = "Approver" && ReqGallery.Selected.Request_Status = "ManagerApproved" && Value(TotalEstimatedPrice.Text) <= EstAmountLimitVar,
REQCKJEmail.Run(
ProcStaffEmaillVar,
"Ready for Processing: " & Label14.Text & " from " & First(ReqGallery.Selected.GrpDetail).Author.DisplayName & " needed on " & Label15.Text,
Label14.Text & ", needed on " & Label15.Text & " has been approved and is now ready for processing.",
"",
First(ReqGallery.Selected.GrpDetail).Author.Email,
"Approved: " & Label14.Text,
Label14.Text & " has been approved on " & First(ReqGallery.Selected.GrpDetail).Approval_Date & " and is now forwarded to HR for processing."
),
MgPost.Text = "Approver" && ReqGallery.Selected.Request_Status = "Submitted" && Value(TotalEstimatedPrice.Text) > EstAmountLimitVar,
REQCKJEmail.Run(
FinalApproverEmaillVar,
"Final Approval: " & Label14.Text & " from " & First(ReqGallery.Selected.GrpDetail).Author.DisplayName & " needed on " & Label15.Text,
Label14.Text & ", needed on " & Label15.Text & " has been initially approved and is requesting for final approval.",
"",
First(ReqGallery.Selected.GrpDetail).Author.Email,
"For Final Approval: " & Label14.Text,
Label14.Text & " has been initially approved on " & First(ReqGallery.Selected.GrpDetail).Approval_Date & ". Requested item/s with total estimated price exceeding USD 10,000 is subject to final approval. An email will be sent to you as soon as your request is approved and is ready for processing."
),
MgPost.Text = "FinalApprover" && ReqGallery.Selected.Request_Status = "FinalApproval" && Value(TotalEstimatedPrice.Text) > EstAmountLimitVar,
REQCKJEmail.Run(
ProcStaffEmaillVar,
"Ready for Processing: " & Label14.Text & " from " & First(ReqGallery.Selected.GrpDetail).Author.DisplayName & " needed on " & Label15.Text,
Label14.Text & ", needed on " & Label15.Text & " has been approved and is now ready for processing.",
"",
First(ReqGallery.Selected.GrpDetail).Author.Email,
"Approved: " & Label14.Text,
Label14.Text & " has been approved on " & First(ReqGallery.Selected.GrpDetail).FinalApproval_Date & " and is now forwarded to HR for processing."
),
MgPost.Text = "ProcStaff" && ReqGallery.Selected.Request_Status = "Processing",
REQCKJEmail.Run(
First(ReqGallery.Selected.GrpDetail).Author.Email,
"Completed: " & Label14.Text,
Label14.Text & " is now completed. Please contact our HR department for any matter regarding this request.",
"",
"editedemailaddress",
"ReqCompleted",
""
)
);
UpdateContext({UpdateStatVisible: false})
Thanks!
Solved! Go to Solution.
Hi @yeveve
I think the reason the button appears black is because the request status of the selected item in you ReqGallery doesn't meet the conditions Submitted, FinalApproval, or Processing. You can set the button to green in this scenario using the following formula:
If(ReqGallery.Selected.Request_Status="Submitted", RGBA(54, 176, 75, 1), ReqGallery.Selected.Request_Status="FinalApproval", RGBA(54, 176, 75, 1), ReqGallery.Selected.Request_Status="Processing", RGBA(56, 86, 153, 1), Green )
Hi @yeveve
If you select the button, go to the Advanced section in the properties pane and view the 'Fill' property, can you tell us what that says? That's the property that controls the back color.
Also, where did you specify the code that you posted? Did you set that against the OnSelect property?
Hi timl!
Thank you very much for replying back. Below is the formula for the Fill under Advanced.
If(ReqGallery.Selected.Request_Status="Submitted", RGBA(54, 176, 75, 1),ReqGallery.Selected.Request_Status="FinalApproval", RGBA(54, 176, 75, 1), ReqGallery.Selected.Request_Status="Processing",RGBA(56, 86, 153, 1))
For the second question, yes, that is under the OnSelect property. Please see screenshot.
Thanks!
Hi!
This is the code that has a red underline. I'm not sure what is wrong with this. It says "The function 'Run' has some invalid arguments.'
REQCKJEmail.Run(
ManagerEmailVar,
"For initial approval: " & Label14.Text & " from " & First(ReqGallery.Selected.GrpDetail).Author.DisplayName,
"New requisition was submitted for your approval. <p><p> REQUEST DETAILS: <p> Request Number: <b>" & Label14.Text & "</b><p> Requsition Title: <b>" & Label14_2.Text & "</b><p> Requestor: <b>" & First(ReqGallery.Selected.GrpDetail).Author.DisplayName & "</b><p> Date Needed: <b>" & Label15.Text & "</b><p> Total Estimated Price: <b>" & TotalEstimatedPrice.Text,
"",
First(ReqGallery.Selected.GrpDetail).Author.Email,
"Manager Approved: " & Label14.Text,
Label14.Text & " has been initially approved on " & First(ReqGallery.Selected.GrpDetail).Reviewed_Date & " and is now forwarded to Procurement Head for next approval."
),
Thanks!
Hi @yeveve
I think the reason the button appears black is because the request status of the selected item in you ReqGallery doesn't meet the conditions Submitted, FinalApproval, or Processing. You can set the button to green in this scenario using the following formula:
If(ReqGallery.Selected.Request_Status="Submitted", RGBA(54, 176, 75, 1), ReqGallery.Selected.Request_Status="FinalApproval", RGBA(54, 176, 75, 1), ReqGallery.Selected.Request_Status="Processing", RGBA(56, 86, 153, 1), Green )
Hi!
Thank you very much. I'm in the process of testing this. I would just like to ask another question. With the formula below for "text" from this approve button, should it show "Approve" or "Mark as complete"? I haven't tested it yet because I'm afraid that I might mess up the approval routing (I'm really new to this and project was just handed to me because the one who was working with this left already)
Upper(If(MgPost.Text="Approver" && ReqGallery.Selected.Request_Status="Submitted", "Approve", MgPost.Text="FinalApprover" && ReqGallery.Selected.Request_Status="FinalApproval", "Approve", MgPost.Text="ProcStaff" && ReqGallery.Selected.Request_Status="Processing", "Mark as Complete"))
Thanks!
User | Count |
---|---|
139 | |
137 | |
77 | |
77 | |
71 |
User | Count |
---|---|
224 | |
179 | |
68 | |
68 | |
58 |