Skip to Content

Requested quantity type in request missing?


I am trying to create a Project Purchase Request. However, I always get this Error:

I first tried to use the example code from the Repository Explorer

import ABSL;
import AP.ProjectManagement.Global;

var rootData : elementsof ProjectPurchaseRequest;
var itemData;
var projectPurchaseRequest;
var itemservice;
var requestedquantity;

//create ProjectPurchaseRequest root
rootData.ID.content = "project1-1";     // Prefix of project is used
rootData.TypeCode = "1";                // Internal project purchase request
projectPurchaseRequest = ProjectPurchaseRequest.Create(rootData);

//create ProjectPurchaseRequest Item Details
itemData = projectPurchaseRequest.Item.Create();
itemData.RequestedQuantity.content = 20; 
itemData.ProductKey.ProductID.content = "AXUS-S662"; 
itemData.ProjectTaskKey.TaskID.content = "Project1-4";

This lead to even more Errors: (Of cause I adjusted the values like "ProductID" and "Project ID" for our system).

Here is my code which fixed all the errors except the "Requested quantity type in request <ID> missing?".

import ABSL;
import AP.Common.GDT;
import AP.Purchasing.Global;
import AP.ProjectManagement.Global;

var rootData : elementsof ProjectPurchaseRequest;
rootData.ID.content = "DCP17-6";
rootData.TypeCode = "2";

var newProjectPurchaseRequest = ProjectPurchaseRequest.Create(rootData);

var itemElements :elementsof ProjectPurchaseRequest.Item;
itemElements.TypeCode = "19";
itemElements.ProductKey.ProductID.content = "S200101";
itemElements.ProductKey.ProductTypeCode = "2";
itemElements.ProductKey.ProductIdentifierTypeCode = "1";

itemElements.RequestedQuantity.content = 20.00;
itemElements.RequestedQuantity.unitCode = "HUR";

itemElements.ProjectTaskKey.TaskID.content = "DCP17-2"; 
var itemData = newProjectPurchaseRequest.Item.Create(itemElements);

Does anyone know what the "Requested Quantity Type" is?

Kindest Regards


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers