Hi guys! I open this topic to ask you if someone has already faced, and maybe solved, this strange thingh.
Let's start:
1. Create a page ("Custom Page") type (Card or Document) for my example I based it on the table 36.
2. In a Group "General" place some fields
3. Create an action (could do everythingh you want) and set it to promoted
Now I've to launch this page from another page with an action via code (I know that in this simple example I could you use the RunObject property but in my project I can't because I have to launch functions contained in the page before launch it), so I put this code under the OnAction() trigger
CLEAR(TestFocusPage);
... (here I set filters and call functions)
TestFocusPage.RUNMODAL;
all works as expected... but now I have to avoid that user insert a new record from the Custom Page.
So simple I think: InsertAllowed: No. This works but know there's a bad thingh the first promoted action is highlighted because focus point to it (see attachment).
I discovered that this is due to the InsertAllowed set to No and happens only when page is run via code, in fact if run it via Windows Run or from the Object Designer or from the RunObject property of an Action all works.
I tried also simplifying the code but it happens also in this case:
CLEAR(TestFocusPage);
TestFocusPage.RUNMODAL;
Has anyone got an idea?
Many Thx and sorry for the long post!
Edit: version used is Nav2009R2 W1 build 32275
Answers
After many attempts I found that the only way to avoid this is to set the page type Worksheet and set the InsertAllowed to Yes.
In this way the focus point the first textbox in the page and the user didn't insert record in the Sales Order.
Thx!
It works as expected... More or Less...