• TheRealMarchandoj
  • NEWBIE
  • 10 Points
  • Member since 2015
  • Business Analyst

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
I need to build a query which allows me to pull back, Opportunity Line Items, Opportunity, Order and Order Items.
I've started writing the query on Opportunity, but I cannot figure out how to query the Order Items, as I am still getting my head around SOQL.

Can someone help point me in the right direction?

Thanks
 
SELECT Id, Order__c, Order__r.CreatedDate, Owner.Name,                   
                     (SELECT Id, Training__c, Scrappage_Cost__c, Misc_Cost__c FROM OpportunityLineItems) FROM Opportunity WHERE RecordType.DeveloperName != 'CoolAir_Quote' AND Order__c != ''

 
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

JaneUser-added image


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

 
Hi
I've a scenario where, we have a class which calculates summary totals on the Order object based on values stored in an invoice object.
The invoice object only has a lookup relationship to Orders.
The  calculations derived from the apex class are then displayed on the Order, in a visualforce page
Note: no fields are being updated on the Order record during this time.

My problem is, that  I have been asked to display the same summary total information, in the edit page of each invoice.
What is the easiest way of achieving this?
Also, I am not a coder. I can read code and make small tweaks to code so need to be able to copy and paste ideally.
I am very proficient in visualwork flow, and am thinking this may be an option but have a very tight deadline to complete this work so do not want too complicated.

Thanks in advance,

Jane
Hi
I've a scenario where, we have a class which calculates summary totals on the Order object based on values stored in an invoice object.
The invoice object only has a lookup relationship to Orders.
The  calculations derived from the apex class are then displayed on the Order, in a visualforce page
Note: no fields are being updated on the Order record during this time.

My problem is, that  I have been asked to display the same summary total information, in the edit page of each invoice.
What is the easiest way of achieving this?
Also, I am not a coder. I can read code and make small tweaks to code so need to be able to copy and paste ideally.
I am very proficient in visualwork flow, and am thinking this may be an option but have a very tight deadline to complete this work so do not want too complicated.

Thanks in advance,

Jane