#1 2016-10-07 17:07:07

andy
Member
Registered: 2016-10-07
Posts: 4

Various random questions while evaluating App Builder

hello

i'm about to evaluate you ab software and i have some questions:

1) how can i filter record in array? for example if i have data container and i want filter record for start date and end date before use it in report control

2)how does the required value of input control work? it seem that no popup apper or other event start

3) i was playing with with datetime and save data and i found this bug probably

//this code work and save all data
ObjectSetProp "[NewRecord]" "DYear" "[NewSelectYear.Value]"
ObjectSetProp "[NewRecord]" "DMonth" "[NewSelectMonth.Value]"
ObjectSetProp "[NewRecord]" "DDay" "[NewSelectDay.Value]"

//this code doesn't work and make a mess inside json data container
ObjectSetProp "[NewRecord]" "Year" "[NewSelectYear.Value]"
ObjectSetProp "[NewRecord]" "Month" "[NewSelectMonth.Value]"
ObjectSetProp "[NewRecord]" "Day" "[NewSelectDay.Value]"

3) in agenda example i found this routine, last line shoud be EndLoop or not?

// Iterate all the Report Data records
Loop "0" "[DataLen]" "[I]"

  // Get the current iterated record and their ID property
  ArrayGetItem "[AgendaReport.Data]" "[I]" "[Item]"
  ObjectGetProp "[Item]" "ID" "[RecordID]"

  // If the record's ID is the same we are editing now...
  If "[RecordID]" "==" "[CurrentRecordID]"
  ...
  EndIf
EndIf

4) testing this code i found that total is not the sum of all amount but a string of a concatenated value, i'm i doing something wrong?

SetVar "[Total]" "0" "Number"
...

While "[i]" "<=" "[DataLen]"
  ArrayGetItem "[Report1.Data]" "[i]" "Record"
  SetVar "[HtmlText]" "[HtmlText]<tr><td>[Record.Amount]</td></tr>" "String"
  SetVar "[Total]" "[Total]+[Record.Amount]" "Number"
  inc "[i]"
EndWhile  
...

thx Andy

Offline

#2 2016-10-07 17:19:50

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,659
Website

Re: Various random questions while evaluating App Builder

Hello Andy,

Thanks for your interest in my work at App Builder. I will try now to answer your question one by one, but please, next time open new threads for different questions. And try to be descriptive with your threads' titles. Thanks in advance.

andy wrote:

1) how can i filter record in array? for example if i have data container and i want filter record for start date and end date before use it in report control

You can always iterate an array and prepare another one with already filtered.

andy wrote:

2)how does the required value of input control work? it seem that no popup apper or other event start

The "required" is certainly thinked to be used in forms, but, App Builder doens't use forms at all. Why the attribute then? Because may can be used in other scenarios too. But you can always look for the Input's Change event, for example, and/or validate the Input when ready.

andy wrote:

3) i was playing with with datetime and save data and i found this bug probably

//this code work and save all data
ObjectSetProp "[NewRecord]" "DYear" "[NewSelectYear.Value]"
ObjectSetProp "[NewRecord]" "DMonth" "[NewSelectMonth.Value]"
ObjectSetProp "[NewRecord]" "DDay" "[NewSelectDay.Value]"

//this code doesn't work and make a mess inside json data container
ObjectSetProp "[NewRecord]" "Year" "[NewSelectYear.Value]"
ObjectSetProp "[NewRecord]" "Month" "[NewSelectMonth.Value]"
ObjectSetProp "[NewRecord]" "Day" "[NewSelectDay.Value]"

I can't view any difference except the "D" prefix in the second argument. I can't view a problem in that code. May you can prepare a simple application in order to reproduce the problem here?

andy wrote:

3) in agenda example i found this routine, last line shoud be EndLoop or not?

// Iterate all the Report Data records
Loop "0" "[DataLen]" "[I]"

  // Get the current iterated record and their ID property
  ArrayGetItem "[AgendaReport.Data]" "[I]" "[Item]"
  ObjectGetProp "[Item]" "ID" "[RecordID]"

  // If the record's ID is the same we are editing now...
  If "[RecordID]" "==" "[CurrentRecordID]"
  ...
  EndIf
EndIf

Are you using the latest App Builder release? I am take a look at the Agenda sample, but can't view that mistake in the any of the app's function. Anyway, in the case of the above code, yes, we must end with an "EndLoop" instead the "EndIf".

andy wrote:

4) testing this code i found that total is not the sum of all amount but a string of a concatenated value, i'm i doing something wrong?

SetVar "[Total]" "0" "Number"
...

While "[i]" "<=" "[DataLen]"
  ArrayGetItem "[Report1.Data]" "[i]" "Record"
  SetVar "[HtmlText]" "[HtmlText]<tr><td>[Record.Amount]</td></tr>" "String"
  SetVar "[Total]" "[Total]+[Record.Amount]" "Number"
  inc "[i]"
EndWhile  
...

Try to use the "Math" instead of the SetVar action to perform the sum between [Total] and [Record.Amount].

Hope this can help you in some way Andy. Don't hesitate to post here if you have any further question. Thanks again for your interest and, please, consider to buy one or more App Builder licenses if you find the program useful for you. That's the way to maintain the project well supported and maintained. Thanks in advance for your support.

Offline

#3 2016-10-10 16:36:11

andy
Member
Registered: 2016-10-07
Posts: 4

Re: Various random questions while evaluating App Builder

hello david

thx for you replay, eveerything is clear now, Unfortunately i cannot reproduce the matter that happeded anymore,

i have one more question, what goes wrong with this code, because result isn't correct

NewDate "" "" "[CurrDate]"

DateGet "[CurrDate]" "year" "[SelectedYear]"


DateGet "[CurrDate]" "month" "[SelectedMonth]"


DateGet "[CurrDate]" "day" "[SelectedDay]"


AlertBox "[CurrDate] = [SelectedDay]/[SelectedMonth]/[SelectedDay]" "primary"

Last edited by andy (2016-10-10 16:39:13)

Offline

#4 2016-10-10 16:55:53

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,659
Website

Re: Various random questions while evaluating App Builder

Hello andy,

Please, open new threads when you have new questions. That's the way to maintain the support forum better. Certainly there are some mistakes while using the Javascript library behind some of the actions you refer. I am looking at that and will inform here about any progress.

Thanks for the report andy!

Offline

#5 2016-10-10 17:05:24

andy
Member
Registered: 2016-10-07
Posts: 4

Re: Various random questions while evaluating App Builder

ok i will

thx David

Offline

#6 2016-10-10 17:11:56

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,659
Website

Re: Various random questions while evaluating App Builder

Hello andy,

Yes; In fact the DateGet and DateSet actions have a couple of mistakes in their help references. Basically we must use "date" instead "day" and expect (or set) the month in a range from 0 to 11. This is now refered in the actions' helps in order to avoid your problem. So the code that works as you expected is like the below one:

NewDate "" "" "[CurrDate]"

DateGet "[CurrDate]" "year" "[SelectedYear]"

DateGet "[CurrDate]" "month" "[SelectedMonth]"

Math "[SelectedMonth] + 1" "[SelectedMonth]"

DateGet "[CurrDate]" "date" "[SelectedDay]"

AlertBox "[CurrDate] = [SelectedYear]/[SelectedMonth]/[SelectedDay]" "primary"

App Builder is now updated in order to fix the refered actions' help in addition to other changes, fixes and enhancements. Thanks again for the report andy.

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.