Invalid field/related field combination - axapta

I'm trying to make an entity like vendor in ax 2012. When I click the "new" button I get following error;
Invalid field/related field combination.
I have looked for it on search engines and found out that it might be due to wrong joins used in data sources of the form. I have gone through the joins and links, they all are fine but I'm still getting the same error.
Any one, any idea?

Put a breakpoint in the info.add method to catch AX in the deed.

Related

Operation isnt valid due to current state

I know there are many tutorials but I cant connect them with my specific case, so i'd like if anyone could make it clear to me.
https://i.stack.imgur.com/zyNoE.png
https://i.stack.imgur.com/9uFcZ.png
when updating through my grid my date update is working great but somewhy when trying to update name ('שם') the error is thrown. thanks
edit** if u see comments // ull see one line the name is working fine but date isnt. and another one is the exact opposite.
another thing I found out is that if I update both name and date at the same time, I get no error..

Wordpress + Contact Form 7: One or more fields have an error (treating first field as empty even when it is filled)

I am asking this question after I found the answer so that no one else spends much time debugging it in case the same happened to them (my googling didn't yield many useful results)
In short, some of my CF7 forms suddenly stopped submitting and it was giving me the orange error about empty fields. It was also flagging the first field in the form as being empty even though it was filled.
Nothing was being logged in Flamingo. Recaptcha was working properly. I attempted to fix the permalinks. Nothing was fixing the issue.
Turns out it was a problem with how some field codes were written inside the HTML of the form. The type of error will be unique, but in general, make sure your fields are written properly and that there are no commented parts in the form HTML.
In my case, the error was as follows:
I was using the following code for some select fields:
And to be written properly they had to be as such:
That was it for me.

Function SalesTable2LineField.lineUpdateDescription has been used incorrectly

In Dynamics AX 2012, when trying to update the value of the field DlvMode or adding a new delivery address in the sales order (through the Header view), I keep getting this error:
Function SalesTable2LineField.lineUpdateDescription has been used
incorrectly
There's no customization in this method or this class.
This is something that could be debugged in 15 minutes if you had a developer. My guess would be that you are using one of these country codes:
AT,BE,CZ,DK,EE,FI,FR,DE,HU,IE,IT,LV,LT,NL,PL,ES,SE,GB,RU,MY (SalesTable_W)
BR (SalesTable_BR)
IN (SalesTable_IN)
In \Classes\SalesTable2LineField\lineUpdateDescription at the very end, immediately above the throw error... line add this:
info(strFmt("Offending table is %1 (%2)", tableId2name(tableId), tableId));
You should also add a breakpoint if that alone doesn't help and figure it out.
Then repeat the operation, and you will know the table. It's possible it's just a Microsoft bug or if \Forms\SalesTable has been modified, it could be that. You just need to debug it.

Setting Vendor Number in X++ General Journal

I'm posting to a general journal in ax 2012. I'm able to create the journal and enter most line information from x++ code. Now i'm having an issue with some vendor numbers.
When I use this code most of the time it works. But there are a few vendor numbers that are not able to be found from this table and of course throws an error. Weird thing is if I actually go into ax and type in the vendor number it does accept it because it has been setup in the system but by this code it is not working (for some).
Just wondering if there is something wrong with how the vendor number is setup, properly not linked with something, or if there is another way to properly set this parameter.
It looks like parmledgerDimension uses a RecId for vendors and only pulls it from DimensionAttributeValueCombination.
Any ideas?
DimensionAttributeValueCombination davc;
firstonly RecId from davc where davc.DisplayValue == account; //could be 010-000001
journalTrans.parmLedgerDimension(davc.RecId);
Try using
DimensionStorage::getDynamicAccount(account, LedgerJournalACType::Vend);
https://msdn.microsoft.com/en-us/library/dimensionstorage.getdynamicaccount.aspx
Edit: the first line I posted was to get the default dimension. I'll leave it in case you need it
LedgerJournalEngine::getAccountDefaultDimension(account, curext(), LedgerJournalACType::Vend);
https://msdn.microsoft.com/en-us/library/ledgerjournalengine.getaccountdefaultdimension.aspx

NVelocity template error in c#

I am fairly new in using NVelocity. I am trying to edit some of the old templates for my company and i ma getting this error which i dont understand. OK so in template, if order has multiple shipments then show multiple shipment name and if only one then show only one shipment name. when there is multiple shipments, it works fine BUT when there is only one then somehow template does not renders the required shiment name instead printout the class name.
#if($order.Shipments.Count > 1)
#foreach($shipment in $order.Shipments)
#beforeall
#each
$shipment.ShipMethodName <strong>|</strong>
#else
$order.Shipments[0].ShipMethodName // in emails it renders "Orders.OrderShipmentCollection[0].ShipMethodName"
#end
#end
Please help.
I know this is an old question, but in case someone is looking for a solution later I thought I'd post an answer as I was going through old questions that don't have accepted answers. I don't how I didn't notice the error when I posted that comment in September last year.
$order.Shipments[0].ShipMethodName is giving you Orders.OrderShipmentCollection[0].ShipMethodName because NVelocity doesn't support indexers like C#, you need to use the get_Item() method, i.e. $order.Shipments.get_Item(0).ShipMethodName that is the underlying method the C# compiler creates for indexers.
What is happening is $order.Shipments prints out the type name (Orders.OrderShipmentCollection) and the rest [0].ShipMethodName just gets printed verbatim.

Resources