Quantcast
Channel: ASPRunner forums
Viewing all 2520 articles
Browse latest View live

Apply Delay in "After Record Added" Event

$
0
0
Hello,

As most of you know I'm working on a a project that involves 3 different tables: "Family," "Applicant" and "Charges." From my previous thread I managed to make the "Edit page" work but when attempting to use the same code(provided below) for the "Add page" it didn't work. The SQL code is supposed to copy the "GROUP_ID" field from the group table to the "FAMILY_ID" field in the "Charges" table, then add all entries that share the same "FAMILY_ID" and finally update the "TOTAL" field in the "Group" table.

//INHERIT FAMILY_ID
string strFamilyID = "UPDATE C SET C.FAMILY_ID = (SELECT FAMILY_ID FROM APPLICANT A WHERE A.APPLICANT_ID = '" + values["APPLICANT_ID"].ToString() + "') FROM APPLICANT A, CHARGES C WHERE C.APPLICANT_ID = '" + values["APPLICANT_ID"].ToString() + "'";
CommonFunctions.db_exec(strFamilyID , null);


//CALCULATE  "TOTAL" FOR CURRENT FAMILY BASED ON LATEST ENTERED CHARGE
string strTotalUsed = "UPDATE F set F.TOTAL_USED = (SELECT SUM(PASS_PAID) CHARGESUM	FROM CHARGES C WHERE C.FAMILY_ID ='" + values["FAMILY_ID"].ToString() + "')FROM FAMILY F, CHARGES C WHERE F.FAMILY_ID = '" + values["FAMILY_ID"].ToString() + "'";
CommonFunctions.db_exec(strTotalUsed, null);




Unfortunately, only my "FAMILY_ID" updates and my "TOTAL" field remains blank. I believe its because both parts of the code are executing at the same time, the second half doesn't have a "FAMILY_ID" to compare it to. I tried putting the first half in the "Before record added" event but not joy. I modified the code to set the value for the "FAMILY_ID" field but my syntax must be wrong because I get an error.

values["FAMILY_ID"] = "SELECT FAMILY_ID FROM APPLICANT A WHERE A.APPLICANT_ID ='"+data["APPLICANT_ID"].ToString()+"'";

[SOLVED] Dummy Fields on form

$
0
0
Is it possible to add dummy dropdown fields on an add record page in order to filter other dropdowns, but not actually add this field to the table?

My form has a number of fields like 'Hardware Name' which have amny options, and I would like a 'Customer' dropdown in order to filter these options, However, as the customer ID is already stored against the Hardware in another table I dont need to record that here. Is there a way I can add a field (in this instance as a dropdown dropdown) as a dependancy for other dropdowns, but without actually storing this field?

I did try adding the following into my SQL query:
,'' AS DummyField

And then this field is only on the Add page and provides what I need to display the form, but breaks as that obvisouly then tries inserting into this non-existent column. I believe I could do this with a view or adding a JOIN to the SQL to reference another table with Customer ID's, but then I think that would do the JOIN every time the list page is viewed etc which is probably inefficient when its only needed for an add.

Any ideas appreciated, I'm sure I'm missing something obvious. Thanks.

Jim.

helpshortcut.htm missing

$
0
0
Has anybody got a copy the of the shortcut keys file as it's not on my build of phprunner (9.8 build 29967)

Regards
Steve

how to call external website/function/api

$
0
0
Hi Experts,

Using another developing Tool i had this code:


var client = new WebClient();
var text = client.DownloadString("http://ojabiler.dk/sms/emailarbejdskort.asp?sagnr=" + rnoo);


How to code the same in asprunner.net

Best regards Newbie Michael

[SOLVED] Is there Data Access Layer (DAL) for JavaScript?

$
0
0
Hello

I am wondering to know if Is there Data Access Layer (DAL) for Javascript or a way to get Data from a DB using Javascript Programatically?

Let me explain, in the Javascript onload Event, depending of the option that the user choose from a Lookup wizard I need to get a value from a table that is not showing any data on the actual page then calculate something and later let the user continue.
I know that if I need 1 field of a table I can create a control and hide on the page and according of the user selection update this control but what happen when you need 10 fields of a database according of the user selection?

Please, could you help me,

Thank you.

CSS for standard file Input upload buttons

$
0
0
Hi,

to whom it may concern.

I wanted to style the upload-Buttons like all other buttons in the solution via CSS, but this is not possible unless you change

DatebaseFileField.php

in folder

source/classes/controls

to
		echo '<label class="btn btn-primary"><input type="File" style="position:fixed; top: -1000px;" id="'.$this->cfield.'" '
			.( ($mode == MODE_INLINE_EDIT || $mode == MODE_INLINE_ADD) && $this->is508 == true ? 'alt="'.$this->strLabel.'" ' : '')
			.' name="'.$this->cfield.'" ><span>'.##message START_UPLOAD##;
			echo '</span></label><br>'.$strfilename;


in line 130.

Now it´s a standard class btn-primary in Bootstrap layouts.

Print as Card Layout

$
0
0
Please, anyone can help how can I print layout as Credicard or play card, with Background picture?

list select field, its value becomes $arr accepting only 2 values

$
0
0
list select field, its value becomes $arr accepting only 2 values If I select more then 2 values from the list "emp_number" then it showing Error

<<< Record was NOT added >>>

Column 'emp_number' cannot be null
Back to list



if ($values["emp_number"])
{
 $arr = explode(",",$values["emp_number"]);
 // This is the name of the multi check box or
 // list select field, its value becomes $arr
for ($i=0;$i<count($arr);$i++)
{
 $strInsert = "insert into hrm_leave_entitlement (emp_number,no_of_days,
	days_used,
	leave_type_id,
	from_date,
	to_date,
	credited_date,
	note,
	entitlement_type,
	deleted,
	created_by_id,
	created_by_name
) values ('".$arr[$i]."',
'".$values["no_of_days"]."',
'".$values["days_used"]."',
'".$values["leave_type_id"]."',
'".$values["from_date"]."',
'".$values["to_date"]."',
'".$values["credited_date"]."',
'".$values["note"]."',
'".$values["entitlement_type"]."',
'".$values["deleted"]."',
'".$values["created_by_id"]."',
'".$values["created_by_name"]."')";
 // add more fields from the add page to be inserted into database
 db_exec($strInsert);
}
 // Exit and Redirect to the list page after updating database
exit();
}

// Place event code here.
// Use "Add Action" button to add code snippets.

return true;
;		

QCode

$
0
0
There is way to create QCode via ASPRunnerNet?

How to change what guest sees in calendar template

$
0
0
We bought the template pack and am trying to create a calendar - so far so good, but we need the guest login to be able to see weekly, monthly, yearly, etc. - all events - but not add or edit anything

Right now, all a guest can see is a stripped down week view.

How do I get them to see the welcome page WITH all calendar versions (day, week, month, year)?

Thanks.

Mike

Map on Edit page

$
0
0
Hi All, my application only has an edit page for address, not a view page.

When the user goes to the edit page I want to show a map if there's existing data in the address fields. How can I show a map on an edit page??

Disable Record Editing and Additon of Child Tables

$
0
0
I have 3 tables: Family, Applicant, Charges. All these tables contain a column called "Status." Their relationship is a follows:

Master | Child | Linked Field
Family - Applicant - Family_ID
Applicant - Charges - Applicant_ID

Right now I have so that when the "Status" changes for the master table the "Status" for the child tables also changes.

For example, if the "Status" for Applicant C changes from 'Active' to 'Inactive' all the "Charges" that share that same 'Applicant_ID' become 'Inactive' as well.

Now I would like it so that when the status of the Master table is set to 'Inactive' the "Edit," "Inline Add," and "Add new" buttons for the child entries that have that same "Family_ID" and/or "Applicant_ID" are disabled.

For example if I set the "Status" for the Jones family, I would not be able to edit or add new Applicants or Charges to this family.

I saw this, but I'm not sure how to apply it to the child tables.


https://xlinesoft.com/asprunnerpro/docs62/disable_record_editing.htm

Version 10 - any news

$
0
0
what happened to version 10?

First it should be released in December.

Then we were informed, that it takes a little longer - OK, no problem. Better we get good and stable features in the long run rather than a buggy release right now.

But now we nearly have mid Feb ...

Any news would be welcome.

How to expand details tables link for receord x when multiple tables are linked to master using "single link for all tables"

$
0
0
Hi All, looking for a way to expand(via code) master record x's "single link for all tables" . ive found this in the help text

// get list of record IDs
var recsId = pageObj.inlineEdit.getRecsId();
// get details table short table name
var dTableName = 'DetailsTableName';
var sTableName = Runner.pages.PageSettings.getShortTName(dTableName);
// click preview link of record number X
$("#"+sTableName+"_preview"+recsId[X]).click();

which works fine if i only have 1 table. doesnt seem to work for master with single link to details though? Ive also tried substituting tablename_preview above with dtables_link to no avail.

Anyone have code that will do this or suggestion on how?

ajax pagination and sorting is on.

thanks in advance

how to call external website/function/api

$
0
0
Hi Experts,

Using another developing Tool i had this code:


var client = new WebClient();
var text = client.DownloadString("http://ojabiler.dk/sms/emailarbejdskort.asp?sagnr=" + rnoo);


How to code the same in asprunner.net

Best regards Newbie Michael

Problem with add new values on the fly

$
0
0
I have a problem with an field in the Add page which is set as a lookup to another table with the option to add values on the fly. When I add values on the fly the selected option does not appear in the $values array.

The table is called 'hardware', and it has the fields 'CustomerID' & 'LocationID' which are lookups to separate tables. If do an Add on this table and select an existing Customer & location (list page with search) its fine. If I need to add a record on the fly and use the 'Inline Add', create the record, select the record and then fill the rest of the form and save the values for these fields are missing.

Here is the values array for one where I selected an existing customer and added a Location on the fly:

VALUES ARRAY: Array
(
    [CustomerID] => 2383
    [LocationID] => 
    [Vendor] => HP
    [Model] => A1200
    [DeviceName] => TestHardware
    [CreateDate] => 2018-02-08 10:33:13
)


I have found if I add on the fly, select in the list, and then click on select to go back to the list and select again, then its fine. So it seems it an issue selecting newly added items in the list which is different somehow.

Thanks.

2 questions regarding a reference manual and click actions

$
0
0
There is a LOT of capability in this tool but it's a little difficult knowing all the methods and functions (what's available where)that are in the system from the help docs. Is there a reference doc somewhere because I can't find one.

Ex: Just looking at the javascript api link in the help docs doesn't cover what is all implemented.


A current need I have is this and I can't find anywhere how to do it.

I used the click action ajax thing to fire some code when data is clicked in a list page cell. It all works. A new record is added to the DB correctly and it's the last record in the list view. What I want is to now open that record immediately in Edit page mode. Therefore, I want something in the Client After code to bring this record up in Edit mode. I cannot find a way to do it.

As an example of my frustration, in the help doc for events you are given this example of opening the add page.



7. Open Add page :

$("#addButton"+pageid).click();


Now there is no reference anywhere to opening the Edit page in the same manner. Sure enough you put this line of code in and it works.

Logically you then try:


$("#editButton"+pageid).click(); //And it doesn't work.




So I say all of this to ask, is there a reference manual anywhere? And anyone have a method for opening the Edit page in javascript from the Client After area?

[SOLVED] take a previous record value while adding a new record

$
0
0
Hi
I want to record the kilometers of the vehicle in the program I'm trying to do.
When adding a new record, I want to take advantage of the previous record value and avoid the incorrect entries. As you can see in the link, when adding a new record, the new record must be larger than the last record of the previous record from the first record.
I have no idea how to do this.
I'll be happy if you can help me.

Thanks :rolleyes:

Table

Conditional Text formatting on "VIEW" ASPRunner.NET 9.8

$
0
0
I'm working on a site to store and manage job descriptions, they will be displayed as a VIEW, when a specific value A = 'Y' then I want the text in field B to be Bold Red, if not, normal text.

ASPRUNNER.NET V9.8 on Windows 7 running on an IIS Windows server and Microsoft SQL database

Conditional Formatting all data values become the same

$
0
0
When I add conditional formatting all the statuses are displayed as Registered even though in the database they are different. The code I'm adding is:



if ($SPL_status='Registered')
{
$color="green";
}
else if ($SPL_status='Unregistered')
{
$color="red";
}
else {
$color="orange";
}
$value="<span style='color: " . $color . "'>" .$SPL_status . "</span>";
Viewing all 2520 articles
Browse latest View live