You need to sign in to do that
Don't have an account?
TheRealMarchandoj
Visual Flow is failing to run due to issue with Currency value captured
I have created a Visual workflow.
It is to calculate a summary total between 2 lookup objects.
It works most of the time but then sometimes it bombs out, due to the way Salesforce is handling the value stored in a currency field.
The flow looks up invoice records related to a Sales Order record.
It then stores the values in a collection.
The issue I'm having is that one of the invoices is returning it's net value as a figure with 36 decimal places: Net_Value__c=1499.999999999999999999999999999999999999
NOTE: On screen this invoice is displaying a value of 1,500 GBP (as are in this example the other 2 invoices)
Take a look at the collection values returned, below, all 3 invoices have been returned:
Coll_SalesOrderInvoices|[{Id=a0825000000OZOSAA4, Currency__c=GBP, Net_Value__c=1500.0, RecordTypeId=012b0000000PcxRAAS, CurrencyIsoCode=GBP}, {Id=a0825000000OZOXAA4, Currency__c=GBP, Net_Value__c=1500.0, RecordTypeId=012b0000000PcxRAAS, CurrencyIsoCode=GBP}, {Id=a0825000000Oa50AAC, Currency__c=GBP, Net_Value__c=1499.999999999999999999999999999999999999, RecordTypeId=012b0000000PcxRAAS, CurrencyIsoCode=GBP}]
As soon as the flow hits this value, it fails saying that the net_value__c amount was not set or assigned.
However, when the flow runs, it states that the net_value__c is not set or assigned for one of the invoices.. This is the record url: https://cs80.salesforce.com/a0825000000Oa50AAC
Take a look at the collection values returned, below, all 3 invoices have been returned:
Coll_SalesOrderInvoices|[{Id=a0825000000OZOSAA4, Currency__c=GBP, Net_Value__c=1500.0, RecordTypeId=012b0000000PcxRAAS, CurrencyIsoCode=GBP}, {Id=a0825000000OZOXAA4, Currency__c=GBP, Net_Value__c=1500.0, RecordTypeId=012b0000000PcxRAAS, CurrencyIsoCode=GBP}, {Id=a0825000000Oa50AAC, Currency__c=GBP, Net_Value__c=1499.999999999999999999999999999999999999, RecordTypeId=012b0000000PcxRAAS, CurrencyIsoCode=GBP}]
Has any one elese has experience of this kind of thing happening before? Is there anything I can do to resolve this issue?
Thanks inadvance
Jane
DEBUG LOG SNIPPET:
It is to calculate a summary total between 2 lookup objects.
It works most of the time but then sometimes it bombs out, due to the way Salesforce is handling the value stored in a currency field.
The flow looks up invoice records related to a Sales Order record.
It then stores the values in a collection.
The issue I'm having is that one of the invoices is returning it's net value as a figure with 36 decimal places: Net_Value__c=1499.999999999999999999999999999999999999
NOTE: On screen this invoice is displaying a value of 1,500 GBP (as are in this example the other 2 invoices)
Take a look at the collection values returned, below, all 3 invoices have been returned:
Coll_SalesOrderInvoices|[{Id=a0825000000OZOSAA4, Currency__c=GBP, Net_Value__c=1500.0, RecordTypeId=012b0000000PcxRAAS, CurrencyIsoCode=GBP}, {Id=a0825000000OZOXAA4, Currency__c=GBP, Net_Value__c=1500.0, RecordTypeId=012b0000000PcxRAAS, CurrencyIsoCode=GBP}, {Id=a0825000000Oa50AAC, Currency__c=GBP, Net_Value__c=1499.999999999999999999999999999999999999, RecordTypeId=012b0000000PcxRAAS, CurrencyIsoCode=GBP}]
As soon as the flow hits this value, it fails saying that the net_value__c amount was not set or assigned.
However, when the flow runs, it states that the net_value__c is not set or assigned for one of the invoices.. This is the record url: https://cs80.salesforce.com/a0825000000Oa50AAC
Take a look at the collection values returned, below, all 3 invoices have been returned:
Coll_SalesOrderInvoices|[{Id=a0825000000OZOSAA4, Currency__c=GBP, Net_Value__c=1500.0, RecordTypeId=012b0000000PcxRAAS, CurrencyIsoCode=GBP}, {Id=a0825000000OZOXAA4, Currency__c=GBP, Net_Value__c=1500.0, RecordTypeId=012b0000000PcxRAAS, CurrencyIsoCode=GBP}, {Id=a0825000000Oa50AAC, Currency__c=GBP, Net_Value__c=1499.999999999999999999999999999999999999, RecordTypeId=012b0000000PcxRAAS, CurrencyIsoCode=GBP}]
Has any one elese has experience of this kind of thing happening before? Is there anything I can do to resolve this issue?
Thanks inadvance
Jane
DEBUG LOG SNIPPET:
12:14:08.796 (796486729)|FLOW_VALUE_ASSIGNMENT|7872e898dcb627a034d81fc05cd515124a02854-73da|Coll_SalesOrderInvoices|[{Id=a0825000000OZOSAA4, Currency__c=GBP, Net_Value__c=1500.0, RecordTypeId=012b0000000PcxRAAS, CurrencyIsoCode=GBP}, {Id=a0825000000OZOXAA4, Currency__c=GBP, Net_Value__c=1500.0, RecordTypeId=012b0000000PcxRAAS, CurrencyIsoCode=GBP}, {Id=a0825000000Oa50AAC, Currency__c=GBP, Net_Value__c=1499.999999999999999999999999999999999999, RecordTypeId=012b0000000PcxRAAS, CurrencyIsoCode=GBP}] 12:14:08.796 (796495141)|FLOW_VALUE_ASSIGNMENT|7872e898dcb627a034d81fc05cd515124a02854-73da|fLookup_Sales_Order_Invoices|true 12:14:08.796 (796510347)|FLOW_BULK_ELEMENT_DETAIL|FlowRecordLookup|fLookup_Sales_Order_Invoices|3 12:14:08.796 (796582078)|FLOW_ELEMENT_END|7872e898dcb627a034d81fc05cd515124a02854-73da|FlowRecordLookup|fLookup_Sales_Order_Invoices 12:14:08.796 (796609247)|FLOW_ELEMENT_BEGIN|7872e898dcb627a034d81fc05cd515124a02854-73da|FlowLoop|Loop_thru_Sales_Order_Invoices 12:14:08.796 (796748013)|FLOW_VALUE_ASSIGNMENT|7872e898dcb627a034d81fc05cd515124a02854-73da|Loopvar_SalesOrderInvoices|{Id=a0825000000OZOSAA4, Currency__c=GBP, Net_Value__c=1500.0, RecordTypeId=012b0000000PcxRAAS, CurrencyIsoCode=GBP} 12:14:08.796 (796754086)|FLOW_VALUE_ASSIGNMENT|7872e898dcb627a034d81fc05cd515124a02854-73da|Loop_thru_Sales_Order_Invoices.currentIteration|0 12:14:08.796 (796769067)|FLOW_LOOP_DETAIL|7872e898dcb627a034d81fc05cd515124a02854-73da|0|a0825000000OZOSAA4 12:14:08.796 (796796234)|FLOW_ELEMENT_END|7872e898dcb627a034d81fc05cd515124a02854-73da|FlowLoop|Loop_thru_Sales_Order_Invoices 12:14:08.796 (796829996)|FLOW_ELEMENT_BEGIN|7872e898dcb627a034d81fc05cd515124a02854-73da|FlowAssignment|Assign_Net_Amount_to_total_Net_Amount_for_Sales_Order_Invoices 12:14:08.797 (797227031)|FLOW_ASSIGNMENT_DETAIL|7872e898dcb627a034d81fc05cd515124a02854-73da|var_TotalNetAmount|ADD|1,500 12:14:08.797 (797349272)|FLOW_ASSIGNMENT_DETAIL|7872e898dcb627a034d81fc05cd515124a02854-73da|var_Currency|ASSIGN|GBP 12:14:08.797 (797357953)|FLOW_VALUE_ASSIGNMENT|7872e898dcb627a034d81fc05cd515124a02854-73da|var_Currency|GBP 12:14:08.797 (797366047)|FLOW_VALUE_ASSIGNMENT|7872e898dcb627a034d81fc05cd515124a02854-73da|var_TotalNetAmount|EUR 1500.0 12:14:08.797 (797390537)|FLOW_ELEMENT_END|7872e898dcb627a034d81fc05cd515124a02854-73da|FlowAssignment|Assign_Net_Amount_to_total_Net_Amount_for_Sales_Order_Invoices 12:14:08.797 (797410102)|FLOW_ELEMENT_BEGIN|7872e898dcb627a034d81fc05cd515124a02854-73da|FlowLoop|Loop_thru_Sales_Order_Invoices 12:14:08.797 (797523502)|FLOW_VALUE_ASSIGNMENT|7872e898dcb627a034d81fc05cd515124a02854-73da|Loopvar_SalesOrderInvoices|{Id=a0825000000OZOXAA4, Currency__c=GBP, Net_Value__c=1500.0, RecordTypeId=012b0000000PcxRAAS, CurrencyIsoCode=GBP} 12:14:08.797 (797532483)|FLOW_VALUE_ASSIGNMENT|7872e898dcb627a034d81fc05cd515124a02854-73da|Loop_thru_Sales_Order_Invoices.currentIteration|1 12:14:08.797 (797555884)|FLOW_LOOP_DETAIL|7872e898dcb627a034d81fc05cd515124a02854-73da|1|a0825000000OZOXAA4 12:14:08.797 (797587569)|FLOW_ELEMENT_END|7872e898dcb627a034d81fc05cd515124a02854-73da|FlowLoop|Loop_thru_Sales_Order_Invoices 12:14:08.797 (797616962)|FLOW_ELEMENT_BEGIN|7872e898dcb627a034d81fc05cd515124a02854-73da|FlowAssignment|Assign_Net_Amount_to_total_Net_Amount_for_Sales_Order_Invoices 12:14:08.797 (797768688)|FLOW_ASSIGNMENT_DETAIL|7872e898dcb627a034d81fc05cd515124a02854-73da|var_TotalNetAmount|ADD|1,500 12:14:08.797 (797875180)|FLOW_ASSIGNMENT_DETAIL|7872e898dcb627a034d81fc05cd515124a02854-73da|var_Currency|ASSIGN|GBP 12:14:08.797 (797882621)|FLOW_VALUE_ASSIGNMENT|7872e898dcb627a034d81fc05cd515124a02854-73da|var_Currency|GBP 12:14:08.797 (797888579)|FLOW_VALUE_ASSIGNMENT|7872e898dcb627a034d81fc05cd515124a02854-73da|var_TotalNetAmount|EUR 3000.0 12:14:08.797 (797909624)|FLOW_ELEMENT_END|7872e898dcb627a034d81fc05cd515124a02854-73da|FlowAssignment|Assign_Net_Amount_to_total_Net_Amount_for_Sales_Order_Invoices 12:14:08.797 (797927682)|FLOW_ELEMENT_BEGIN|7872e898dcb627a034d81fc05cd515124a02854-73da|FlowLoop|Loop_thru_Sales_Order_Invoices 12:14:08.798 (798029057)|FLOW_VALUE_ASSIGNMENT|7872e898dcb627a034d81fc05cd515124a02854-73da|Loopvar_SalesOrderInvoices|{Id=a0825000000Oa50AAC, Currency__c=GBP, Net_Value__c=1499.999999999999999999999999999999999999, RecordTypeId=012b0000000PcxRAAS, CurrencyIsoCode=GBP} 12:14:08.798 (798046655)|FLOW_VALUE_ASSIGNMENT|7872e898dcb627a034d81fc05cd515124a02854-73da|Loop_thru_Sales_Order_Invoices.currentIteration|2 12:14:08.798 (798066012)|FLOW_LOOP_DETAIL|7872e898dcb627a034d81fc05cd515124a02854-73da|2|a0825000000Oa50AAC 12:14:08.798 (798098896)|FLOW_ELEMENT_END|7872e898dcb627a034d81fc05cd515124a02854-73da|FlowLoop|Loop_thru_Sales_Order_Invoices 12:14:08.798 (798130746)|FLOW_ELEMENT_BEGIN|7872e898dcb627a034d81fc05cd515124a02854-73da|FlowAssignment|Assign_Net_Amount_to_total_Net_Amount_for_Sales_Order_Invoices 12:14:08.798 (798942074)|FLOW_ELEMENT_END|7872e898dcb627a034d81fc05cd515124a02854-73da|FlowAssignment|Assign_Net_Amount_to_total_Net_Amount_for_Sales_Order_Invoices 12:14:08.830 (830765192)|FLOW_ELEMENT_ERROR|The flow failed to access the value for Loopvar_SalesOrderInvoices.Net_Value__c because it hasn't been set or assigned.|| 12:14:08.830 (830793063)|FLOW_START_INTERVIEW_END|7872e898dcb627a034d81fc05cd515124a02854-73da|Calc Invoiced To Date - part 1
This issue does not seem to occur with standard curency fields like unitprice or formula currency field.