0

I have a flattened datatable column like this one simplified:

helper:

newLine.amount = newLine.price__c * newLine.qty__c;

Now i need to create a new record on the SF Object with this "amount" value.

I transfer to SF as SObject.

in the APEX Controller I create the new record:

for (SObject newResults : newLines ){
            Result__c newR = new Result__c();
            switch on newResults {
                when LineX__c lx {
                    newCR.amount__c = lx.amount__c;
 ...

But I want to use the value from "amount" from the datatable fieldName instead "lx.amount__c". How / can I do this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.