Hi.
I am trying to migrate a classic app to the RTC. I have a List-Form which opens a Card-Form when "New Record" is clicked and preinitializes the Card-Form with some Data. My Problem now is, that I can't seem to handle the click on the default "new" Button which is displayed on List-Forms in order to write my Data to the Card. Does anybody have an idea?
thanks in advance.
0
Comments
:whistle:
The problem is, that the list form is used in two different ways:
1. just to see all entries
2. filtered to see all items related.
When it is open in the second way and I want to add a new item it must set some fields in order to create the relation. If you have any idea on how to achieve such a thing without any code in the form I would appreciate it.
The only way I could think of is to create a page/form where I manually create buttons + code to view/create a row. I don't like this solution though and I beleive, that there must be a way that is nicer.
I also thought to use the table, but I don't have the record that is passed to the card when new is clicked, so that I cannot preset any fields there.
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
I have tried putting the filter in filtergroup 2 and verified it through a message in the card page. Sadly I have no luck.
I have put a message in the onopenpage-trigger to print the filter and the group and I noticed a strange behaviour: When the page is opened at first the desired filters are set in group 2. Right after the first messagebox pops up a sencond messagebox pops up showing an empty filter.
It seems, that the page is opened with the correct filters, after which the filters are deleted and the triggers are executed again.
[edit]
I also think, that filling fields by filters is only possible, when the fields to be filled are in the primary key, right?
[/edit]
Add action in the list page.
RunFormMode - Create
Image - NewDocument
Promoted - Yes
PromotedCategory - New
PromotedIsBig - Yes
RunFormView - Filter the fields you want to set (ex.: WHERE(Template=Yes) )
In the card page in the OnNewRecord Trigger call
xRec.FILTERGROUP(3);
tmpStr:=xRec.GETFILTERS;
In my case the tmpStr='Template=Yes'
btw. it depends on language. In german tmpStr='Template=Ja'
now you can parse the tmpStr and set the fields of your choice.
This is not handling of the standart New action but is some solution.
I have created two new pages, a list page and a card. When looking at the list and the user wants to create a new record, they select the new button in the RTC. When the card is opened for the new record, I have several fields I want to default from the previous record. How do I get this to work in the RTC?
I actually got this working on the list form (not quite sure how it did it) and I can create a new record directly on the list form, but when I open the card with the New button, I cannot get any defaults to populate.
A little help please?
I try to default the value for some field based on the filter apply on the List Page. However i found that the automatic New Action only honored the filter if I run the filter the List Page using RunFormLink Property. I try to use Filter Group 2 on Open Page Trigger but it seems this filter is ignored by the Automatic New Action.