I am trying to integrate CRM and NAV using MS Flow wherein Crm Id and quantity are coming from Crm through MS Flow. Now, I am trying to Insert a sales Line with the following code:
Item.RESET; Item.SETFILTER(CrmId,'%1',"Crm Id"); IF Item.FINDFIRST THEN BEGIN "Document Type" := Rec."Document Type"::Order; VALIDATE(Type,Rec.Type::Item); VALIDATE("No.",Item."No."); END;
I have written this code on OnInsert() to get the No. in the sales line. This works fine but the quantity is not been fetched.
When I remove this code, quantity from the MS Flow is fetched properly.
I don't know how and where do I fetch the quantity. I am not able to find proper Trigger for it. May seen like a trivial issue. But i am literally stuck on it.
Help would be really appreciated.
I think the Quantity is cleared when you update the Type or No. before you update store the quantity in a variable and after you assign the No. update Quantity Again.
Did you tried debugging your Code?
Business Applications communities