Invalid Base Revision - GetNewPartRev in BPM

This project is fighting me at every step.

I’m creating a part in a data directive on UD03. I can create the Part record and add a PartPlant record successfully. But the moment I try to add a new PartRev record I get an error that says “Invalid Base Revision.”

Here’s the basic code:

// set up part if not present when quote MOM generated from UD03

Erp.Contracts.PartSvcContract partEntry = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.PartSvcContract>(this.Db, true);

using(var txscope = IceDataContext.CreateDefaultTransactionScope())        //Start Transaction
{
    partEntry.GetNewPart(ref dsPart);
    
    var PartNew_xRow = (from Part_Row in dsPart.Part 
    where Part_Row.RowMod == IceRow.ROWSTATE_ADDED
    select Part_Row).FirstOrDefault();
    
    if (PartNew_xRow != null)
    {
                  PartNew_xRow.PartNum = "Test01";
                  PartNew_xRow.PartDescription = "Test Part";
  
                  PartNew_xRow.IUM = "EA";
                  PartNew_xRow.SalesUM = PartNew_xRow.IUM;
                  PartNew_xRow.PUM = PartNew_xRow.IUM;
    }

    partEntry.Update(ref dsPart); // ------------------- same with or without this
    
    partEntry.GetNewPartRev(ref dsPart, "Test01", "1"); // error generated here

  txscope.Complete();                            //Close Transaction
}

It creates the part if I comment out the GetNewParRev line.

A puzzlement.

Thanks,

Joe

As soon as you holler for help…

GetNewPartRev lists RevisionNum in the arguments list, but just put an empty string there.

Ah, well.

Joe

1 Like