Salesforce to Quickbooks Desktop


Here If we want to send Shipping and Handling(Shipping_Handling__c) of 200 $ as a invoice-lineitem in Quickbooks then follow the below steps

SOLUTION :

Go to Opportunity To Invoice process in DBSync and in the Invoice insert rule add the below mappings in the validate row:

{

String POAmt = VALUE("Shipping_Handling__c");


String valueAfterDecimal[] = POAmt.split("\\.");


if(LEN(valueAfterDecimal[1]) > 1){}


Else

{


POAmt=VALUE("Shipping_Handling__c")+"0";


}

LOG("Amount"+POAmt);


ADDXML2SOURCE("OpportunityLineItems","<records><PricebookEntry><Product2>


<Name>Shipping and Handling</Name><Description>This is a shipping and handling 


charge</Description></Product2>


</PricebookEntry><Quantity>1.0</Quantity>


<UnitPrice>"+POAmt+"</UnitPrice></records>");


LOG(GETSOURCEXML2STRING());


return IF(ISEMPTY(VALUE("AVSFQB__Quickbooks_Id__c")),"true","false");


}


And also we should remove the mappings for SFLINEID in the same rule, Go to InvoicelineAdd and remove the mappings for DataExt for SFLINEID. And Save