I need get “CSAnswer.Value” to “PORecieptLine” Using row selected. How can i achived that.
This is the value I want
I want get CSAnswer.value to Cuztomized feild.
this is my code. Not give correct result.
Best answer by praveenpo
View originalI need get “CSAnswer.Value” to “PORecieptLine” Using row selected. How can i achived that.
This is the value I want
I want get CSAnswer.value to Cuztomized feild.
this is my code. Not give correct result.
Best answer by praveenpo
View originalhi
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.
hi
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);
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);
Hi
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
}
}
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
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.