Hi Guys, hope that all of you are fine!
I've been trying to deal with this on my own for a while, but honestly.. I just can't.
I'm trying to create a Customer Invoice from the sdk, as far as I know in order to do that you need first to generate a Customer Invoice Request.. here's where it gets annoying..
I tried it.. several times, with the code in the PSM (It doesn't work.. what a surprise), consuming the CustomerInvoiceRequest web service.. and nothing..
There's a web service in the system that allows to create an Invoice.. it's called ManageCustomerInvoiceRequestIn.. but i'm not able to use it..
Thanks to all of you in advance
Request clarification before answering.
Hello everyone,
First, thank you very much for your example,Srivatsava, it's being very useful for me.
I am trying to make something similar with SupplierInvoice, but all my properties are locked.
Trying to following your example I have the same issue, so I think there must be related to another problem.
I'm working with a Solution-Template.
Thank you very much for your time!
Regards,
Óscar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Oscar, even when the BO is write access allowed, sometimes some of its nodes or elements don't, so you need to go deeper to know if you can write something.
Maybe an element/node that you're trying to write have no this write access, but again, if you need it, you can raise an element requesting for it.
Regards.
Not sure about complete set of restrictions levied on Solution Template.
You can't even extend screens for standard BO's there. They might not allow to execute code for Std. BO's as well? I suggest you to get help from anyone who has tried this scenario in a soln. template.
I've heard that if you are in Cust Test Tenant, some of the std. terms are locked. You might have to raise an incident stating your use case to unlock them. Not sure if this applies to your case!
But, if you are working on your devpt. tenant, I think its worth trying this in one of your experimental customer specific soln. Try out with working scenarios first, one like for Customer Invoice as Melvin already reported that its working. If you are still seeing the same errors, then you might have to raise an incident.
Hello all,
My problem was that my BOs were in a different Deployment Unit (default for the Solution) that the standard BOs that I need to create.
Using [DeploymentUnit(SupplierInvoicing)] businessobject BO_NAME {... in my BOs definition the problem is resolved.
Thank you very much for your support.
Regards,
Óscar
Hello Oscar,
i am having a similar problem: i would like to generate a SupplierInvoic based on a GSA with some price modification in the invoicing (discounts).
Can you post how you actaully solved this in ABSL? I was looking for some function like createSupplierInvoiceByGSAReference, but there is no documentation and I cannot find any function which come even close to this.
Thanks for any help or hint.
Best
Peter
Hi Peter,
You can find a sample in SupplierInvoice Business Object, into ByD Studio Repository Explorer:
Please, note that your BO must be in the same Deployment Unit:
If you have further question I'll be glad to help you.
Best Regards,
Óscar
Here is the sample code:
// ABSL example for Supplier Invoice
import ABSL;
import AP.FO.Product.Global;
import AP.SupplierInvoicing.Global;
import AP.FO.Party.Global;
import AP.Common.GDT;
var SI_Root: elementsof SupplierInvoice;
var SI_SParty: elementsof SupplierInvoice.Party;
var SI_BParty: elementsof SupplierInvoice.Party;
var SI_Item: elementsof SupplierInvoice.Item;
var SI_DueDate: elementsof SupplierInvoice.CashDiscountTerms;
var qrySIV_Root_QueryByElements = SupplierInvoice.QueryByElements;
var selParamsSIV_Root_QueryByElement = SupplierInvoice.QueryByElements.CreateSelectionParams();
var BTDRef: elementsof SupplierInvoice.BusinessTransactionDocumentReference;
var SI;
var inst;
var inst1;
var SI_Item1;
var SI_Root1;
var RootTempID;
var RootTempUUID;
// Set document type to Invoice
SI_Root.TypeCode = "004";
// Set Invoice Date
SI_Root.Date = Context.GetCurrentSystemDate();
SI_Root.DocumentItemsGrossAmountIndicator = false;
SI_Root.ReceiptDate = Context.GetCurrentSystemDate();
// SI_Root.TaxAmount = this.TotalTaxAmount;
SI_Root.TransactionDate = Context.GetCurrentSystemDate();
// Root node creation
SI = SupplierInvoice.Create(SI_Root);
//Set TypeCode to "CustomerInvoice"
// Set External Document ID
BTDRef.BusinessTransactionDocumentReference.ID.content = "EXT12345";
SI.CustomerInvoiceReference.Create(BTDRef);
// Set Supplier ID
SI_SParty.PartyKey.PartyID.content = "MC4000";
SI.SellerParty.Create(SI_SParty);
// Set Bill-To Party
SI_BParty.PartyKey.PartyID.content = "MC10000";
//SI.BillToParty.Create(SI_BParty);
SI.BuyerParty.Create(SI_BParty);
// Set Due Date
SI_DueDate.FullPaymentEndDate = Context.GetCurrentSystemDate();
SI.CashDiscountTerms.Create(SI_DueDate);
// Set Product Quantity
SI_Item.Quantity.content = 3;
SI_Item.Quantity.unitCode = "EA";
// Set Net Price or Gross Price
SI_Item.NetUnitPrice.Amount.content = 60;
// Set Price Per Item
SI_Item.NetUnitPrice.BaseQuantity.content = 10;
// Line Item Creation
SI_Item1 = SI.Item.Create(SI_Item);
// Set Product ID
//SI_ItemProduct.ProductKey.ProductID.content = "MCA-0002";
SI_Item1.ItemProduct.ProductKey.ProductID.content = "MCA-0001";
// set Item Location
// SI_ItemLocation.LocationID.content = "MC10000";
SI_Item1.ShipToItemLocation.LocationID.content = "MC64000";
// Set Tax Code
SI_Item1.TaxCalculationItem.TaxationCharacteristicsCode.content = "2";
foreach(inst in SI_Item1.ItemAccountingCodingBlockDistribution.AccountingCodingBlockAssignment)
{
// Set Account Assignment Type to "Project Task"
inst.AccountingCodingBlockTypeCode.content = "PRO";
}
// var temTest = SI_Root.ReceiptDate.ToString();
foreach(inst in SI_Item1.ItemAccountingCodingBlockDistribution.AccountingCodingBlockAssignment){
// Set Project Task ID
inst.ProjectTaskKey.TaskID.content = "MC-1239-1"; // ItemIns.ProjectTaskID;
}
// SI_Item1.ItemAccountingCodingBlockDistribution.AccountingCodingBlockAssignment.Create(AccAsmt);
//Association with the Standard BO
if(!SI.IsSet())
{
raise Error.Create("E");
}
this.toSIV = SI;
this.SIV_ID = this.toSIV.ID.content;
// calculation of gross amount
this.toSIV.GrossAmount = this.toSIV.TotalGrossAmount;
SI.FinishDataEntryProcessing();
//raise success message
raise Success.Create("S",this.SIV_ID);
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.