Solved

Row Selected Customization - POReceipt

  • 10 October 2023
  • 6 replies
  • 60 views

Userlevel 1

I need get “CSAnswer.Value” to “PORecieptLine” Using row selected. How can i achived that.

 

This is the value I want

CSAnswer.value

I want get CSAnswer.value to Cuztomized feild.

 

this is my code. Not give correct result.

 

icon

Best answer by praveenpo 10 October 2023, 09:04

View original

6 replies

Userlevel 6
Badge +3

hi @tharinduweerasooriya90,

Issue is with your query  Join condition

you should Join Noteid column from InventoryItem table to RefNoteID column from CSAnswers and AttributeID should be Required Parameter or if it is always one you can have a satatic class and pass the value in query.
 
 

Userlevel 1

hi @tharinduweerasooriya90,

Issue is with your query  Join condition

you should Join Noteid column from InventoryItem table to RefNoteID column from CSAnswers and AttributeID should be Required Parameter or if it is always one you can have a satatic class and pass the value in query.
 
 

Is this correct ?

CSAnswers cSAnswers =
new PXSelectJoin<CSAnswers,
InnerJoin<InventoryItem, On<InventoryItem.noteID, Equal<CSAnswers.refNoteID>>>,
Where<CSAnswers.attributeID, Equal<Required<CSAnswers.attributeID>>,
And<InventoryItem.inventoryID, Equal<Required<InventoryItem.inventoryID>>>>>
(Base).Select(row.InventoryID);

 

Userlevel 6
Badge +3

Updated parameter

CSAnswers cSAnswers =
new PXSelectJoin<CSAnswers,
InnerJoin<InventoryItem, On<InventoryItem.noteID, Equal<CSAnswers.refNoteID>>>,
Where<CSAnswers.attributeID, Equal<Required<CSAnswers.attributeID>>,
And<InventoryItem.inventoryID, Equal<Required<InventoryItem.inventoryID>>>>>
(Base).Select("AttribuetID",row.InventoryID);
Userlevel 7
Badge +11

Hi @tharinduweerasooriya90 ,

Don't use the code in the Row Selected event. Instead, add the code in the InventoryID field updated event.

I assume that you are utilizing the defaultRowMatrixAttributeID to retrieve the pallet type. Ensure to join with the InventoryItem noteID field, CsAnswers refnoteid, and also the attributeID.

Please refer the below sample code.
 

 protected virtual void POReceiptLine_InventoryID_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
        {
            if (e.Row == null) return;
            POReceiptLine row = (POReceiptLine)e.Row;


            CSAnswers answers = PXSelectJoin<CSAnswers, InnerJoin<InventoryItem, On<CSAnswers.refNoteID, Equal<InventoryItem.noteID>,And<CSAnswers.attributeID, Equal<InventoryItem.defaultRowMatrixAttributeID>>>>,
                                  Where<InventoryItem.inventoryID, Equal<Required<InventoryItem.inventoryID>>>>.Select(Base, row.InventoryID);
            if (answers!=null)
            {
                POReceiptLineExtn extn =row.GetExtension< POReceiptLineExtn >().Fieldname = answers.Value
               
            }

        }

Userlevel 1

Updated parameter

CSAnswers cSAnswers =
new PXSelectJoin<CSAnswers,
InnerJoin<InventoryItem, On<InventoryItem.noteID, Equal<CSAnswers.refNoteID>>>,
Where<CSAnswers.attributeID, Equal<Required<CSAnswers.attributeID>>,
And<InventoryItem.inventoryID, Equal<Required<InventoryItem.inventoryID>>>>>
(Base).Select("AttribuetID",row.InventoryID);
using PX.Data;
using PX.Objects.CS;
using PX.Objects.IN;

namespace PX.Objects.PO
{
public class POReceiptEntry_Extension : PXGraphExtension<PX.Objects.PO.POReceiptEntry>
{

#region Event Handlers
protected void POReceiptLine_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
{

var row = (POReceiptLine)e.Row;

if (row == null) return;


CSAnswers cSAnswers =
new PXSelectJoin<CSAnswers,
InnerJoin<InventoryItem, On<InventoryItem.noteID, Equal<CSAnswers.refNoteID>>>,
Where<CSAnswers.attributeID, Equal<Required<CSAnswers.attributeID>>,
And<InventoryItem.inventoryID, Equal<Required<InventoryItem.inventoryID>>>>>
(Base).Select("AttribuetID", row.InventoryID);


if (cSAnswers != null)
{
POReceiptLineExt pOReceiptLineExt = PXCache<POReceiptLine>.GetExtension<POReceiptLineExt>(row);
pOReceiptLineExt.UsrPalletType = cSAnswers.AttributeID;
cache.SetValueExt<POReceiptLineExt.usrPalletType>(row, pOReceiptLineExt.UsrPalletType);

}

}
}
#endregion
}

Still couldn’t get the value

Userlevel 6
Badge +3

Check the parameter you are passing as

AttribuetID

 
Pass the actual Attribute in that place

 

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 — 2024  Acumatica, Inc. All rights reserved