Business Central API - Create Custom API Page for Sales Invoice Lines - api

I need to create a custom API Page for Business Central on Dynamics 365.
I need to get a the AL source for the API Method
https://api.businesscentral.dynamics.com/v2.0/{{TenantID}}/{{Environment}}/api/beta/companies({{CompanyId}})//salesInvoices({{InvoiceId}})/salesInvoiceLines
Does anyone know where I can find the AL source for the SalesInvoiceLines method above?
I have copied the AL source from my Docker Windows Container to a directory
C:\bcSandbox\applications\APIV1\Source_Exclude_APIV1_.Source
I can only find the AL source for a ListPart for the SalesInvoiceLines (see below), I may be wrong but not sure how I can POST new records to BC using a ListPart.
page 20043 "APIV1 - Sales Invoice Lines"
{
DelayedInsert = true;
PageType = ListPart;
SourceTable = "Sales Invoice Line Aggregate";
SourceTableTemporary = true;
ODataKeyFields = Id;
Extensible = false;

The business central standard objects are the pages 5475 (SI header) and 5476 (SI line), which you'll find within the base application (Microsoft_Application_*.app).

Related

SAP Business One DI API at item creation should inherit some fields from item group

In SAP Business One client, imagine you want to add a new item. You set code, name and group. When you set the group SAP proposes to inherit some fields from such item group. You can choose yes or no.
If you do the same thing with DI API, of course there isn't such a proposal. DI API give for granted that you don't want to inherit fields from the item group.
Is there a way to tell DI API to inherit fields from the item group? Or are we obliged to copy them one by one in our program?
As far as i know this method for maintaining item information from the item group is not exposed to the sdk.
I know that the general ledger information can be maintained using
.GLMethod = SAPbobsCOM.BoGLMethods.glm_ItemClass
but for the other 10(ish) fields you will have to manually set them in your code.
.PlanningSystem = BoPlanningSystem.bop_MRP
.ProcurementMethod = BoProcurementMethod.bom_Make
.OrderIntervals = "Week"
.OrderMultiple = 5
.MinOrderQuantity = 3
.LeadTime = 20
.ToleranceDays = 3
.CostAccountingMethod = BoInventorySystem.bis_Standard

Xero API - ability to load data by tracking category?

We need to load invoices whose lines are tagged with a specific tracking category.
Right now the way to do this is to load ALL invoices, which gets invoice header info, then load invoice Lines, which finally gets tracking info, then filter out the ones I need.
This seems very inefficient. Is there a better way to do this? I do not want to load all invoices, then load them one by one just to find the few which are using the specific tracking category.
Use paging to get the invoices with the lines included, it should mean fewer calls will be required to the API.
Here is a snippet from one of my projects that uses paging for invoices. c# version
var api = XeroApiHelper.CoreApi();
api.SummarizeErrors(false);
var invoices = new List<Invoice>();
var invoicep = new List<Invoice>();
int i = 1;
do
{
invoicep = api.Invoices.Where("Contact.ContactID == Guid(\"" + xeroId + "\")").Page(i).Find().ToList();
invoices.AddRange(invoicep);
i++;
} while (invoicep.Any());

Bloomberg API: Search for a company and return all associated tickers

I'm programming using the Bloomberg API. I need to be able to search for a company and get a list fo all tickers associated with that company. I'm working with .net version.
Can anyone please direct me to what sort of request I need to make?
You might be looking for the //blp/instruments service.
In the SDK this is documented as the SecurityLookupExample.
You can create an instrumentListRequest along the lines of:
InstrumentListRequest = {
query = "IBM"
yellowKeyFilter = YK_FILTER_NONE
languageOverride = LANG_OVERRIDE_NONE
maxResults = 10
}
This will return a list of instruments like "IBM US Equity", "DD103619 Corp", "IBM UN Equity", etc.

Can we extract all Visitor ID's from Adobe Analytics using API

I'm looking to determine whether it's possible via visitor API to be able to find out all visitor ID's.
In the code examples below, [your mcorgid here] is your company's marketing cloud organization id. If you do not know this then you need to contact Adobe Client Care to get it.
getMarketingCloudVisitorID - Get the Marketing Cloud Visitor ID (mid= param)
var visitor = Visitor.getInstance("[your mcorgid here]#AdobeOrg")
var mcvid = visitor.getMarketingCloudVisitorID();
getAnalytcisVisitorID - get legacy visitor id (aid= if applicable)
var visitor = Visitor.getInstance("[your mcorgid here]#AdobeOrg")
var aid = visitor.getAnalyticsVisitorID();
getCustomerIDs - get all customer IDs
var visitor = Visitor.getInstance("[your mcorgid here]#AdobeOrg");
var customerIDs = visitor.getCustomerIDs();
s_fid - Fallback ID
There is no built-in method for retrieving this, but you can use AA's s.c_r() cookie reading utility function, or any other cookie reading method you have to look for the s_fid cookie. (sidenote: I do not recommend using DTM's _satellite.readCookie()method. It only looks for cookies on the current page's full (not root) domain, and there is no way to change that. Since AA and most other things usually set on root domain, it makes _satellite.readCookie() unreliable in practice).
var fid = s.c_r('s_fid');
Use Adobe datawarehouse and extract Experience Cloud ID. Assuming you know how to use the API already, here is an easy report to try
report_definition = ReportDefinition(
dimensions="marketingcloudvisitorid",
metrics="visits",
date_from=insertdate,
date_to=insertdate,
source="warehouse"
)

Siebel - How to get all accounts of an employee with eScript?

how can I get all accounts of am employee?
In the "Siebel Object Interaces Reference" I found an example, how to get all industries of an account:
var myAccountBO = TheApplication().GetBusObject("Account");
var myAccountBC = myAccountBO.GetBusComp("Account");
var myAssocBC = myAccountBC.GetMVGBusComp("Industry");
So I would like to do something like:
var myEmployeeBO = TheApplication().GetBusObject("Employee");
var myEmployeeBC = myAccountBO.GetBusComp("Employee");
var myAssocBC = myAccountBC.GetMVGBusComp("Account");
But I get an error
Semantic Warning around line 23:No such predefined property Account in class BusComp[Employee].MVGFields.
I can see in Tools that there is no Multi Value Link called "Account" in Business Component "Employee", so I can actually understand the error message.
So I wonder how I can get all accounts of an employee.
I found the Business Component "User" which has a Multi Value Link to "Organisation" and another link "User/Account".
Is this what I am looking for?
How can I know? Where is documentation which tells me about the semantics of links? (Is this described in "Siebel data model reference"? I cannot download this document, although I have signed in...) This link could also link a user to the organization it belongs to.
If one of these links IS what I am looking for, what would be the way to go to get the "User" Business Component of a corresponding "Employee" Business Component?
Many questions of a Siebel newb...Thanks for your patience.
Nang. An easy way to approach this (and to learn it) is to figure out how you'd do it in the UI. Then move onto figuring out how to do the same thing in script.
When you say, "get all account of an employee," do you really mean get all accounts where a particular employee is on the account team? In the UI, that would be done by going to: Accounts > All Accounts Across Organizations, and querying for that specific user in the "Account Team" multi-value field.
From that same view, go to Help > About View in the application menu. You'll see in the popup that the view uses the Account business object and the Account business component. A quick examination of the applet you queried on will show you that the "Account Team" field on the applet is really the "Sales Rep" field on the Account business component. Here's how to mimic what we did in the UI, in script:
var boAccount = TheApplication().GetBusObject("Account");
var bcAccount = boAccount.GetBusComp("Account");
bcAccount.SetViewMode(AllView); // like All .. Across Orgs
bcAccount.ClearToQuery();
bcAccount.SetSearchSpec("Sales Rep", "NANG");
bcAccount.ExecuteQuery();
Then you can walk through the list of accounts and do something with each one like this:
// for each account
for (var bIsRowActive = bcAccount.FirstRecord();
bIsRowActive; b = bcAccount.NextRecord())
{
// do something here
}
I hope you're enjoying Siebel.