Skip to Content
1

Errors when Creating an invoice...via ABSL

Dec 05, 2016 at 10:52 PM

230

avatar image

When Creating an invoice I am getting the following errors.. when I try to save after the "Action" that is used to create the invoiceRequest... But If I hit the save again it saves without issues....

the UI Shows

The following are the Debug errors the UI shows

Message (APCI_CUST_INV_REQUEST, CUSTOMER_INVOICE_REQUEST) Customer invoice processing type missing

Message (APCI_CUST_INV_REQUEST, PRICING_TERMS) Currency missing

Message (APCI_CUST_INV_REQUEST, PRICING_TERMS) Sales data or pricing terms not found for account

Message (APCI_CUST_INV_REQUEST, PRICING_TERMS) Currency missing

Message (APCI_CUST_INV_REQUEST, CashDiscountTerms.ROOT) Payment terms not determined; maintain sales arrangement

Message (APCI_CUST_INV_REQUEST, CUSTOMER_INVOICE_REQUEST) Party with role Invoicing Unit missing

Message (APCI_CUST_INV_REQUEST, CUSTOMER_INVOICE_REQUEST) Party with role Seller missing

Message (APCI_CUST_INV_REQUEST, CUSTOMER_INVOICE_REQUEST) Party with role Sales Unit missing

Message (APCI_CUST_INV_REQUEST, ITEM) General ledger account or product missing

Message (APCI_CUST_INV_REQUEST, PriceAndTaxCalculation.ITEM) Product, product category or tax code of item missing

Message (APCI_CUST_INV_REQUEST, PriceAndTaxCalculation.ITEM) Product, product category or tax code of item missing

Message (APCI_CUST_INV_REQUEST, PriceAndTaxCalculation.ITEM) Product, product category or tax code of item missing

Message (APCI_CUST_INV_REQUEST, PriceAndTaxCalculation.ITEM) Product, product category or tax code of item missing

The Code is as Follows and Sets all the Values....

var elCustomerInvoiceRequest_Root: elementsof CustomerInvoiceRequest;
var instCustomerInvoiceRequest;
var elCustomerInvoiceRequest_BPVT: elementsof CustomerInvoiceRequest.BusinessProcessVariantType;
var instCustomerInvoiceRequest_BPVT;
var elCustomerInvoiceRequest_BuyerParty: elementsof CustomerInvoiceRequest.Party;
var instCustomerInvoiceRequest_BuyerParty;
var elCustomerInvoiceRequest_SalesUnitParty: elementsof CustomerInvoiceRequest.Party;
var instCustomerInvoiceRequest_SalesUnitParty;
// CustomerInvoiceRequest: create new instance instCustomerInvoiceRequest = CustomerInvoiceRequest.Create(elCustomerInvoiceRequest_Root); // CustomerInvoiceRequest: maintain BPVT node // BusinessProcessVariantTypeCode = 3 describes type 'Manual Invoice' elCustomerInvoiceRequest_BPVT.BusinessProcessVariantTypeCode = "3"; // CustomerInvoiceRequest: create new BPVT instance // Without the BPVT node no modifications can be made to the CustomerInvoiceRequest instCustomerInvoiceRequest_BPVT = instCustomerInvoiceRequest.BusinessProcessVariantType.Create(elCustomerInvoiceRequest_BPVT); // CustomerInvoiceRequest: maintain customer invoice processing type - mandatory // CustomerInvoiceProcessingTypeCode = "CI" describes type 'Customer Invoice' instCustomerInvoiceRequest.CustomerInvoiceProcessingTypeCode = "CI"; // CustomerInvoiceRequest: maintain description - optional instCustomerInvoiceRequest.Name = "DESC"; // CustomerInvoiceRequest:: maintain buyer party - mandatory elCustomerInvoiceRequest_BuyerParty.PartyKey.PartyID.content = BP2.InternalID; // CustomerInvoiceRequest: create new party instance instCustomerInvoiceRequest_BuyerParty = instCustomerInvoiceRequest.BuyerParty.Create(elCustomerInvoiceRequest_BuyerParty);
elCustomerInvoiceRequest_SalesUnitParty.PartyKey.PartyID.content= BP2.SalesArrangement.GetFirst().SalesOrganisation.ID;
instCustomerInvoiceRequest.PricingTerms.CurrencyCode = cd.Amount.currencyCode.Trim();

// define CustomerInvoiceRequest item node var DLelCustomerInvoiceRequest_Item: elementsof CustomerInvoiceRequest.Item; var DLinstCustomerInvoiceRequest_Item; // define CustomerInvoiceRequest item accounting coding block node var DLelCustomerInvoiceRequest_ItemACBD: elementsof CustomerInvoiceRequest.Item.ItemAccountingCodingBlockDistribution; var DLinstCustomerInvoiceRequest_ItemACBD; // define CustomerInvoiceRequest item price component var DLelCustomerInvoiceRequest_Item_MainPrice: elementsof CustomerInvoiceRequest.PriceAndTaxCalculation.Item.ItemPriceComponent; var DLinstCustomerInvoiceRequest_Item_MainPrice; DLelCustomerInvoiceRequest_Item.Description.content = LI.INVDESC; DLelCustomerInvoiceRequest_Item.Quantity.content = 1; DLelCustomerInvoiceRequest_Item.Quantity.unitCode = "EA"; DLinstCustomerInvoiceRequest_Item = instCustomerInvoiceRequest.Item.Create(DLelCustomerInvoiceRequest_Item); DLelCustomerInvoiceRequest_ItemACBD.GeneralLedgerAccountAliasCode.content = LI.GLAL; DLinstCustomerInvoiceRequest_ItemACBD = DLinstCustomerInvoiceRequest_Item.ItemAccountingCodingBlockDistribution.Create(DLelCustomerInvoiceRequest_ItemACBD); DLinstCustomerInvoiceRequest_Item_MainPrice = DLinstCustomerInvoiceRequest_Item.PriceAndTaxCalculationItem.ItemMainPrice.Create(); DLinstCustomerInvoiceRequest_Item_MainPrice.Rate.DecimalValue = cd.Amount.content * -1; DLinstCustomerInvoiceRequest_Item.PriceAndTaxCalculationItem.TaxationCharacteristicsCode.content = "500";
capture.png (13.3 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Horst Schaude
Dec 06, 2016 at 01:10 PM
0

Hello Billy,

The save is performed but the Invoice will not be able to be active because of the errors.

Bye,
Horst

Show 5 Share
10 |10000 characters needed characters left characters exceeded

That is incorrect... the Save is not performed unless I click it again (the Last error is "Saved Failed" cut off on the Screen shot)... Then it will Save and even creates the invoice (if I add that code), and when opened will not have any errors...

0

Hello Billy,

I've mean tthe second save. :-)

And - lucky for you - the system is determining the missing attributes by itself too.

Bye,
Horst

0

I need it to Save the First time... I am not sure you are understanding I am Setting all the missing attributes the system is not determining them as you can see in the code.... for example Pricing terms

instCustomerInvoiceRequest.PricingTerms.CurrencyCode = cd.Amount.currencyCode.Trim();

the errors happen while creating the Invoice...before I can even set the values... but by the end of the Action they are all set.

0

Hello Billy Gast

I am having the same issue on several objects.

The InvoiceRequest is one, the CustomerQuote is another. Even though the error are processed while creating the instances, it seems the Validation On-Save still does not want us to pass.

This is causing me some trouble with custom actions that I still need to find how to work around them. It seems the error messages are raised in the before-save and then prevent the On-Save to validate.

I will keep you in touch if I find something.

Best regards.

Jacques-Antoine

1
Jacques-Antoine Ollier

Hello Jacques-Antoine,

If that's true it would be worth an incident to explain it. (or correct the behaviour)

Bye,
Horst

0
May Thitsa Oo Dec 08, 2016 at 04:19 AM
0

Hi Billy,

Please try to write the instance creation order like this.

I think it will solve Currency missing and SalesUnit missing.

Regards,

May

var elCustomerInvoiceRequest_Root: elementsof CustomerInvoiceRequest;
var instCustomerInvoiceRequest;
var elCustomerInvoiceRequest_BPVT: elementsof CustomerInvoiceRequest.BusinessProcessVariantType;
var instCustomerInvoiceRequest_BPVT;
var elCustomerInvoiceRequest_BuyerParty: elementsof CustomerInvoiceRequest.Party;
var instCustomerInvoiceRequest_BuyerParty;
var elCustomerInvoiceRequest_SalesUnitParty: elementsof CustomerInvoiceRequest.Party;
var instCustomerInvoiceRequest_SalesUnitParty;


// CustomerInvoiceRequest: maintain BPVT node


// BusinessProcessVariantTypeCode = 3 describes type 'Manual Invoice'


elCustomerInvoiceRequest_BPVT
.BusinessProcessVariantTypeCode = "3";




elCustomerInvoiceRequest_Root
.CustomerInvoiceProcessingTypeCode = "CI";


// CustomerInvoiceRequest: create new instance 
instCustomerInvoiceRequest = CustomerInvoiceRequest.Create(elCustomerInvoiceRequest_Root);


//★★
if
(!instCustomerInvoiceRequest.PricingTerms.IsSet()){
var temp = instCustomerInvoiceRequest.PricingTerms.Create();
temp.CurrencyCode = "AUD"; // Test CurrencyCode
}


else
{
instCustomerInvoiceRequest.PricingTerms.CurrencyCode = "AUD"; // Test CurrencyCode
}


instCustomerInvoiceRequest.Name = "DESC";
// CustomerInvoiceRequest:: maintain buyer party - mandatory
elCustomerInvoiceRequest_BuyerParty.PartyKey.PartyID.content = BP2.InternalID;
// CustomerInvoiceRequest: create new party instance 
instCustomerInvoiceRequest_BuyerParty = instCustomerInvoiceRequest.BuyerParty.Create(elCustomerInvoiceRequest_BuyerParty);
elCustomerInvoiceRequest_SalesUnitParty.PartyKey.PartyID.content= BP2.SalesArrangement.GetFirst().SalesOrganisation.ID;
instCustomerInvoiceRequest.SalesUnitParty.Create(elCustomerInvoiceRequest_SalesUnitParty);
...........
Share
10 |10000 characters needed characters left characters exceeded
Michael Kaupp Feb 18, 2017 at 01:18 PM
0

Hi Billy,

do you already have an answer to this topic? I am facing exactly the same issue now. Would be great if you could share your results.

Thx and BR,

Michael

Share
10 |10000 characters needed characters left characters exceeded