Hello everyone, this is going to be a long one so please bear with me! I am new to deluge scripting and am stuck with a few key principles.
Outline of what I am trying to achieve:
Use
Mail Merge to load a HTML page which i will then print - an example of the page which i currently print from a access database is
here
How far I have got:
Created a HTML page
Created a data view with a custom action to load my HTML page.
Created a function for my custom action (below)
void netbooks.SignOutForm(int ID)
{
openUrl("https://creator.zoho.com/ckc_database/ckc-database/#View:Students_Sign_out_form", "Same window");
}
Edited the definition of my data view to pass the record ID to the function (below)
list Student_Device_Signout
{
displayname = "Student Device Signout"
show all rows from Equipment [Assigned == "User"]
(
CKC_Number as "College Number"
CKC_Name as "College Name"
Manufacturer as "Device Manufacturer"
Model_Name as "Model Name"
Model_Number as "Model Number"
Serial_Number as "Serial Number"
Date_of_Deployment as "Date of Deployment"
User as "Student"
custom action "Sign Out"
(
function = netbooks.SignOutForm(ID)
show action in view header = true
column header = "Sign Out"
success message = ""
)
ID
)
filters
(
Date_of_Deployment
)
}
I can execute the function script and give it a record ID i get a message saying that it Executed Successfully, am I passing the record ID to the function correctly?
If any of the above is wrong then it may explain the next step which i am stuck on.
Fetching the data in the HTML page:
I have created a table similar to the table from the example form I have linked, unfortunately although I am following this
guide and this
video whenever i try and save the script I cannot as I just get a "null" error. Also in the video it shows fields in the "input fields" tab but I assume because there are no input fields in the HTML page mine is blank? screenshots attached:
fetch -
foreach-criteria -
foreach-NoInput
Here is what I imagine the code for my table should look like:
<table align="center" border="1" cellpadding="2" cellspacing="2" style="width: 720px;">
<tbody>
<tr>
<% for each r in Equipment
{
CKC_Number==r.CKC_Number;
CKC_Name==r.CKC_Name;
Serial_Number==r.Serial_Number;
Manufacturer==r.Manufacturer;
Model_Name==r.Model_Name;
Model_Number==r.Model_Number;
User==r.User;
Date_of_Deployment==r.Date_of_Deployment;
}%>
<td><span style="font-family:verdana,geneva,sans-serif;"><span style="font-size: 12px;">College Name</span></span></td>
<td><span style="font-family:verdana,geneva,sans-serif;"><span style="font-size: 12px;">College Number</span></span></td>
<td><span style="font-family:verdana,geneva,sans-serif;"><span style="font-size: 12px;">Serial Number</span></span></td>
</tr>
<tr>
<td><span style="font-family:verdana,geneva,sans-serif;"><span style="font-size: 12px;"><%=CKC_Number%></span></span></td>
<td><span style="font-family:verdana,geneva,sans-serif;"><span style="font-size: 12px;"><%=CKC_Name%></span></span></td>
<td><span style="font-family:verdana,geneva,sans-serif;"><span style="font-size: 12px;"><%=Serial_Number%></span></span></td>
</tr>
<tr>
<td><span style="font-family:verdana,geneva,sans-serif;"><span style="font-size: 12px;">Device Manufacturer </span></span></td>
<td><span style="font-family:verdana,geneva,sans-serif;"><span style="font-size: 12px;">Model Name</span></span></td>
<td><span style="font-family:verdana,geneva,sans-serif;"><span style="font-size: 12px;">Model Number</span></span></td>
</tr>
<tr>
<td><span style="font-family:verdana,geneva,sans-serif;"><span style="font-size: 12px;"><%=Manufacturer%></span></span></td>
<td><span style="font-family:verdana,geneva,sans-serif;"><span style="font-size: 12px;"><%=Model_Name%></span></span></td>
<td><span style="font-family:verdana,geneva,sans-serif;"><span style="font-size: 12px;"><%=Model_Number%></span></span></td>
</tr>
<tr>
<td><span style="font-family:verdana,geneva,sans-serif;"><span style="font-size: 12px;">Student Name</span></span></td>
<td><span style="font-family:verdana,geneva,sans-serif;"><span style="font-size: 12px;">Admin Number</span></span></td>
<td><span style="font-family:verdana,geneva,sans-serif;"><span style="font-size: 12px;">Date of Deployment</span></span></td>
</tr>
<tr>
<td><span style="font-family:verdana,geneva,sans-serif;"><span style="font-size: 12px;"><%=User%></span></span></td>
<td><span style="font-family:verdana,geneva,sans-serif;"><span style="font-size: 12px;">AN</span></span></td>
<td><span style="font-family:verdana,geneva,sans-serif;"><span style="font-size: 12px;"><%=Date_of_Deployment%></span></span></td>
</tr>
</tbody>
</table>
Please help me correct any mistakes I am making or steps I am missing. I really do want to learn and have spent MANY hours on this - it's probably staring me in the face!!
ZOHO team if you need to the application is open to you.
Thank you very much in advance.
Jeff