Attaching a URL to a navision page via SMTP Codeunit

LewisTioga
Member Posts: 40
Hi guys,
We are sending out an automated email via the SMTP mail. In a codeunit I create the email with production Order details, Is it possible via a code unit to get the bookmark for a certain page? I'm currently trying to use recordref.
For example I have I have the following code:
recProductionOrder.RESET;
recProductionOrder.SETRANGE("No.", recProdOrderLine."Prod. Order No.");
recProductionOrder.SETRANGE("Standard Cost Status", recProductionOrder."Standard Cost Status"::"Awaiting Cost");
IF recProductionOrder.FINDFIRST THEN BEGIN
ProdOrderRef.OPEN(DATABASE::"Production Order");
ProdOrderRef.SETPOSITION(ProdOrderRef.GETPOSITION);
I am later trying to get the bookmark for the page I found using the FINDFIRST above by using (ProdOrderRef.RECORDID,0,10). I've found this doesn't retrieve the same value as when you go "Copy Link to this page".
My question is it possible to get the correct url for a page from within a codeunit, if so how, and if not what's the alternatives?
Thnaks - We are using Navision 2013
We are sending out an automated email via the SMTP mail. In a codeunit I create the email with production Order details, Is it possible via a code unit to get the bookmark for a certain page? I'm currently trying to use recordref.
For example I have I have the following code:
recProductionOrder.RESET;
recProductionOrder.SETRANGE("No.", recProdOrderLine."Prod. Order No.");
recProductionOrder.SETRANGE("Standard Cost Status", recProductionOrder."Standard Cost Status"::"Awaiting Cost");
IF recProductionOrder.FINDFIRST THEN BEGIN
ProdOrderRef.OPEN(DATABASE::"Production Order");
ProdOrderRef.SETPOSITION(ProdOrderRef.GETPOSITION);
I am later trying to get the bookmark for the page I found using the FINDFIRST above by using (ProdOrderRef.RECORDID,0,10). I've found this doesn't retrieve the same value as when you go "Copy Link to this page".
My question is it possible to get the correct url for a page from within a codeunit, if so how, and if not what's the alternatives?
Thnaks - We are using Navision 2013
0
Best Answer
-
The solution was:
ProdOrderRef.OPEN(5405);
ProdOrderRef.GETTABLE(recProductionOrder);
ProdOrderRef.SETPOSITION(ProdOrderRef.GETPOSITION);
And then for bookmark use FORMAT(ProdOrderRef.RECORDID,0,10);
0
Answers
-
Watch function "GETURL".
1. Use ur setrange on rec;
2. GETURL with parameters likeCust.Get(10000); url := GETURL(ClientType::Current, 'COMPANYNAME', ObjectType::Page, 21, Cust);
0 -
Thank you but we don't have the GETURL Function on Navision 2013.0
-
LewisTioga wrote: »Thank you but we don't have the GETURL Function on Navision 2013.
I thought u use 2013R2.1 -
The solution was:
ProdOrderRef.OPEN(5405);
ProdOrderRef.GETTABLE(recProductionOrder);
ProdOrderRef.SETPOSITION(ProdOrderRef.GETPOSITION);
And then for bookmark use FORMAT(ProdOrderRef.RECORDID,0,10);
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions