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

Dynamica

$
0
0
I have an Add page which contains address fields, the format and content of the first 2 address lines varies accordingly to the type of accommodation; House, Flat, Hotel, Hostel NFA (no fixed abode). In the JSonload event I have a SELECT CASE on the accommodation type to hide or show the relevant fields and alter the field labels. This is working perfectly.

I've run into an issue by adding duplicate checking in the Before record added event that causes the add page to be redisplayed with error text in $message. I can't find a way to get the jsonload event to hide/show the correct fields. The code below is simplified - in reality I'd need a bit more.

Before Display code: I intended this code to provide the jsonload event whether to hide or show the fields.
// set the session variable if its not defined yet - ie on the first display of the add page only
if (!defined($_SESSION["Hide_addr"]) ){
$_SESSION["Hide_addr"] = true;}
// set proxy variable to HIDE or SHOW - could be true or false but this is easy to detect and debug
if ($_SESSION["Hide_addr"]){
$pageObject->setProxyValue("actype", "HIDE");}
else {
$pageObject->setProxyValue("actype", "SHOW");}

jsonload event code
alert ("Accom " + proxy['actype']);
if (proxy['actype']=="HIDE") {
pageObj.hideField('NumLbl'); pageObj.hideField('NumData');
pageObj.hideField('BldgLbl'); pageObj.hideField('BldgData');
pageObj.hideField('street2'); pageObj.hideField('area');
pageObj.hideField('town'); pageObj.hideField('postcode');}

Before Record added event
// check for NFA and HIDE address fields
if ($values['accom_type'] == "NFA") {
$_SESSION["Hide_addr"] = true;}
else {
$_SESSION["Hide_addr"] = false;}

When the Add page is first displayed the address fields are correctly hidden and they appear dynamically when the Accommodation type is input. But when the add page is redisplayed with the error text the proxy value is always HIDE its never SHOW even though the session variable has been changed.

I've tried a number of other coding solutions which haven't worked but I feel this should work. The alert in the jsonload always displays HIDE so my conclusion is that the proxy values set in the Before record added aren't available to the jsonload and that the before display code is only executed once before the first display of the page.

Does anyone known what the control flow is between events? ie does Before Display always get invoked before the add page is displayed or only before the first display of the Add page.

Thanks in advance.

update end date

$
0
0
I have a start_date field and a number_of_weeks field and would like to update the end_date field in the current record. What is the syntax for that please?

Safe on Edit Page - jump to next record

$
0
0
We want to automatically jump to the next record from the list when on the edit page after saving the actual record. Like the NEXT BUTTON on the Edit page. Anyone has an idea how to achieve this?

Edit assigned fields only

$
0
0
Hi,

I have a table with the positions in a band as fields; Guitar, Bass, Drums and Flute. Also there is a table with the names of all band members. Some play guitar, some play bass, some play drums and some play flute.

I would like for all of them to see all the records but edit only the field of the instrument they play.

Would there be a way to do that?

Thanks,

Best regards,

Jack

error code 256

$
0
0
Hi there,

I have a Master /Detail Table and using PHPRUNNER 9.8
I want to sum value from Detail table(arac_gorev) to Update one field of Master Table(araclar).
Master Table : field Name = toplam_km
Detail Table: Select SUM(kapanis_km-acilis_km) AS toplamkm from Detail

I wrote it;

$sum1 = DBLookup("Select SUM(kapanis_km-acilis_km) AS toplamkm from arac_gorev where FK_araclar = ".$values["id"]);
echo($sum1);
$sql_text="Update araclar set toplam_km =".$sum1." where id = ".$values["id"];
CustomQuery($sql_text);


but I have error message;

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where id = 34' at line 1

pls help me..

Best Regards..

Conditional Formatting based on DATE

$
0
0
Hello to all.
I add the following code into view as > custom option. The field is a date format.

string color;
DateTime rightNow = DateTime.Now;
if (value >  rightNow) {  
color="black";   
}else {   
color="red";   
}  
value="<span style='color: " + color + "'>" + value.ToString() + "</span>"; 


I get this error

include\CustomExpressions.cs(24,30): error CS1955: Non-invocable member 'System.DateTime.Now' cannot be used like a method.
include\CustomExpressions.cs(25,5): error CS0019: Operator '>' cannot be applied to operands of type 'runnerDotNet.XVar' and 'System.DateTime'

Button on Report page. Not able to get data from field.

$
0
0
I have a Report Page. All users report showing on it. I need to update a singal row (users) data. I have added the button but not able to get the user ID from the field. Field is linked to ID and sown as Name on the field.

Posted Image
I need to get data from "Emp Number" to post on the button server quarry.

Not able to do it.

Also can't find the way. Please help me to solve it

row baclground on report page

$
0
0
I have try all the tips and tutorial but all of them are for list page. I need to change color or report page base on a filed data. I have done the text color but was not able to do for the row.

please hep me.

where need t place and which code to flow?

Print Page and Master page

$
0
0
Hello,

I am trying to print on one A4 page Printer-friendly page and Master table info. Got some idea?
Print Page and Master page in one page
Image on link:
Posted Image

Remove edit tab from Dashboard record on selection

$
0
0
I have a Dashboard with two panels:

1. Grid - restaurant.
2. Record - menu.

The grid has a master relationship with the record.

Now, the first shows a series of restaurants. Everytime a row in this grid is clicked, the record menu view changes.

This record may or not belong to the user. In the dashboard record settings I've allowed View/Edit tabs.

In "Advanced security" I've allowed users only to edit only their own menus and to see the rest.

Problem:

If there is a menu, both tabs are allowed. If the second tab (Edit) is clicked on a menu that not belongs to the user, the Edit menu tab shows not the current menu selected, but the last one seen, or a default one.

This can be confusing for users as they may not realise that record doesn't belong to them and that they are changing a different one that's not the one being viewed in the first place.

Bonus: If a menu is "completed", is not editable anymore. Don't show edit tab when "completed" is True.

Solution needed:

Remove the edit tab in the record dashboard when the user doesn't have permission to edit it or $values["completed"] is true.

Tried:

  • In "menu" events Is record editable set $isEditable=FALSE if menu is completed. Result: The View/Edit tabs disappear altogether from the Dashboard.
  • Change "record" for "details" of restaurant (as menu is a detail) in Dashboard. Result: Doesn't work as it shows a list when there is only one possible menu, and the edit/view buttons of the list display popups which are too small and underwhelming.


Thanks.

AD Authentication Questions

$
0
0
1- I set up the IIS and asprunner to automatically login, but it is not working
2- I am not able to see admin panel when I login as Admin. I set up my AD user as admin but not able to see admin sections.

Search Panel wont show for one table

$
0
0
I have one table where the list page wont show the search panel when I click "Show Search Panel", and if I try to hide any of the columns by un-ticking the show/hide columns box nothing happens. All other tables work fine, just one in particular.

I expect I have some formatting or code somewhere that is breaking this, but I'm not sure how I would go about debugging this to try and find the problem? Any suggestions?

Thanks!

Two Tables with calcutated result

$
0
0
I have two tables with a quantity field and quantity-used field.

Table1 [Quantity]
Table2 [Quantity-Used]

When I enter a record in table 2 I want to subtract from the Quantity in table1.

This is an inventory remaining amount.


Thanks
Landon

show/hide lookup wizard checkbox list.

$
0
0
Hi Guys,

On my add page I have a have a field call "qualifications"

This field is set to a lookup wizard of the qualifications table

The lookup wizard is set to a checkbox list, which also allows multiple selection of values.

I have added a javascript onload event to show/hide a field called "qualifications_Other" if "Other" is selected from the "qualifications" lookup wizard checkbox list control.

Here is the javascript onload code:

//Start.............................................................................
var ctrlIvcX841 = Runner.getControl(pageid, 'qualifications');
var ctrlIvcX841T = Runner.getControl(pageid, 'qualifications_Other');

pageObj.hideField("qualifications_Other");

ctrlIvcX841.on('change', function(e) {

if (this.getValue()!= "Other"){

pageObj.showField("qualifications_Other");
ctrlIvcX841T.addValidation("IsRequired");
}

else {

pageObj.hideField("qualifications_Other");
ctrlIvcX841T.removeValidation("IsRequired");
ctrlIvcX841T.setValue('');

}
});
//End.............................................................................

This event works well if the exact value ONLY is selected by the user,

However because the user can select multiple values, if a user selects more than one value from the "qualifications" lookup wizard checkbox list control, the show/hide process is broken.

I was just wondering if possible can I change the operator or something to show or hide the field even if MULTIPLE values ("Other" being the trigger value) are selected in the"qualifications" lookup wizard checkbox list control?

i.e. if (this.getValue()== "Other"){

Many thanks

Auto save on inline add

$
0
0
Hello,

I am using a field event to "auto save" on an add page when a certain field loses focus. I do this in the Client After portion of the field event and use this code:

$("#saveButton1").trigger('click');


It works great on the add page, but now I'd like to implement the same feature while doing an inline add. The "saveButton1" element doesn't exist on the list page while doing an inline add. I inspected the save check mark/button and found it is called "saveLinkX" where X is a session variable, I think. I know from the help file that I can use "var recsId = pageObj.inlineEdit.getRecsId();" to get the list of current ID's on the list page, so I was hoping I could just increment that by 1 to figure out what I needed for the X. But this doesn't work because the number will change if you cancel the add, and then do another inline add.

So is it possible to do an "auto save" on an inline add when you move out of a certain field?

Thanks,
Tim

Javascript onLoad to calculate expiry date

$
0
0
Hi Guys,

I am trying to create a javascript onload event on an add page to calculate on the fly when a students course has expired.

So far,

I have DATE field called "training_Date"

I also have an INT field called "duration_In_Days" (this field contains the amount of days until the course will expire i.e. 190).

My aim is to calculate the future date of which a students course will expire by taking the "training_Date" value i.e. 01/01/2001 and adding the value form the "duration_In_Days" i.e. 250 which would give me a date of expiry

I plan to display the results of this calculation in a "expiry_Date" field.

Using various examples I have cobbled together the following event with no Luck!

I would love to hear your thoughts, Is this possible?


var ctrlDuration = Runner.getControl(pageid, 'duration_In_Days');
ctrlDuration.on('change', function(e){

var ctrlExpiry = Runner.getControl(pageid, 'expiry_Date');

var ctrlTd = Runner.getControl(pageid, 'training_Date');
var d1 = new Date(this.getValue());
var d2 = new Date(ctrlTd .getValue());
var millisecondsPerDay = 1000 * 60 * 60 * 24;
var millisBetween = d1.getTime() - d2.getTime();
var days = millisBetween / millisecondsPerDay;

function func() {

  ctrlExpiry .setValue(Number(ctrlTd.getValue()) + Number(ctrlDuration.getValue()));

};

ctrlDateListed.on('keyup', func);

ctrlQuantity.on('keyup', func);

});



Best wishes,
J

Dates on the same line

$
0
0
I have a table that holds the dates when a sponsor has sponsored the charity and another for the company. I would like to present the dates for the last 6 years on the same line but am struggling with the syntax. Could someone please point me in the right direction?

The syntax I have so far that for each year comes out on separate lines is:

select
SS_S_id,
S_Company_name,
(select '****' from `Sponsor_Sponsorship` B where A.SS_id=B.SS_id and substr(SS_Date,1,4)=substr(curdate(),1,4)-5) '2013',
(select '****' from `Sponsor_Sponsorship` B where A.SS_id=B.SS_id and substr(SS_Date,1,4)=substr(curdate(),1,4)-4) '2014',
(select '****' from `Sponsor_Sponsorship` B where A.SS_id=B.SS_id and substr(SS_Date,1,4)=substr(curdate(),1,4)-3) '2015',
(select '****' from `Sponsor_Sponsorship` B where A.SS_id=B.SS_id and substr(SS_Date,1,4)=substr(curdate(),1,4)-2) '2016',
(select '****' from `Sponsor_Sponsorship` B where A.SS_id=B.SS_id and substr(SS_Date,1,4)=substr(curdate(),1,4)-1) '2017',
(select '****' from `Sponsor_Sponsorship` B where A.SS_id=B.SS_id and substr(SS_Date,1,4)=substr(curdate(),1,4)) '2018'
from `Sponsor_Sponsorship` A,
`Sponsor`
WHERE SS_S_id=S_id
AND SS_id>165
group by SS_id

This is the current results

SS_S_id S_Company_name 2013 2014 2015 2016 2017 2018
673 Whitecross Bakery NULL NULL NULL NULL **** NULL
675 Windsor Castle Bar and Restaurant NULL NULL NULL NULL **** NULL
676 Windwhistle Primary School NULL NULL NULL NULL **** NULL
677 Winnies Bakery NULL NULL NULL NULL **** NULL
678 Winstons Fish Bar NULL NULL NULL NULL **** NULL
679 Winterstoke Decorators Supply NULL NULL NULL NULL **** NULL
680 Worle Glass and Joinery NULL NULL NULL NULL **** NULL
681 WSM Counselling NULL NULL NULL NULL **** NULL
682 WSM Fasteners NULL NULL NULL NULL NULL ****
682 WSM Fasteners NULL NULL NULL NULL **** NULL
682 WSM Fasteners NULL NULL NULL **** NULL NULL



But I would like it like this


SS_S_id S_Company_name 2013 2014 2015 2016 2017 2018
673 Whitecross Bakery NULL NULL NULL NULL **** NULL
675 Windsor Castle Bar and Restaurant NULL NULL NULL NULL **** NULL
676 Windwhistle Primary School NULL NULL NULL NULL **** NULL
677 Winnies Bakery NULL NULL NULL NULL **** NULL
678 Winstons Fish Bar NULL NULL NULL NULL **** NULL
679 Winterstoke Decorators Supply NULL NULL NULL NULL **** NULL
680 Worle Glass and Joinery NULL NULL NULL NULL **** NULL
681 WSM Counselling NULL NULL NULL NULL **** NULL
682 WSM Fasteners NULL NULL NULL **** **** ****


It would also be good to get rid of the NULL's

Inserting data from multiple queris into print and list page

$
0
0
Hello,

i am trying to insert / print out data from multiple queris on List and Print page, but i am stuck with it.

Multiple queries are working properly, no issues there.
For example:

I have a list page where i get a record from db and i do additional query on that list page which is based on the record collected before.

How do I print out the result of the 2nd query into the template and print page?

Thank you

Old value on 'change' field event

$
0
0
Is is possible to obtain the old value of a field when a change field event fires?

and (subtle difference)

When a field is changed for a 2nd or subsequent time, can the change field event obtain the original value?

Thanks in advance

changing background

$
0
0
Why is this not working? It colors all fields with green. I just want the fields that are true. The [have] field is a boolean. So if true(1) want green if false(0) want white.

if ($data["have"] = True)

$record["have_css"].='background:#98FB98';

else

$record["have_css"].='background:white';
Viewing all 2520 articles
Browse latest View live