SBX - Search With Button

SBX - Forum Post Title

Unable to Insert Quantity in Sales Line

Microsoft Dynamics NAV Forum

Daniel Pereira asked a question on 9 Nov 2018 4:51 AM
My Badges

Question Status

Suggested Answer

Hello, 

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. 

Thank you. 

Reply
Suresh Kulla responded on 9 Nov 2018 7:00 PM
Suggested Answer

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. 

Reply
RockWith NAV responded on 16 Nov 2018 2:29 AM
My Badges
Suggested Answer

Did you tried debugging your Code?

Reply
Suresh Kulla responded on 9 Nov 2018 7:00 PM
Suggested Answer

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. 

Reply
RockWith NAV responded on 16 Nov 2018 2:29 AM
My Badges
Suggested Answer

Did you tried debugging your Code?

Reply

SBX - Two Col Forum

SBX - Migrated JS