February 08, 2019

How to get QueryRange from Query object X++

Hi Folks,

This post is about how to get QueryRange from a query object in x++ code. This is very useful when you have to pass a query on another object and perform a certain operation based on this query and its ranges.

To understand this code sample better, let's take a scenario. On FormA I have to build a query (OR use AOT query) on run time based on certain ranges. When the user clicks on a button system will pass this query to FormB and on FormB we have to use this query and its ranges to perform other sets of operations.

Now let's see the code, which may need to write on Form B to take a query as a parameter and fetch the ranges and its values in code.



I hope this will help.

-Cheers!!!
Harry
PS: My VM is down for some reason and I couldn't prove the code and have to write it manually so you might get some syntax issues in the above code.

February 01, 2019

[Solved] Error while generating vendor payment #MSDyn365FO

Hi Folks,

I was getting an error while generating a payment journal, thought accounts payable. Here are a quick summary and solution on the same. 

Error: While creating payment Journal and Click on Generate payments button system throwing below error
Generate payments Message details Cannot edit a record in Journal lines (LedgerJournalTransPayment_BR). The record has never been selected














Possible Reason:
It might be coming to a new environment where you never did a setup for payment method, that you are using in your journal.

Solution:
1. Go to Methods of payment(Purchase Ledger /Accounts payable > Payment setup > Methods of payment). Select the method with you are using in your journal. Let's take Cheque for eg.
2.  GO to file format tab and check value under field ‘Export format’, which belongs to BR country-specific features.






Ideally, it should match the method of payment. But here its ‘Configurable layout file’ which is not a Cheque layout.

















3. So now click on the Setup button and add Cheque in selected formats. Save it and close




















4. Change to cheque
















5. Now try to generate payment again, it should work.

Cheers!!!

Harry
Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta