Sorry I’m completely new to BPM custom code, which is what I think I’ll need to use here to achieve the results or maybe not?
I was wondering if anyone knows if this is possible please?
I’m trying to get a warning message to pop-up within receipt entry, that looks at what info is stored in POHeader.POType_c and presents it within the message.
I’ve got as far as creating a a Post-Process method on Erp.BO.Receipt.GetPOInfo and then created a variable for the message to get stored.
Now I’m looking to set code that looks at PO Header table, the POHeader.POType_c field specifically, i.e. if POType_c says ‘No further action required’ then show in the receipt warning message ‘No further action required’.
There is an option in the condition widget for Specified expression is valid. You should be able to use that with something like the code below to check the field on POHeader. That code was generated from ChatGPT and I haven’t tested it but it should be close.
Db.POHeader.Where(po => po.Company == CallContext.Current.Company
&& po.PONum == ttDataset.PONum)
.Any(po => po.POType_c == "No further action required")
I have had success in the past using the Condition, ‘Number of rows in the designed query is more or equal to 1’ (Modify as needed) to access Table fields not available from those displayed using the ‘specified field’ option in other conditions.
Honestly thank you so much for this!! This did exactly what we were looking for without having to hardcode IF and condition statements.
Think maybe it’s the version of Kinetic but just had to switch out the company line to
where POHeader_Row.Company == callContextClient.CurrentCompany
and it worked.