Skip to main content
Question

The multi-part identifier Error

  • February 26, 2026
  • 2 replies
  • 54 views

Jhon Reeve Penuela
Freshman I
Forum|alt.badge.img

Hi Everyone.

Currently I encounter error while. executing my custom button name “Create TP Number”.

 

and here my sample code.

public static void CreateTPNumber(PMQuoteMaint pMQuoteMaint)
{
using (var ts = new PXTransactionScope())
{
PXResultset<CROpportunityProducts> pXResultsetCROpportunityProducts = pMQuoteMaint.Products.Select();

PXResultset<PMQuoteTask> pXResultsetPMQuoteTask = pMQuoteMaint.Tasks.Select();

List<CROpportunityProducts> cROpportunityProductsDuplicate = pXResultsetCROpportunityProducts
.RowCast<CROpportunityProducts>()
.GroupBy(x => new { x.InventoryID, x.TaskCD }).Where(g => g.Count() > 1)
.SelectMany(g => g)
.ToList();

if (cROpportunityProductsDuplicate.Count() > 0)
{
foreach (CROpportunityProducts pMQuoteTask in cROpportunityProductsDuplicate)
{

InventoryItem pXResultInventoryItem = SelectFrom<InventoryItem>.Where<InventoryItem.inventoryID
.IsEqual<@P.AsInt>>.View.Select(pMQuoteMaint, pMQuoteTask.InventoryID).FirstOrDefault();

throw new PXException(Messages.TravelPackageErrorMessageDuplicate(pXResultInventoryItem.InventoryCD));
}
}

if (pXResultsetCROpportunityProducts.Count <= 0 && pXResultsetPMQuoteTask.Count <= 0) return;

foreach (CROpportunityProducts cROpportunityProduct in pXResultsetCROpportunityProducts)
{
CROpportunityProductsExtension cROpportunityProductsExtensions =
PXCache<CROpportunityProducts>.GetExtension<CROpportunityProductsExtension>(cROpportunityProduct);

if (cROpportunityProductsExtensions == null) return;

string status = cROpportunityProductsExtensions.UsrStatus ?? String.Empty;

if (status == Messages.openStatus
&& cROpportunityProduct.TaskCD == null)
{
InventoryItem inventoryItem = SelectFrom<InventoryItem>.Where<InventoryItem.inventoryID
.IsEqual<@P.AsInt>>.View.Select(pMQuoteMaint, cROpportunityProduct.InventoryID).FirstOrDefault();

if (inventoryItem == null) return;

for (int i = 0; i < cROpportunityProduct.Qty; i++)
{
PMQuoteTask pMQuoteTaskNew = new PMQuoteTask();

pMQuoteTaskNew.Description = inventoryItem.InventoryCD;

pMQuoteMaint.Tasks.Update(pMQuoteTaskNew);

pMQuoteMaint.Actions.PressSave();
}

pMQuoteMaint.Products.Delete(cROpportunityProduct);

foreach (PMQuoteTask pMQuoteTask in pMQuoteMaint.Tasks.Select().RowCast<PMQuoteTask>()
.Where(x => x.Description == inventoryItem.InventoryCD))
{
bool isTaskCD = pXResultsetCROpportunityProducts
.RowCast<CROpportunityProducts>().Where(x => x.TaskCD == pMQuoteTask.TaskCD).Any();

if (!isTaskCD)
{
CROpportunityProducts cROpportunityProductsNew = new CROpportunityProducts();

CROpportunityProductsExtension cROpportunityProductsExtension = PXCache<CROpportunityProducts>
.GetExtension<CROpportunityProductsExtension>(cROpportunityProduct);

CROpportunityProductsExtension cROpportunityProductsExtensionNew = PXCache<CROpportunityProducts>
.GetExtension<CROpportunityProductsExtension>(cROpportunityProductsNew);

cROpportunityProductsNew.InventoryID = inventoryItem.InventoryID;

cROpportunityProductsNew.Qty = 1;

cROpportunityProductsExtensionNew.UsrSuggestedMinimumBid = cROpportunityProductsExtension.UsrSuggestedMinimumBid;

cROpportunityProductsNew.TaskCD = pMQuoteTask.TaskCD;

pMQuoteMaint.Products.Update(cROpportunityProductsNew);
}
}
}
}

pMQuoteMaint.Actions.PressSave();

ts.Complete();
}
}
I hope you can help me. Thanks.

2 replies

  • Freshman II
  • February 28, 2026

@Jhon Reeve Penuela 
The CreateTPNumber method itself is not referencing CROpportunityRevision or ManualTotalEntry, so it is unlikely to be the direct cause of the error.

Since the error is occurring on standard base fields of CROpportunityRevision and CROpportunity, it usually indicates that another customization/code is affecting how the PMQuoteMaint screen builds its query (for example, a DAC extension or a graph extension modifying views or attributes).

Could you please check whether you have any other customizations/code related to:

PMQuoteMaint

CROpportunityRevision

CROpportunity

Especially any DAC extensions, CacheAttached events, or modifications to views?

If possible, please share that related code so we can analyze further. Hope that helps.


Jhon Reeve Penuela
Freshman I
Forum|alt.badge.img

Hi ​@MaheshLakum . Thank you for your reply. I forgot to mention. the error doesn’t come out often. there was an error, but the entire process of customization was not affected. it works. but on the client side it's not good to see that and say that it works.