1,376

(7 replies, posted in Russian)

Здравствуй Agatlogic,
Возможно, попробуйте это так
Derek.

Здравствуйте Konstruktor,
В вашей программе base.id_passenger имеет значение null (см. Screenshot.jpg во вложении).
Я изменил ваш сценарий так, чтобы этот base.id_passenger теперь содержал passenger.id.
Кроме того, menu.editcounter1 не был включен в список полей для сохранения.
Derek.
.
In your program, base.id_passenger is null (see the screenshot.jpg in the attachment).
I have changed your script so that that base.id_passenger now holds the passenger.id.
Also, menu.editcounter1 was not included in the list of fields to be saved.

Hi CDB,
I had a look at your project and there seems to be a lot of script that is replicating functionality that you can achieve using standard MVD.  It may be that you are intentionally doing this so you can familiarise yourself with the scripting language (which is fair enough) or perhaps it's because there are some standard features that you might not be aware of.
With that in mind, I took your project, tried to simplify it, fixed a couple of things that weren't working and then replicated as much of the functionality that (I think) you're after with standard MVD whilst using as few lines of script as possible (in the end, all my script does is colour alternative lines of the grid and pre-populate the 'copy order' fields).
As with most things in MVD, there are a few different ways of doing the same thing, so the attachment is very much some suggestions rather than the 'definitive' way.
Hopefully, it might give you some ideas.
Regards,
Derek.

1,379

(6 replies, posted in Russian)

Здравствуйте Agatlogic, Dmitry, CDB,
Возможно, вы можете просто дважды щелкнуть ячейку в столбце «Женат *», которую хотите изменить (см. Пример), и вообще не использовать флажок.
С Уважением,
Derek
.
Maybe you could just doubleclick on the cell in the column 'Married*' that you want to change (please see the example) and not use a checkbox at all.

Hi Jean,
How's things?
Yes, calculated fields appear in FastReport much like any other field.
I do not have much experience with FastReport and so tend to create my calculated fields in MVD even though I'm sure the actual calculation could be performed within FastReport itself (I just don't know how!).
Regards,
Derek.

Hello Senioke,
Is it just details of the user, date of change, time of change and type of change (add, update, delete) that is made?
Or do you also need to know the specific fields that have been changed and, if so, do you then need to know the 'old' and 'new' values of those fields?
Derek.

Здравствуй Vickus,
Возможно, попробуйте это с вычисленным полем.
(извините, но в моем примере названия месяцев на английском)
С Уважением,
Derek.

Привет Sacha,
Сценарий сложен, когда вы пытаетесь применить все проверки, которые вы должны иметь. Я постараюсь взглянуть, но я сейчас очень занят.
Но вы можете многого добиться, просто используя базовую функциональность MVD и создавая свои формы так, чтобы они выглядели как одна форма с всплывающим окном.
Пожалуйста, посмотрите на приложение с несколькими предложениями о том, как вы можете сделать это с помощью небольшого простого скрипта.
В зависимости от разрешения экрана вам может потребоваться настроить координаты формы 3, указанные в сценарии (см. Прилагаемый снимок экрана).
Может быть, это даст вам некоторые идеи.
С уважением,
Derek.
.
The script is complex when you try to apply all the checks that you must have. I'll try to take a look, but I'm very busy right now.
But you can achieve a lot by simply using the basic functionality of MVD and creating your forms so that it looks like one form with a pop-up window.
Please look at the application with a few suggestions on how you can do this with a small simple script.
Depending on the screen resolution, you may need to adjust the coordinates of form 3 specified in the script (see the enclosed screenshot).
Maybe this will give you some ideas.

Hi Sacha, Petr,
Вы можете использовать только одну форму, но вам все равно нужно будет поместить кнопку «Новая запись» в форму (по этой причине ваши данные не отображались правильно).
Однако, когда вы пытаетесь использовать только одну форму, вы теряете большую часть проверки, которую MVD выполняет автоматически. Затем вам нужно написать эту проверку вручную с помощью сценария.
Derek.
.
You can use just one form but you will still need to place a "New Record" button on your form (which was the reason why your data wasn't showing correctly).
However, when you try to use only one form, you lose a lot of the validation that MVD does automatically.  You then need to write this validation manually using a script.

1,385

(5 replies, posted in General)

Hi Everyone,
You can also just manually type in ANY tablename (in the 'foreign key' property) and ANY fieldname (in the 'fieldname' property) - please see the attached screen shot.
It's quick and easy but obviously it doesn't give you the option to have just distinct records (as Jean's code does) nor does it know anything about the record's "id" (as EHW rightly points out).
Derek.

1,386

(13 replies, posted in General)

Hi Dynapta,
Never having used the roles/users function before, I didn't appreciate what the problem was - nothing to refer to!!
Anyway, I'm wondering if you can get around it by doing it this way (please see attached).  Of course. you could always use a variable instead of adding another text box to the form but I usually do it that way because I like to see what's going on (and then hide the text box afterwards).
I was unable to add any more users to test it thoroughly, so could only show that it worked by using 'admin' but I can't see why it wouldn't be okay.
The only other problem might be if you have multiple users who signed in simultaneously (to the split second!!) which is unlikely.
Anyway, hope this gives you some ideas.
Derek.

1,387

(10 replies, posted in Russian)

Здравствуй Agatlogic,
Создайте переменную с типом «tdatetime» (см. Пример).
Derek

1,388

(10 replies, posted in Russian)

Здравствуй,
Есть разные способы вычислить это, используя скрипт, но я делаю это так.
Derek.

1,389

(10 replies, posted in Russian)

Привет Agatlogic,  (Salut Jean, tu va bien?),
Я думаю, что мы все рассчитываем даты по-разному.
Я всегда стараюсь избегать использования скрипта (не очень часто!), Поэтому вместо этого я использую вычисляемое поле.
С Уважением,
Derek.

1,390

(13 replies, posted in General)

Hi,
If you can attach your project, I can have a mooch around - I guess it has to be in there somewhere!
Derek

1,391

(13 replies, posted in General)

Hi,
I don't have an example with users and roles but the syntax should be the same.
Please have a look at the attached which allows for the username to be either entered in an edit field or selected from a combobox (comment out whichever option you don't use in the script). 
Then the value entered in the sign-on screen carries forward to a new form and pre-fills the combobox with the logged in user.
Derek.

Здравствуйте Mikhail_a,
Возможно, попробуйте что-то подобное (сценарий не нужен).
Derek.

1,393

(17 replies, posted in General)

Hi EHW,
I think your interpretation is much closer to the requirement than mine (I'd assumed every day would be a new 'task list').
But it makes more sense now I've looked at your attachment - in effect, it's a single row table that updates each of the tasks with 'today' when any of the tasks is clicked and then colour-codes them depending on how many days ago that specific task was last ticked.
By the way, really like your
    ShowRecord(Form1, 'Mytasks', 1); 
Never seen it done like that before - I've always used a hidden tablegrid and hidden 'show record' button but it always struck me as being rather crude.
Regards,
Derek.

Здравствуйте Vaskar,
Есть много способов сделать это - пожалуйста, смотрите "screenshot.jpg" во вложении. Я показал 3 разных способа
1. Отфильтруйте сетку таблицы с помощью флажка, чтобы показать итоги в зависимости от состояния флажка.
2. Используйте сценарий для отображения сводки всех итогов.
3. Отображение дополнительных таблиц сетки только с отмеченными или непроверенными строками
Возможно, это дает вам некоторые идеи.
С уважением
Derek.
.
There are many ways to do this - please look at "screenshot.jpg" in the attachment.  I have shown 3 different ways
1.  Filter the tablegrid using the checkbox to show you totals depending on the status of the checkbox.
2.  Use a script to display a summary of all totals.
3.  Display addition tablegrids with only "checked" or "unchecked" rows
Perhaps this gives you some ideas.

1,395

(17 replies, posted in General)

Hello Leprince2007,
In order to achieve what you want, you need to change your table structure.  You currently use checkboxes to show if a task has been completed or not but nowhere do you save the date of completion.  If you don't hold this, then how do you know what date to put into your labels? (you can't derive it from a checkbox because it only holds a value of 0 or 1).  You would need to add a date field for every checkbox that you have (eg excavators checkbox, excavators date etc etc).
Personally, rather than use checkboxes AND dates, I would just use dates for each of your tasks because it tells you all you need to know (if the date has not been checked, the task has not been completed and if it has been checked, you know that it's been both completed AND the date on which it was completed).  Then you just change the label associated with the date fields to show whether the task was completed on time or not.  It's just my opinion but it seems much more straightforward.
Please see the attached suggestion which is a scaled down alternative to your project to see how the label colour coding works in conjunction with the date fields for each task (no colour = on time, green = 1 day late, red = 2 or more day late, yellow = not completed).
Also, your project didn't have any way of retrieving saved records (no tablegrid or combobox to selected a record from and no show record button) so I've added these.
I hope this gives you some ideas to move forward,
Derek.

1,396

(6 replies, posted in Russian)

Здравствуй ABC52,,
Я думаю, что самый простой способ - использовать вторую кнопку поиска (см. Пример).
Первая кнопка поиска (скрытая) выбирает данные в зависимости от фамилии, введенной в поле поиска, и отображает 3 столбца данных.
Вторая кнопка поиска (CLEAR) удаляет критерии поиска и отображает исходный макет таблицы (2 столбца).
Derek.
.
I think the easiest way is to use a second search button (please see the example).
The first search button (hidden) selects data depending on the last name entered in the search field and displays 3 columns of data.
The second search button (CLEAR) , removes the search criteria and displays the original tablegrid layout (2 columns).

1,397

(6 replies, posted in Russian)

Здравствуй ABC52,
попробуй вот так
substr(Db,1,5)||' - '||substr(De,1,5)   
Derek.

Hi Joshua,
I've put a formula into the cflegmileage calculated field - please have a look and see if this solves your issue.  As part of this, I've had to add atrip.id to frmtripdetail.tablegrid1 (but it's hidden with a couple of lines of script).  You also need to explicitly carry atrip.id into frmlegadd (but again, it's invisible).
I also noticed that frmtripdetail.tbtripmileage and frmtripdetail.tbodcf aren't updating when you close frmlegadd - I didn't change them but just thought I'd mention it.
I've not had time to test any of the above so it needs checking (caveat emptor and all of that - LOL!!).
Regards,
Derek.

Hi,
I've added request date and rec_date (both parsed) to the sqlquery button and it seems to be working okay.
Have a look at the attached.
Derek.

Hi CDB, Hi Sibprogsistem,
As Sibprogsistem has shown, you need to remove the tick in the 'Close the Current Form after Saving' option associated with your 'save' button.
You wouldn't normally have to do this but in your example, you are not using a separate form to create an order, you are using a 'tabsheet' within a 'pagecontrol' - but it is all the same form (frmmain) so when you were saving the record, that was the form that was getting closed.
My suggestion would be, once you've clicked the 'save' button, is to return to the 'orders' tabsheet and refresh the orders tablegrid so the user can see that the order has been added correctly (have a look at the script where I've added a couple of lines to do this).
Regards,
Derek.