Object ID conflict in extensions in AL (Business Central OnPremises) - visual-studio-code

I'm a beginner in Dynamics Nav/Dynamics365/Business Central developing extensions in AL and I'm having a problem that I don't know how to solve it 'easily'.
I am working with 2 projects in Visual Studio Code at the same time in one workspace (previously I tried it in multiple workspaces) and there are 2 'pageextension' objects with ID 50100.
I'm having the following error:
The application object of type 'PageExtension' with the ID '50100' is defined in multiple apps. The apps are: Reports by myName 2.1.0.0; Workspace2 by myName2 1.0.0.0.
I know this error could be fixed changing the object ID but I think it should exist another solution.
Does this mean that if someone publishes and install an extension and then try to publish and install mine, will BC OnPrem not allow them to work with the second?
thank you in advance

The range you describe should only be used for customisations.
When publishing for AppSource, you will get a specific number range for your app.
If you intend to use multiple apps for customisations, you should divide the range and make sure you do not use double id's.

Related

How to transfer Files from OPC UA Client to Server

I want to Download and Upload, for example a .txt file, with the UA-Expert Client to/from a Server which i have set up on a Device.
Could someone provide me a Step by Step solution or an example on how to implement this?
I first followed the tutorials from the open62541 website.
I tried to follow and understand the OPC-UA-Specifications, particularly Part 5 Annex C.
Thank you in Advance.
open62541 doesn't support this out of the box meaning that there is no pre-made plugin which implements the required Objects for the various platforms.
That said it isn't to much work to do it yourself (especially if you don't need something generic/cross platform).
I've done such a one-off a few months ago. It was like 2 days of work. It was limited to downloading specific files from the server.
If my memory serves me well all you need to do is to enable the generation of the types specified by part5/annex c (there is a .txt or .csv in the sourcetree containing all the types that should be generated), after that you need to instantiate such an object (File for example) and place it somewhere in your server address space. What is left to do is to implement the various methods (open, read, ...) And to hook up your objects with callbacks to these.
This feature was added recently, but is not yet included into the official release.
Have a look at: https://github.com/opcua-tsn-team-kalycito/open62541/tree/fileType_object_implementation
(Make sure to use the commit 76eb14f6886911f954c40492cbe346c69b055ba5; the latest commit is not working)
An example implementation is:
UA_StatusCode result = UA_Server_addFile(server, FileTypeNodeId,
UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER),
UA_NODEID_NUMERIC(0, UA_NS0ID_ORGANIZES),
UA_QUALIFIEDNAME(1, "Sample File"),
oAttr, filePath, NULL, NULL
);

How to publish 2 apps using 1 source code to Play store and App store?

I need to publish 2 clients to 1 source code. How do I do it?
I read this article.
How do I build different versions of my Flutter app for qa/dev/prod?
However I could not find the answer from this article.
Is it possible to publish 2 application in same source code and same Key file and same version code and same version name(com.eclipse.side)?
In order publish the same source code into 2 different applications, for example if you have a paid version and a free version of your application you need to use flutter flavors
Basically, it will create 2 different applications that can be uploaded to the stores with the same code, with slight changes in the application Id for example
So, Is it possible to publish 2 application in same source code
Yes. It is irrelevant how you create your app.
and same Key file
Yes, however it's not really recommended
and same version code
Yes, version code is just a version number of your specific app only.
and same version name(com.eclipse.side)
Yes, versionName string used as the version number shown to users. Not sure you meant that one really as noone puts package id there though.
So the only thing that matters globally is application id from your manifest and it must be unique across whole play store submitted apps.
EDIT
my question is, can to publish 2 application with same package name?**
Again, there's no such thing as package name. It's application id that matters only. All the other things are just labels. If you want to release two apps both can show "My App" label. But one mush have different application Id than other (i.e. com.company.app1 and com.company.app2). That's it - so ensure your flavours set different application id and you should be good.

VSTS Extension - Release definition data, environment ids

I am developing web extension for VSTS. I am using vss sdk of Microsoft.
I got some issue.
You can see on the image that there is new line - App insights Settings
This pop up appears on clicking on 3 dots near every release definition on page of list of all releases.
This button navigates user to some environment of some specific release.
Example of link:
https://ozcodedev.visualstudio.com/OzCode/_releaseProgress?releaseId=372&_a=release-environment-logs&environmentId=850
The problem that I do not know how to fetch list of releases and environments for building this link.
How can I get them on page All release pipelines.
Through the GUI it is not possible to get all the release ids and the environment ids for each step. However this is possible through the VSTS APIS. You could use the release endpoint to and iterate to obtain your release id
https://{accountName}.vsrm.visualstudio.com/{project}/_apis/release/releases?api-version=4.1-preview.6
Once you have the release id you can use it like so
https://{accountName}.vsrm.visualstudio.com/{project}/_apis/release/releases/{releaseId}?api-version=4.1-preview.6
Within the returned JSON you can follow iterate the path environment[n].id to obtain the environment id.
You can then construct the link using this information.
Hope that helps
Ok. So after working 2 days on this issue I found solution.
1.It is possible to fetch data that I wanted on Client Side. For this I used Microsoft's library vss-web-extension-sdk. Install it - npm install vss-web-extension-sd --save.
2.Add relevant scopes to your vss-extension.json. In my case the problem was - that I needed data that relates to managing of VSTS user releases. So after Including "vso.release_manage" to my scopes array I stopped to got 401 Unauthorized error because access token was changed according to new scopes.
https://learn.microsoft.com/en-us/vsts/extend/develop/manifest?view=vsts#scopes
In this documentation you can check which scope controls which resources that can be accessed by your extension.
You can use our ts/js clients to get whatever you want for your experience.
We have extensive documentation available here. Let me know if you are blocked anywhere.

How to create an ATG store?

I have been studying ATG for about 4 months and now I am facing a problem: even going through the documentation I can't find any document that can clearly explain how I can create a new empty store.
I know that I need to have my database users and schemas, the application server scripts (I'm using weblogic) and the module in Eclipse. But I can't find anywhere how to create a new store, implement it from the beginning and see the result in the browser.
There is no such document for ATG. You either need to start from the Commerce Reference Store and customise that (in versions prior to ATG 11 would would strongly suggest not to use the CRS as your basis for a new site) or you can look at what the CRS executes for the runAssembler command, remove the CRS specific modules from that and then create, and include your own modules for the Storefront and your source code.
There is no empty store you can install and run. You have to build one. Or you can install CRS, which is not empty, but it is relatively straightforward to install and can be customized.
The documentation to follow:
http://docs.oracle.com/cd/E52191_02/CRS.11-1/ATGCRSInstall/ATGCRSInstall.pdf
https://www.sparkred.com/blog/installing-oracle-commerce-11-1-with-commerce-reference-store/
*

External access to Magento instances

I've started investigating alternatives to my project and a few questions came out that I couldn't answer by myself.
The problem is: I want to create a web page able to access multiple Magento instances installed in the same server. Currently, I have one Magento instance per client and this project will access several Magneto instances to export reports from each one (for example).
The alternatives I thought til this moment are:
Have another Magento instance, create a new module within it that changes its 'database target' before triggering operations/queries;
Questions until this moment:
Can I 'change the database target' of a Magento instance?
How can I access data from a Magento instance without appeal to SOAP/REST?
I want to re-use some components (grids, tabs, forms..) from Magento, that's why I'm not considering an independent project (Zend, for instance) that can access this code from another projects. Does it make sense?
Any other idea?
==Edited==
Thanks by the tips and sorry by my ignorance. The comments let me believe that I'm able to execute something like this:
// File myScript.php
require '/home/DOMAIN1/app/Mage.php';
Mage::app('default');
// get some products from DOMAIN1
require '/home/DOMAIN2/app/Mage.php';
Mage::app('default');
// get some products from DOMAIN2
Is it right? Can I execute require twice (and override things from first require)?
==Edited2==
I'm still trying to connect to several Magento instances from a single third party file. Is there any tip? I'm facing several/different errors at this moment.
The only thing I know is that I can still rely on SOAP to get the information I need, but this will be expensive.
Thanks!
The easiest way would be to include Mage.php from each shop instance. You would need to use namespaces or some other trickery to be able to load more then one.
Or if that doesn't work - make your own API in a separate file to get what you want from one shop, and combine the results in the PHP-file that calls the API.
Here's a sample on how to use Magento functionality outside of Magento:
require 'app/Mage.php';
if (!Mage::isInstalled()) {
echo "Application is not installed yet, please complete install wizard first.";
exit;
}
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
// your custom code here, for example, get the product model..
$productModel = Mage::getModel('catalog/product');