I have an embedded report on my Work Order form which displays the Subcontractor Quotes. I have a Formula-URL button displayed on the report called [Subcontractor Dispatched]. When the button is clicked, I need two things to happen:
I need to create a record in the Status History Table. I've successfully accomplished this with the following formula:
var bool show = If(Contains([Quote Status], "Approved by PM"),true,false); If($show=true,
I need to update the related parent Work Order record by checking a checkbox field. However, I have two problems:
A.) I can't seem to figure out how to denote which record to update in my formula. I've tried using the formula below but it returns an error stating >No such record< and >Missing "rid" parameter< (I assume it must be because the field [Related Work Order] actually exists in the Subcontractor Quotes table, not the Work Orders table):
URLRoot() & "db/" & [_DBID_WORK_ORDERS] & "?a=API_EditRecord&_rid=" & URLEncode([Related Work Order]) & "&_fid_155=true" & "&apptoken=xxxxxxxxxxx" & "&rdr=" &URLEncode ( URLRoot() & "db/" & Dbid() &"?a=doredirect&z=" & Rurl()) B.) Once I get the API_EditRecord formula correct, I'm not really sure how to structure my formula with the two API calls together and make it work.
Any help, advice, or resources would be much appreciated!
You were really close The problem with the missing rid was that you had a leading _ underscore that did not belong. Here is how I would write it to be all in one button. I also strongly recommend that you make your formula as tidy and readable as possible like I have below.
var bool ShowButton = Contains([Quote Status], "Approved by PM");
You were really close The problem with the missing rid was that you had a leading _ underscore that did not belong. Here is how I would write it to be all in one button. I also strongly recommend that you make your formula as tidy and readable as possible like I have below.
var bool ShowButton = Contains([Quote Status], "Approved by PM");