Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all 10032 articles
Browse latest View live

How to merge excel cell from excel buffer in 2016 nav.


Update a Field of the current Key

$
0
0
Hi experts

When updating a Field of the current Key (not the primary key) I feel a bit strange. :o

Have a look at that Code
TestRec.SETCURRENTKEY("First Name");
TestRec.SETFILTER("First Name",'M*');
MESSAGE('No. of Records to modify %1',TestRec.COUNT);
IF TestRec.FINDSET THEN REPEAT
TestRec."First Name" := 'James';
TestRec.MODIFY(FALSE);
NoOfModifyRecords += 1;
UNTIL TestRec.NEXT = 0;
MESSAGE('No of Records modified t %1',NoOfModifyRecords);

Depending on the underlying data, there might be 5 Records to modify, but the loop is exited after the first one.

Many times I've seen code, using a 2. instance of the same record, doing the MODIFY on that 2. instance.
Not bad, but how about using the parameters for FINDSET?
This seems to work like a charm. Any caveats with that? Help for the FINDSET function is IMHO a bit hard to understand.
Btw: I know I could have used MODIFYALL, but just for that simple example.

TestRec.SETCURRENTKEY("First Name");
TestRec.SETFILTER("First Name",'M*');
MESSAGE('No. of Records to modify %1',TestRec.COUNT);
IF TestRec.FINDSET(TRUE,TRUE) THEN REPEAT
TestRec."First Name" := 'Cindy';
TestRec.MODIFY(FALSE);
NoOfModifyRecords += 1;
UNTIL TestRec.NEXT = 0;
MESSAGE('No of Records modified t %1',NoOfModifyRecords);

Thanks a lot for your help.
Thomas

Finding all Custom Try Functions

$
0
0
Hi All,

This is a long shot, but I thought I would ask.

Currently we have this property DisableWriteInsideTryFunctions set to False on our NST's.
This is because in the past we have incorrectly implemented Try Functions which modify/insert data into the DB.
I would now like to refactor these functions to use IF Codeunit.RUN instead.

To do this, I would ideally like to get a list of all the Try Functions in our Objects.
I am just wondering if there is a way to do this, I have checked PRISM and there doesn't seem to be an option to find just Try Functions.
The only other option I can think of is to write a Powershell Script to analyze the objects and return the procedure names with the object ID.

Has anyone done this previously, or does anyone have a suggestion?

Thanks.

Nav 2017. Problem executing tasks from the queue navision.

$
0
0
Hello colleagues!

I have navision 2017, cumulative update 11, build 18609,
virtual machine in Azure: D2, 7Mb RAM
Windows Server Datacenter 2016.
Ms sql server 2016 standard, ms office 2010

Installed:
Service DynamicsNAV100. A default installation. Not in the domain, no AD.
The service starts under NETWORK SERVICE.
Navision Application Service (NAS) named NavBatch. Starts under NETWORK SERVICE.

The problem is that when the NavBatch executes the job from the navision queue error occurs:

Server instance: NavBatch
Category: TaskScheduling
ClientSessionId: 00000000-0000-0000-0000-000000000000
ClientActivityId: 00000000-0000-0000-0000-000000000000
ServerSessionUniqueId: 00000000-0000-0000-0000-000000000000
ServerActivityId: 00000000-0000-0000-0000-000000000000
EventTime: 11/10/2017 22:59:38
Message <ii>(PrincipalServerDownException): <ii>The server could not be contacted.
ExceptionStackTrace:
at System.DirectoryServices.AccountManagement.PrincipalContext.ReadServerConfig(String serverName, ServerProperties& properties)
at System.DirectoryServices.AccountManagement.PrincipalContext.DoServerVerifyAndPropRetrieval()
at System.DirectoryServices.AccountManagement.PrincipalContext..ctor(ContextType contextType, String name, String container, ContextOptions options, String userName, String password)
at System.DirectoryServices.AccountManagement.PrincipalContext..ctor(ContextType contextType)
at Microsoft.Dynamics.Nav.Runtime.NavUser.JoinUserGroupsWith(IdentityReferenceCollection listOfGroups, ContextType typeOfGroups)
at Microsoft.Dynamics.Nav.Runtime.NavUserAuthentication.AuthenticateTaskSchedulerCredential()
at Microsoft.Dynamics.Nav.Runtime.NavUserAuthentication.Authenticate()
at Microsoft.Dynamics.Nav.Runtime.NavUserAuthentication..ctor(NavTenant tenant, NavClientCredentialType authenticationType, UserType userType, Object token, String userName, String authenticationKey, String authorizationCode, IAzureADGraphQuery azureADGraphQuery, Func`1 getWindowsIdentity)
at Microsoft.Dynamics.Nav.Runtime.NavTenant.Microsoft.Dynamics.Nav.Runtime.ITenantSessionHandler.CreateTaskSchedulerSession(Guid userGuid, String userName, TimeZoneInfo timeZone)
at Microsoft.Dynamics.Nav.Runtime.NavTaskScheduler.TaskRunInfo.InternalRun()
CallerStackTrace:
at Microsoft.Dynamics.Nav.Runtime.NavTaskScheduler.TaskRunInfo.InternalRun()
at Microsoft.Dynamics.Nav.Runtime.NavTaskFactory.<>c__DisplayClass1_0.<RunTask>b__0()
at System.Threading.Tasks.Task.Execute()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
at System.Threading.ThreadPoolWorkQueue.Dispatch()

</ii></ii>
ProcessId: 4284
Tag: 00000B4
ThreadId: 11
CounterInformation:

The job fails, its status is Ready and not scheduled.
Services DynamicsNAV100 and the NasBatch was running and under the user .nas. The result is the same.
.nas - local admin, sysadmin sql server, navision user with SUPER rights.

Can anyone suggest a reason? Dealing with the issue for 2 weeks (
Thanks.

How to Merge Excel cell when exporting excel buffer nav 2016

$
0
0
I am trying to merge two cells in excel by excel buffer in NAV 2016. I used this link "https://forum.mibuso.com/discussion/66511/how-to-merge-excel-cells-in-nav-2016-with-dotnet-variables&quot; but i m having a issue.
I can't find this function in NAV 2016 "XlSheet.Range('A1:A2').Cells.Merge;"
I used this link "https://saurav-nav.blogspot.in/2012/05/navision-export-to-excel-with-merge.html&quot; too but here also i am having the same issue- " XlWrkSht.Range(FromRec.xlColID + FromRec.xlRowID + ':' + ToRec.xlColID + ToRec.xlRowID).Merge;"
I think this issue is for NAV 16.

So please i need help to merge Excel cells in NAV 16.

Cash flow to g/l

$
0
0
In NAV2015, is it possible to create entries on g/l based on cash flow forescast/worksheet?

Nav 2016 - Installation problem (SQL Server instance exists but....)

$
0
0
Hello,

I'm facing problem with nav 2016 installation. I've just installed new SQL Server and next I wanted to install NAV 2016 on that. The question is about Server Instance, I don't want NAV to install Sql 2014 express just use that server which I installed previously (2016). I'm leaving the Sql Server Instance field empty to use the default instance (MSSQLSERVER) but after pressing Apply I'm getting an error:

db1q1hoccezg.png


Can you guys help me somehow? I don't want to install 2014 because I'm facing some .NET 3.5 issues and I can't even install that; 2016 and the 4x framework works correctly.

Report 10062 - Customer Top 10 List

$
0
0
Hi everyone,

Just wondering if anyone has any idea how I can get this report modified to show say the top 1000... you can go up to 99 but once you go 100+ there is a max. Looking at the code and I can't find anywhere I can easily change the max to be 1000. Any guidance or hints would be greatly appreciated.

Thanks

Warehouse Pick for Sales vs. for Production Orders

$
0
0
Hello,

On a Directed Put-away and Pick location, is it possible to tell Navision to Pick Items for Sales from one Location and Pick Items for Production Orders from another location?

In our customer scenario, they have a front face picking area, with a high bin ranking, because they want to pick from there first; however they don't want raw-material to be picked from the front face picking if they're going to use that for production. For production, they want to use items from a bulk/storage area.

Is there any out-of-the box solution for that?

Thanks, regards,

Post multiple Line in One shot

$
0
0
Dear Sir,

I have created multiple Lines thru code & now I want to Post the same in a Single Shot thru code itself.
How to Do it ?

Code given below for your review.
IF RecordAVR.FINDSET THEN
  REPEAT
    GenJnlLine2.INIT
    ....
    ....
    ....
  UNTIL RecordVAR.NEXT =0;

CODEUNIT.RUN(CODEUNIT::"Gen. Jnl.-Post Line", GenJnlLine2);  //GenJnlLine2 has multiple Lines

The above code posts only the First Line. What is the issue in the above code.
Kindly reply.

Regards,
navuser1

Full screen for IOS and Android App or Web

$
0
0
Hi,

Can top and bottom be removed from App or Web page? We want save space for small devices.

Exchange rate service is getting yesterday date

$
0
0
Hi.
I setting ups the exchange rate service using the default yahoo.

When I click update, it return starting date as yesterday date. Is this correct?

<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng&quot; yahoo:count="1" yahoo:created="2017-05-16T09:04:40Z" yahoo:lang="en-US">
<results>
<rate id="SGDMYR">
<Name>SGD/MYR</Name>
<Rate>3.0933</Rate>
<Date>5/15/2017</Date>
<Time>4:20pm</Time>
<Ask>3.0943</Ask>
<Bid>3.0933</Bid>
</rate>
</results>
</query>
<!-- total: 6 -->
<!--
prod_sg3_1;paas.yql;queryyahooapiscomproductionsg3;d71ff55b-2f7e-11e7-b30d-9cb654822760
-->

Thanks

how to create Purchase Invoice using import process

$
0
0
One header record and all the available rows will be invoice lines.

Contact in NAV

$
0
0
Hello,
When you create a Customer, by default you also Create a Contact "Type" "Company".
For several reasons I need the same contact to also be in my field "Contact Name." on customer card. This field won't populate unless you go to Contact List and create manually the same information as "Type" "Person" and link to that same "Company No". This is a lot of creating to do manually.

Here is my question, how can I create my Contact as "Person" to the same Company automatically. Is there a way to do this automatically?
I have done a lot of research and I am not able to find anything useful.

Thanks

Permission denied in NAV 2017 phone client

$
0
0
I have installed and configured the NAV 2017 phone client. It works for me on IOS as a super user but when normal users with limited permissions login they just get "Permission denied". When they launch the standard RTC client everything works fine.

Can anyone please tell me where to find more information about what tables etc they lack permission to when running the phone client?
Also where do I set which rolecenter they should use on the phone client, can it be a specific rolecenter for when they connect using phone?

Difference between duration time

$
0
0
In a report I have to calculate the sum of differences between the duration of two elapsed times...

Example:
Time_1 From: 09:00 Time_1 To: 10:00 = elapsed: 01:00:00
Time_2 From: 13:00 Time_2 To: 14:00 = elapsed: 01:00:00
____________________
Sum: 02:00:00

How can I have the Sum? When I try it gives me #Error ...

Thanks!

Send string directly to a printer with interop

$
0
0
Hi guys,
I need to directly send a string to a printer (a zebra, but it's not that important) through .net interoperability. I dug internet but what i found is this c# that i am not able to translate into nav, because there's the PrintPage event that i don't know how translate in nav. Any clue?

public void Print(string PrinterName)
{
PrintDocument doc = new PrintDocument();
doc.PrinterSettings.PrinterName = PrinterName;
doc.PrintPage += new PrintPageEventHandler(PrintHandler);
doc.Print();
}

private void PrintHandler(object sender, PrintPageEventArgs ppeArgs)
{
Font FontNormal = new Font("Verdana", 12);
Graphics g = ppeArgs.Graphics;
g.DrawString("Your string to print", FontNormal, Brushes.Black, xpos, ypos, new StringFormat());
}

Just for the record (techy stuff): why doing this stuff instead of printing a report with a single textbox to the desired zebra printer?
because i need to get this work on a webclient. Althought i worked around the fact that "webclient only prints to pdf if there's no request page" through a STARTSESSION command, i found out that doing a "REPORT.PRINT(.....)" in a start session prints a pdf and then sends the pdf to the desired printer. This screws up the text in my textbox and my zebra prints zpl code instead of the correct label.

Web Client and Web.Config settings

$
0
0
Has anyone actually got the "Link" settings in the web.config to work recently? We have the following in the web.config.

I have set mine as below for testing.

When I go to the login page I only see the Privacy link in Dynamics NAV Web Client and none of the others. The Privacy one does link to mibuso so I know this config is being referred to somehow "under the hood" :)

<add key="FeedbackLink" value="http://forum.mibuso.com&quot; />
<add key="CommunityLink" value="http://forum.mibuso.com&quot; />
<add key="PrivacyLink" value="http://forum.mibuso.com&quot; />
<add key="LegalLink" value="http://forum.mibuso.com&quot; />

Feedback, Community and Legal never appear.

The documentation on MSDN also mentions a ForgotPasswordLink which I do not see in the Web.config.

https://msdn.microsoft.com/en-us/library/hh168732(v=nav.90).aspx

I have added it as per the below but still no joy with getting this to appear at all on the sign in page.

<add key="ForgotPasswordLink" value="http://www.bbc.co.uk&quot; />

Anyone else have experience with this, as it seems quite simple but does not seem to work. I am on NAV 2017 latest CU.

Thanks in advance,

Ade

Dynamics NAV Universal App barcode scanner

$
0
0
Hi there guys

Does any one have experience with infrared barcode scanners in Universal App. I have a Honeywell device with windows embedded 8.1. This device have demo application for scanning barcodes. But the barcode does not working in Dynamics NAV ... The demo application does not work in background so I can't to use barcode scanner when application is minimized. Is there any way to "wakeup" barcode scanner in Universal app.

Please for help

Best regards

Reading XML file from HTTP

$
0
0
Hi everyone,
I'm finding an issue with the objects involving ain a routine i am cerating for reading an XMl file from an HTTP request. here is the part of the code:
IF ISCLEAR(locautXmlDoc) THEN
   CREATE(locautXmlDoc,FALSE,TRUE);
locautXmlDoc.load(XMLHTTP.responseXML);
CREATE(xmlNodeList, FALSE, TRUE);
xmlNodeList := locautXmlDoc.getElementsByTagName('CONNUMBER');

The code fails when it tries to create the xmlNodeList variable, with this error:

6fuc8mhdsliy.png
Cannot create an instance for the automation server with CLSIF ={XXX-XXXX}

I have to say that the HTTP call has a response, that can be seen with the Fiddler (courtesy of @Slawek_Guzek )
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><document><CREATE><CONREF>15D</CONREF><CONNUMBER>GE158487071ES</CONNUMBER><SUCCESS>Y</SUCCESS></CREATE></document>

What I'm doing wrong in the creation of the NodeList?
Thank you very much
Viewing all 10032 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>