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

OData Web Service with TempTable - return value without insert [AL]

$
0
0
Hi,

What I am trying to achieve is quite simple. I would like to expose a page as a web service using odata. The web service is not supposed to do any insert to any table, I just want to do a simple calculation and return a value. I'll do some quick coding below to illustrate.

The only conditions that I have are:

* Not use new API.
* No insert to any table.
* Use ODATA
page 50000 "Example Web Service"
{
    PageType = Card;
    SourceTable = "TempBlob";
    SourceTableTemporary = true;
    DelayedInsert = true;

    layout
    {
        area(Content)
        {
            group(GroupName)
            {
                field(InputValueOne; InputValueOne) // User will provide this value in the request
                {
                }
                field(InputValueTwo; InputValueTwo) // User will provide this value in the request
                {
                }

                field(ReturnValue; ReturnValue) // I want to do some things in code and assign value to this variable and return it.
                {
                }

            }
        }
    }

    trigger OnInsertRecord(Belowxrec: Boolean): Boolean
    var
    begin
        // Simplified code, but basically, I want to do stuff and assign a value to ReturnValue and return it in the odata response.
        ReturnValue := 'Example Return Value';
    end;

    var // Global variables
        InputValueOne: Text;
        InputValueTwo: Text;
        ReturnValue: Text; // Will contain a long Base64Encoded string.

}


// Below is not included in page, just sample json request body.

Example Request:

{
    "InputValueOne": "Example",
    "InputValueTwo": "Example Two"
}

Example Response:

{
    "InputValueOne": "Example",
    "InputValueTwo": "Example Two",
    "ReturnValue": "" // This is always empty regardless of what I do to the variable in trigger OnInsertRecord.
}


So, any recommendations on how to do it? I can easily achieve this using a codunit and soap, but it is not of interest in this case.

NAV 2016 - Role Center and Menusuite won't display a page action / page menuitem

$
0
0
Hi,

I created a new page (type worksheet). The page is based on a temporary table in our unlicensed range. I'm using the feature that allows tables outside the license range to be used as temporary tables.

When I added this page action to a Role Center page, the page would not appear in the Role Center. After messing around with it quite a bit, I recreated the page from scratch (it was originally copied from another page object). Now, the page will appear in the Role Center.

I then went to place it on the Departments menu by adding an item to Menusuite 1090. No matter what I do, this new page will not display. If I change the page object being called in that particular menu option, the menu option appears OK. As soon as I change it back to my new page, the page menu option disappears.

Does anyone know of any strange "rules" as to whether a page will appear in a menusuite? Is it filtering on licensed objects, and that is the problem?

We're running NAV 2016 CU32.

Thahnks

Ron

NAV 2018 Copy Company

$
0
0
Hi,

When I try to copy company in NAV2018 I get the error message

"The following SQL error was unexpected:
Invalid Object name 'dbo.XXX$MS - C5 CustTable'

I read somewhere else this has to do with V2 extensions and that the solution is to uninstall the extension and try again. Yes it kind of works but you enter a whole new world of hell trying to backup and restore data between environments.

Oh, and sometimes it just works.

Any ideas?

Warning: Calling DimensionManagement.GetDimensionSet with non temporary record!

$
0
0
Seriously, why is there not a check for TempDimSetEntry.ISTEMPORARY in this function!
Luckily this happened on a DEV database where a company is quickly restored.
It completely wiped the contents of the dimension set entries.

BC Sandbox cannot publish extension.

$
0
0
Hi,

I'm trying to publish a new version of my extension to a BC sandbox environment. When I publish it (ctrl+f5) I get the following error:
The request for path /v1.0/sandbox/dev/apps?SchemaUpdateMode=recreate failed with code 422. Reason: The Extension cannot be unpublished because it is required by the following apps: xxx

but I cannot find xxx in the list of my extensions:
tpf86qrotdos.png

In fact, I cannot even see the old version of my extension in the list.

The only solution I can think of for this would be resetting the sandbox. I don't really want to do this but I will if I must.
Does anyone have any ideas what is causing this?
My main worry is if this happens in a live environment I will have no way of fixing it.

How can I manage PDF from business central Cloud version (no onPremise)

$
0
0
I find the way to solved onPrem but I would like to know If theres any way to do it in the cloud.

Thanks,

I am getting below error while running report having saveaspdf function

$
0
0
An I/O exception occurred during the operation.

Subcontracting with Multiple Purchase Orders

$
0
0
When the subcontracting worksheet is run it creates one purchase order. When it is run a second time, I was hoping to create a second purchase order, this would allow us to send items to a subcontractor on a monthly basis and they be aware the stuff is coming in advance. Sadly Nav 2013 will not allow me to create a purchase order or add lines to the current order for more than one drop?

Regards

Page action triggers a save record, leading to duplication of functionality

$
0
0
I'm hoping this is a common issue, but I haven't been able to find anything on this topic.

I have added a page action to the Customer page for performing an operation. I have also added an event that triggers when a Customer record is modified. This event performs the same operation as the page action on the Customer page. The problem here is that if the user changes something on the Customer page, and then clicks my action, the operation is performed twice. This seems to happen because when a page Action is executed, NAV triggers a modify on the Customer record and then executes the action. Is there any easy way to avoid this duplicate operation?

Mail.NewMessage(..)

$
0
0
Hello, Good day.

Why is Mail.NewMessage is sending 2 emails with the same message? is there any way on how to send 1 email using Mail.Message?

here is my code:
Mail.NewMessage(...);
Mail.Send;
MESSAGE('Mail Sent');

Global Dimension to a custom table

$
0
0
Hi All,

Any one knows how to put/set a global dimension from general ledger setup in a custom table ? any article I can read or sample? thanks in advance guys :)

Capture Customer Signature in NAV 2017

$
0
0
Hi everyone,
One of our customers has a request if we could figure out a way of signing a .pdf file and saving it to a directory on the Server. We have a Rental module, so each time a Client is getting his stuff from the Rental Store they have to sign some documents.
In the Rental Store there are POS Terminals with touch screens and one of the ideas was for the Client's signature to be captured there and saved as a image.
I've found one solution
https://blogs.msdn.microsoft.com/nav/2014/10/09/extensibility-for-the-microsoft-dynamics-nav-tablet-client/

I found it already developed so I just downloaded the objects and imported them.
It is working great with a mouse, but when using a finger or a pen the window is moving(even if in full view mode) and is not really user friendly.

I've googled quite a lot and i could not find anything that would work for me, because there is no step by step integration tutorials which is the hard part for me.
I've found some information about DocuSign, but i could not find a way to integrate it.
I've installed Adobe Sign on my computer, but this one is related with creating a Web Service or API to send the document from NAV to Adobe Sign, which will take me really a lot of time to develop.

Edit: I forgot to mention that the solution is on-premise, not cloud. I've watched Adobe Sign video about Dynamics 365 CRM and it won't help.
Is there anyone who have encountered similar issue and has found a development that would like to share.
Kind Regards,
Dimitar

XML Tags Get inverted

$
0
0
Hi Experts,

I have an issue with XML tags

in correct version of XML , the tags are correct in order like below

<Header>
<Data>
<TramissID>
<CountryID>IT</CountryID>
<Pincode>08973230967</Pincode>
</TranmissID>
<ID>01269</ID>
<Code>FPR12</Code>
</Data>
</Header>

But in Some Case based on condition

the Tag are getting reversed

<Header>
<Data>
<ID>01269</ID>
<Code>FPR12</Code>
<TramissID>
<CountryID>IT</CountryID>
<Pincode>08973230967</Pincode>
</TranmissID>
</Data>
</Header>

The above reversed Tags is wrong.

it has to be in the order like correct version.

Why this happens ?
Could any one suggest?

Random Inventory

$
0
0
Hi all, i'm using Dynamics NAV 2016 and my goal is to use Report 790 (Calculate Inventory) to make monthly inventories.

It should generate a random maximum number of products for the user to check.

In the InsertItemJnlLine function I created a variable that counts the number of rows after the journal entry:
...
INSERT (TRUE);
Count Lines: = Count Lines + 1;
...
Then at the end I put the following code:

IF (Count Lines> NumberProducts) AND (NumberProducts <> 0) THEN
BEGIN
CurrReport.BREAK;
END;

Where NumberProducts is the variable that chooses the quantity of products to be inventoried.

But this will only show the number of products I've bound, and does not traverse the table item randomly, this is my first difficulty.
Another difficulty is:
Imagine that 50 products are chosen each month. How do I avoid these 50 products being "chosen" next month.
I thought about creating a variable in the item table, where whenever this report runs, that field is populated with the date and then only apply the filter if that field is empty. Is this acceptable?

interesting inventory value mismatch

$
0
0
Let's define inventory value at the current time, without date filters as the sum of the cost amount actual of all item ledger entries. A bit oversimplifed because you should really use value entries, but without date filters, for current time it works.

Let's also determine the age of the stock. This can be done as taking all Open item ledger entries, with remaining quantity not zero, and calculating the remaining value on stock as (remaining quantity / quantity) * cost amount actual. And the posting date of these entries gives you the age of the stock. And sum it up. In all normal cases this will match the above. Because it should.

Now I have a case when it does not match. I have run adjust costs which ensures all outgoing entries are valued from incoming entries. I also ensured no weird shenanigans like negative remaining quantity happened. What the heck could be the reason? The quantity matches, i.e. sum quantity = sum remaining quantity.

It's stuff we did not sell for over a year, just sitting in a warehouse so people don't even remember if any weird thing ever happened during posting that could give me a clue.

Import-NAVdata taking up a HUGE amount of space

$
0
0
Hi

I have a NAV 2015 navdata file that I extracted from the LIVE system at customer site.
When I try to import this on my developer server using the exact same version on a SQL 2016 the database grows to enormous sizes.

the navdata file is 2.8 GB - a fairly small database.
I have tried all sorts of things - currently the import is working on import of company no 2 from that file and the database file (.mdf) has grown to 85GB and the transaction log has grown to 15GB - and is has been running for quite a few hours now.

These sizes make absolutely no sense to me.
If i do the same import job on a SQL 2012 - it runs smoothly - no big issues, database files or long import times.

Have anybody experienced this kind of behaviour on SQL 2016 and knows which properties or settings to tweak to make the import work?

Reverse implementation best practices?

$
0
0
A normal implementation is where you have a company with established processes and implement NAV for it. A reverse implementation is founding a new subsidiary: you already have NAV, so the new company will use it too, but they do not exist yet, no processes, no employees hired etc. how do you do an implementation in that stage?

I mean, imagine a very typical case, a sales office type subsidiary, selling in a foreign country. The starting "kit" is one person doing order processing the other doing accounting. You cannot just have them sit there and pay a salary for no work, so you have to do the implementation before you hire them. And you can assume there are no processes as such, simply you have to do the basic legal and minimal business requirements, the order processor must be able to issue invoices, book in receipts, check stock, the accountant book in purchase invoices and payments, make a balance sheet etc. but you have not hired them yet.

How do you deal with such a situation?

I did one such project that did not work too well. I started from the assumption that the most important thing you need to get right is taxes, VAT, because that carries the biggest fines. But my local NAV partner was unwilling to give me a standard typical VAT setup for that country, saying they can set up anything but we must say what, and my local tax advisor / auditor could give only the expected result but not the details. And I had no local accountant yet who would connect the two. I was pretty much pulling my hair out. I just wanted a basic locally acceptable setup so that when we hire an order processor and he starts firing invoices they are not wrong. ##

Similarly I needed a basic Chart of Accounts just to be able to get started posting invoices. Ask local NAV partner. They say everybody has a different one again our accountant has to tell them what we want. Aaargh we have no accountant yet. OK whatever, I googled around and found a local government approved Chart of Accounts. Imported. Made basic settings. Hired accountant. Turned out it was the wrong CoA that did not reflect recent legal changes, but of course he found that only after many postings were done so we could not just delete and import the other one. Aaargh.

In short it seems very hard to do a subsidiary implementation BEFORE local staff is hired. My question is, is this how you see it, basically just tell the management yes we have to pay people in the new subsidiary for a month or two without doing any sales while we do the implementation? Or find a better local partner who has a good basic preconfigured starter package? (Microsoft's isn't, I saw in the recent German VAT Setup there was not even EU Service set up separately.)

Nav report rdlc hide data

$
0
0
I have a nav report with a data item called code I want to hide some values populated from this data item only to have distinct ones.
As per the picture all the values come from data item called code i.e ADV-BONUS1','ADV-BONUS2','ADV-BONUS3','ADV-BONUS4','ADV-BONUS5','ADV-BONUS6 how can I hide them plus discription and the amounts they have.

Job in Queue dont run automatticaly

$
0
0
Hi everyone,

I'm new in the "job world" of navision. I'm using nav 2016 and we have a job in our system (table job queue entry) which run's a code unit every day of the week except saturday and sunday.

zjvfh2046os0.png


In the log table (job queue log entry) i can see that this job only run 4 times since it was created, and not every day...
I can' figure why is this happening..

az11aktu5n17.png

I read some stuff about server and client must be in the same domain, which is my case.
The user who created the job (not the admin) must have permissions, I guess he has..
I can't find any error / info in the event viewer of this specific job..


Codeunit 50001 code
OnRun(VAR Rec : Record "Job Queue Entry")

// >> type
//inParams := 'BankRec=10;'; // for tests
inParams := "Parameter String"; // >> for production
type := GetParametersType(inParams);

 // >> register in log
CreateLog(Rec, type, 'Starting', inParams, TRUE);

IF type = 'BankRec' THEN
BEGIN
  GetParametersSimple(inParams, params);
  
  IF EVALUATE(varAsInt,params[1]) THEN
    BankAccReconciliation(Rec, varAsInt);

END;

BankAccReconciliation(inJobEntry : Record "Job Queue Entry";inMarginDays : Integer)
// DELETE OLD LOG ("in progress" & <= 7 days)
DeleteOldLog(7);


BARec.SETCURRENTKEY("Bank Account No.");
//BARec.SETCURRENTKEY("Bank Account No.", "Statement Date");
//BARec.SETRANGE("Statement Date", inStartDate, inEndDate);

Count := 0;
CountExec := 0;
LogMessage := '';

IF BARec.FIND('-') THEN
REPEAT
  IF ((BARec."Bank Account No." <> xBARec."Bank Account No.") AND (xBARec."Bank Account No." <> '')) THEN
  BEGIN
    CreateLog(inJobEntry, 'BankRec', xBARec."Bank Account No.", LogMessage, FALSE); // >> register in log (last BAR)
    LogMessage := '';
  END;

  LogMessage += BARec."Statement No." + '; ';

  BARec.MatchSingle(inMarginDays);

  Count := Count + 1;

  xBARec := BARec;
UNTIL BARec.NEXT <= 0;

CreateLog(inJobEntry, 'BankRec', xBARec."Bank Account No.", LogMessage, FALSE); // >> register in log (last BAR)
CreateLog(inJobEntry, 'BankRec', 'Finished', 'Total: ' + FORMAT(Count), TRUE); // >> finish

LOCAL [TryFunction] CreateLog(inJobEntry : Record "Job Queue Entry";inType : Text;inMessage1 : Text;inMessage2 : Text;isFinish : Boolean)

Log.ID := inJobEntry.ID;
Log."User ID" := inJobEntry."User ID";
Log."Start Date/Time" := CURRENTDATETIME;
Log."End Date/Time" := CURRENTDATETIME;
Log."Object Type to Run" := inJobEntry."Object Type to Run";
Log."Object ID to Run" := inJobEntry."Object ID to Run";

IF isFinish THEN
  Log.Status := Log.Status::Success
ELSE
  Log.Status := Log.Status::"In Process";

Log.Description := inJobEntry.Description;
Log."Job Queue Code" := inJobEntry."Job Queue Category Code";
Log."Processed by User ID" := inJobEntry."User ID";
Log."Job Queue Category Code" := inJobEntry."Job Queue Category Code";

Log."Error Message" := inType;
Log."Error Message 2" := inMessage1;
Log."Error Message 3" := inMessage2;

Log.INSERT();






Data Exchange Def. for BACS

$
0
0
Hi,

I am trying to setup Data Exchange Def. for BACS and I have got 3 issues:
1. all values are exported in "", I need to be blank.
2. I need my date to be ddMMyyyy without / (16102018)
3. I have to show company Sort Code and Account no. without comma, as a one field (11223312345678)

I am working in Business Central, so won't be able to change anything in Dev environment.

Is it possible to achieve without development?

Thank you!
Kate
Viewing all 10067 articles
Browse latest View live


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