Project and Task is empty / "X" value in Issue Screen

  • 27 July 2021
  • 9 replies
  • 64 views

I have problem with project and task in Issue screen (IN302000), after doing UPDATE IN from Shipments Screen (SO302000), automatic make a new Issue in Issue screen (IN302000) but project and task is not same with project and task in Shipments Screen (SO302000).

(project and task field is custom and just calling data)

 

how to solve that case ? thanks.


9 replies

Userlevel 7
Badge +9

Hi @yanuaralfianus37 I’m assuming that Project ID and Task fields are customized fields in Shipments screen. 

If yes, standard Acumatica “Update IN” action process, will NOT consider the customization fields and create IN Issue.

If this is the case, you need to override the “Update IN” action to take the project id and task values from Shipments screens and assign these values at the Issues screen line level.

Also, in the “Prepare Invoice” action, you need to do the same process.

 

hope this helps!!

Hi @Naveen B thanks for reply. do you have a example script how to assign values to the Issues screen line level from override action UPDATE IN?

Userlevel 7
Badge +9

Here is the code to override the UpdateIN action in Shipments screen.

public class KNPWSOShipmentEntryExt : PXGraphExtension<SOShipmentEntry>
{
public PXAction<SOShipment> UpdateIN;
[PXUIField(DisplayName = "Update IN", Visible = false, MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
[PXButton]
protected IEnumerable updateIN(PXAdapter adapter, List<SOShipment> shipmentList = null)
{
PXGraph.InstanceCreated.AddHandler<INIssueEntry>(graph =>
{
graph.RowInserted.AddHandler<INTran>((cache, e) =>
{
// add the logic related to project details
});

});
return Base.UpdateIN.Press(adapter);
}
}

 

thanks for the code @Naveen B! but the way, do you know how to assign project ID value from Sales Order Screen (SO301000) to Project ID value in Issue screen (IN302000) ? i don’t know how project ID in Issue screen (IN302000) get a value “X”.

 

this is my SS Sales Order Screen (SO301000)

 

Userlevel 7
Badge +9

@yanuaralfianus37  In the INUpdate” action, you need to implement logic to get the Project ID from Sales Order screen and assign that to INTran record in the Issues screen. That way the project will be populated in the Issues instead of taking the default project i.e. X 

this is my code

PXGraph.InstanceCreated.AddHandler<INIssueEntry>(graph =>
{
graph.RowInserted.AddHandler<INTran>((cache, e) =>
{
var row = (INRegister)e.Row;
if (row == null) return;

INTran issueline = PXSelect<INTran,
Where<INTran.refNbr, Equal<Required<INTran.refNbr>>>>
.Select(this.Base, row.RefNbr);
if(issueline.ProjectID == null){
SOOrder order = PXSelect<SOOrder,
Where<SOOrder.orderNbr, Equal<Required<SOOrder.orderNbr>>>>
.Select(this.Base, issueline.SOOrderNbr);

issueline.ProjectID = order.ProjectID;
}
});

});

after im press the button “UpdateIN”, i get error “Unable to cast object of type 'PX.Objects.IN.INTran' to type 'PX.Objects.IN.INRegister'.“

Userlevel 7
Badge +9

Hi @yanuaralfianus37 , I have written the below code here it self, but NOT verified. 
But it will work, please verify..

 

PXGraph.InstanceCreated.AddHandler<INIssueEntry>(graph =>
{
graph.RowInserted.AddHandler<INTran>((cache, e) =>
{
var row = (INTran)e.Row;
if (row == null) return;

SOOrder order = PXSelect<SOOrder, Where<SOOrder.orderNbr, Equal<Required<SOOrder.orderNbr>>,
And<SOOrder.orderNbr, Equal<Required<SOOrder.orderNbr>>>>>.Select(soOrderGraph, row?.SOOrde, row?.SOOrderNbr);

row.ProjectID = order?.ProjectID;
graph.transactions.Cache.Update(row);


});

});

 

 

hi @Naveen B thanks for the code! yeah, It’s work ! im adding “row?.SOOrderNbr” and “graph.transactions.Cache.Update(row);”.

this is result that logic

 

Userlevel 7
Badge +9

Awesome...I'm just fetching the Project ID from Sales Order and then updated in the Issues screen line level.

 

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2020  Acumatica, Inc. All rights reserved