You need to sign in to do that
Don't have an account?
Create Records from comma separated values stored in a text field
Hi all,
I have a text field against the Opportunity object that sometimes contains data such as:
0123456,0234567,0345678 etc
There could sometimes only be one value and on other occasions there might be 10 or so.
When this field is populated I'd like to use these IDs to lookup a Product record (via a custom SKU field) and subsequently create an OpportunityProduct record linked to the Opportunity.
What is the best approach here? I'm not an Apex developer although I have written simple triggers after gaining advice and examples from the community previously. I started to experiment in Flow, but stumbled early on when I couldn't see a way to split the comma seperated text value
Looking forward to your advice.
Thanks,
Ross
I have a text field against the Opportunity object that sometimes contains data such as:
0123456,0234567,0345678 etc
There could sometimes only be one value and on other occasions there might be 10 or so.
When this field is populated I'd like to use these IDs to lookup a Product record (via a custom SKU field) and subsequently create an OpportunityProduct record linked to the Opportunity.
What is the best approach here? I'm not an Apex developer although I have written simple triggers after gaining advice and examples from the community previously. I started to experiment in Flow, but stumbled early on when I couldn't see a way to split the comma seperated text value
Looking forward to your advice.
Thanks,
Ross
Thanks for this! I can follow most of the above - I'd rather understand it than just copy and paste into my org ;-)
On lines 2 and 4, this isn't creating a new Opportunity it's just referencing the Opportunity that fired this trigger - is that correct?
Secondly, line 7 makes sense to me for creating the OpportunityLineItem record but I think there's a step missing before that, because I'd need to lookup the Product.ID with the custom SKU field before using that ID in the OpportunityLineItem record addition. How would I do that?
Thanks,
Ross