Skip to main content
Solved

action prepare invoice Error: An error occurred during processing of the field Project/Contract value PR00000006 Error: Project/Contract 'PR00000006' cannot be found in the system. Please verify whether you have proper access rights to this object.


yanuaralfianus37
Jr Varsity II

i need help for this bug action prepare invoice in Shipment Screen (SO302000)

in Shipment Screen, Project Field and Project Task Field is customize.
this is source code for Project and project task

 protected void SOShipment_RowPersisting(PXCache cache, PXRowPersistingEventArgs e, PXRowPersisting InvokeBaseHandler)
    {
      if(InvokeBaseHandler != null)
        InvokeBaseHandler(cache, e);
      var row = (SOShipment)e.Row;
      if (row == null) return;
      //if((e.Operation & PXDBOperation.Command )== PXDBOperation.Insert)
      //{
          var rowExt = PXCache<SOShipment>.GetExtension<SOShipmentExt>(row);

          SOOrderShipment shipOrder = PXSelect<SOOrderShipment,
                  Where<SOOrderShipment.shipmentNbr, Equal<Required<SOOrderShipment.shipmentNbr>>>>
                  .Select(this.Base, row.ShipmentNbr);

          if(shipOrder != null ){
            SOOrder order = PXSelect<SOOrder,
                  Where<SOOrder.orderNbr, Equal<Required<SOOrder.orderNbr>>>>
                  .Select(this.Base, shipOrder.OrderNbr);

            if(order != null ){

              SOLine line = PXSelect<SOLine,
                  Where<SOLine.orderNbr, Equal<Required<SOLine.orderNbr>>>>
                  .Select(this.Base, order.OrderNbr);

              PMProject prj = PXSelect<PMProject,
                    Where<PMProject.contractID, Equal<Required<PMProject.contractID>>>>
                    .Select(this.Base, order.ProjectID);
              if(prj.ContractCD != null){
                rowExt.UsrzProjectNumb = prj.ContractCD;
              }

              if(line.TaskID != null && prj.ContractID != null ){
                PMTask task = PXSelect<PMTask,
                                Where<PMTask.projectID, Equal<Required<PMTask.projectID>>,
                                And<PMTask.taskID, Equal<Required<PMTask.taskID>>>>>
                                .Select(this.Base, prj.ContractID, line.TaskID);
                if(task.TaskCD != null){
                  rowExt.UsrzProjectTask = task.TaskCD;
                }
              }
            }
          }

      //}

    }

anyone know how to solved this bug ? thanks

Best answer by Naveen Boga

Hi @yanuaralfianus37 Can you please clarify the below points

  • Both Project ID and Project Tasks fields are TEXT fields?
  • Project ID is Active Status or Completed or etc.

View original
Did this topic help you find an answer to your question?

3 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3417 replies
  • Answer
  • August 2, 2021

Hi @yanuaralfianus37 Can you please clarify the below points

  • Both Project ID and Project Tasks fields are TEXT fields?
  • Project ID is Active Status or Completed or etc.


yanuaralfianus37
Jr Varsity II

Hi @Naveen B, thanks for reply.

  • Both Project ID and Project Tasks fields are TEXT fields? “yes that field is string”
  • Project ID is Active Status or Completed or etc. “ you right, im forget to change customer in Project Screen. that’s why i got that bug because customer in project screen is not same with Shipment screen and Sales Order Screen.

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3417 replies
  • August 2, 2021

@yanuaralfianus37 Great :) Thanks for the update.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings