• shivangi shailesh 8
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 4
    Replies
Vf page:
<apex:page controller="HSMPartnerTermsControllerISV" showHeader="false">
 <apex:includeScript value="{!$Resource.PDFObject}"/> 
  <apex:form >
   <html>
        <head>
            <title>Honeywell Scanning and Mobility</title>
            <meta name="description" content="Don't forget to add a 1-2 sentence description here."/>
            <meta name="keywords" content="Don't forget to add 20-30 important keywords here."/>
            <script src="{!URLFOR($Resource.HSM_Resource, '/js/jquery-1.11.1.min.js')}" type="text/javascript"></script>
            <script src="{!URLFOR($Resource.HSM_Resource, '/js/jquery-1.9.1.js')}" type="text/javascript"></script>
            <script src="{!URLFOR($Resource.HSM_Resource, '/js/custom.js')}" type="text/javascript"></script>
            <link href="{!URLFOR($Resource.HSM_Resource, '/css/style.css')}" rel="stylesheet" type="text/css"/>
         </head>  

   <body>
   <div id="wrapper">
      <header class="overflow">
      <div id="logo"><a href="#">
      <img border="0" src="{!$Resource.ISV_logo}" width="750px" height="60px" alt="Honeywell Scanning and Mobility" title="Honeywell Scanning and Mobility"/>
      
      </a></div>
      <nav>
        <ul class="Customul Pad24 FRgt">
        <li><a href="#" class="linkR">Contact Us</a></li>
        <li>l</li>
        <li><a href="#" class="linkR">Help</a></li>
        </ul>
      </nav>
  </header>

   <apex:pageBlock title=""> 
   <div >
    <!-- <object data="/servlet/servlet.FileDownload?file=015A0000004jP1f#toolbar=1&#38;navpanes=0&#38;scrollbar=1&#38;page=1&#38;view=FitH" 
     type="application/pdf" 
     width="900px" 
     height="500px"/> 
     <apex:iframe src="/servlet/servlet.FileDownload?file=015A0000005pZW0" scrolling="true" height="500" width="900"/> -->
     <p > Please download and review the Independent Software Vendor Program Agreement, then return to this page and sign.</p>
     <br/>
     <a href="https://honeywellsps.my.salesforce.com/sfc/p/00000000SK3U/a/A0000000HuOn/DWxp_TvODlu2E6.JK7eSV19qSHYtyBo_uzlpAs6qz.0" target="_blank">
     <p >Independent Software Vendor Program Agreement</p>
     </a>
     <br/>
     <a href="https://honeywellsps.my.salesforce.com/sfc/p/00000000SK3U/a/2K0000008lBu/IsMIOGxj0DTtpLq1RLrTzikUWZavR4bXvbNZSTKerTM" target="_blank">
     <p >APAC ISV Partner agreement (Terms and Conditions)</p>
     </a>
                   
    </div>

    <br/>
    <br/>

    <div id="firtTableDiv">
  
     <table id="firstTable" class="gridview" >

       <tr>
       <th></th>
       <th></th>
       </tr>
     
       <tr>
          <th style="background-color:#3B87DE" colspan="4"><font color="white">PARTNER INFORMATION</font></th>
       </tr>

      <tr>
         <td width="40%"><apex:outputText value="First Name"/></td>
        <td width="40%"><apex:inputField value="{!cont.FirstName}"/></td>
         <td width="50%"><apex:outputText value="Last Name"/></td>
        <td width="50%"><apex:inputField required="true"  value="{!cont.LastName}"/></td>
      </tr>
      
      <tr>
         <td width="40%"><apex:outputText value="Email"/></td>
        <td width="40%"><apex:inputField required="true"  value="{!cont.Email}"/></td>
         <td width="50%"><apex:outputText value="Title"/></td>
        <td width="50%"><apex:inputField required="true"  value="{!cont.title}"/></td>
      </tr>
     
      </table>
   </div>

    <br/>
    <br/>

    <div align="center"> 
     <apex:commandButton action="{!save}" value="I Accept" /> &nbsp;
     <apex:commandButton onClick="window.top.close();"  value="Decline" />
    </div>
   
  </apex:pageBlock>
  </div>

   </body>
   </html>
 </apex:form>
</apex:page>

Controller:
public without sharing class HSMPartnerTermsControllerISV{
  
  public Contact cont { get; set; }
    
  public Id accId;
    
  public HSMPartnerTermsControllerISV() {
      cont = new Contact();
      accId= apexpages.currentpage().getparameters().get('accid');
  }

  public PageReference save() 
  {
    try 
    {
           if(cont.Email==null){
            ApexPages.AddMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Please enter register email'));
            return null;
            }
            
            if(cont.FirstName==null){
            ApexPages.AddMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Please FirstName'));
            return null;
            }
            
         if(cont.LastName==null){
            ApexPages.AddMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Please LastName'));
            return null;
            }
            
         if(cont.Title==null){
            ApexPages.AddMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Please enter Title'));
            return null;
            }
            
        System.debug('Email '+cont.Email +'Account Id' +accId);
            
        List<Contact> checkCont = [SELECT Id, AccountId,Account.Name, Email FROM Contact where email=:cont.Email and AccountId=:accId limit 1];
        
        List<Account> acc        =[Select Id, Partner_Type__c,ISV_T_C_Accepted_Date__c,ISV_T_C_Accepted_By__c from account where Id=:accId limit 1];
    
       if(checkCont.isEmpty())
        {
          cont.AccountId=accId;
          insert cont;
          
          if(acc[0].Partner_Type__c =='ISV'){
              // ISV T&C Acceptance Section Fields
              acc[0].ISV_T_C_Accepted_By__c   = cont.Id;
              acc[0].ISV_T_C_Accepted_Date__c = System.Today();
              acc[0].ISV_T_C_Accepted__c=true;
              acc[0].ISV_T_C_Transition_Status__c='Accepted';
              update acc;
          }
          // T&C Acceptance Section Fields
          else{
              acc[0].T_C_Accepted_By__c   = cont.Id;
              acc[0].T_C_Accepted_Date__c = System.Today();
              acc[0].T_C_Accepted__c=true;
              acc[0].T_C_Transition_Status__c='Accepted';
              update acc;
          }
        } 
        
        else {
         if(acc[0].Partner_Type__c =='ISV'){  
           acc[0].ISV_T_C_Accepted_By__c   = checkCont[0].Id;
           acc[0].ISV_T_C_Accepted_Date__c = System.Today();
           acc[0].ISV_T_C_Transition_Status__c='Accepted';
           acc[0].ISV_T_C_Accepted__c=true;
           update acc;
          }
          else{ 
           // T&C Acceptance Section Fields
           acc[0].T_C_Accepted_By__c   = checkCont[0].Id;
           acc[0].T_C_Accepted_Date__c = System.Today();
           acc[0].T_C_Accepted__c=true;
           acc[0].T_C_Transition_Status__c='Accepted';
           update acc;
          } 
        }
        
        PageReference newocp = new PageReference('/HSMPartnerThank');
        newocp.setRedirect(true);
        return newocp;
    } catch (DMLException e) {
        ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR, 'Error.'));
        return null;
    }

    return null;
  }
  
  public PageReference cancel() {
    try {
        
        System.debug('Email '+cont.Email +'Account Id' +accId);
        
        List<Contact> checkCont = [SELECT Id, AccountId,Account.Name, Email FROM Contact where email=:cont.Email and AccountId=:accId limit 1];
        
        List<Account> acc        =[Select Id,Partner_Type__c,ISV_T_C_Accepted_Date__c,ISV_T_C_Accepted_By__c from account where Id=:accId limit 1];
    
       if(checkCont.isEmpty())
        {
          cont.AccountId=accId;
          insert cont;
          if(acc[0].Partner_Type__c =='ISV'){
          //ISV T&C Acceptance Section Fields
          acc[0].ISV_T_C_Accepted_By__c   = cont.Id;
          acc[0].ISV_T_C_Accepted_Date__c = System.Today();
          acc[0].ISV_T_C_Transition_Status__c='Declined';
          acc[0].ISV_T_C_Accepted__c=false;
          update acc;
          }
          else{
          // T&C Acceptance Section Fields
          acc[0].T_C_Accepted_By__c   = cont.Id;
          acc[0].T_C_Accepted_Date__c = System.Today();
          acc[0].T_C_Accepted__c=false;
          acc[0].T_C_Transition_Status__c='Declined';            
          update acc;
          }
        } else{
            if(acc[0].Partner_Type__c =='ISV'){
          //ISV T&C Acceptance Section Fields
           acc[0].ISV_T_C_Accepted_By__c   = checkCont[0].Id;
           acc[0].ISV_T_C_Accepted_Date__c = System.Today();
           acc[0].ISV_T_C_Transition_Status__c='Declined';
           acc[0].ISV_T_C_Accepted__c=false;
            update acc;
            }
           else{
           // T&C Acceptance Section Fields
           acc[0].T_C_Accepted_By__c   = checkCont[0].Id;
           acc[0].T_C_Accepted_Date__c = System.Today();
           acc[0].T_C_Accepted__c=false;
           acc[0].T_C_Transition_Status__c='Declined';
           update acc;
           }
        }
        
        PageReference newocp = new PageReference('/HSMPartnerThank');
        newocp.setRedirect(true);
        return newocp;
    } catch (DMLException e) {
        ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR, 'Error.'));
        return null;
    }

    return null;
  }
}
 
trigger FetchingDataFromOrder on ABI_SFA_Orders_with_Case__c (before insert,before update) {
      CaseRelatedlistFromOrder handler = new  CaseRelatedlistFromOrder();
      handler.Updateorderlinkdata(Trigger.new);
}    
  Trigger 

Trigger handler class:

public class CaseRelatedlistFromOrder{

    public void Updateorderlinkdata(list<id>listOrders){
           
        
        For(ABI_SFA_Orders_with_Case__c owc :listOrders){
        if(owc.ABI_SFA_Case__c != null && owc.ABI_SFA_Order_Link__c != null){
            listOrders.add(owc.ABI_SFA_Order_Link__c);

        }
        list<ABI_SFA_Order__c> listNewOrders = [select id,ABI_SFA_Accounting_resolution__c,ABI_SFA_Negotiations_Status__c from ABI_SFA_Order__c where id =: listOrders];
        
        
        For(ABI_SFA_Orders_with_Case__c owc2 : listOrders){
            
            for(ABI_SFA_Order__c ord :listNewOrders){
                if(owc2.ABI_SFA_Order_Link__c == ord.id){
                    owc2.ABI_SFA_Accounting_resolution__c= ord.ABI_SFA_Accounting_resolution__c;
                    owc2.ABI_SFA_Negotiations_status__c= ord.ABI_SFA_Negotiations_Status__c;
                    
                    
                }
                
            }
        }
        
    }
    }
}
Hi guys,plesae help me out with this scenario:
Here the  list view named of Object Sla_sanpshot__c who is a child of sla__c object.
In list view there is fields like A__c  AND B__c from Sla_snapshot__c so if i will update this fields then i want to change the value in my formula which is like (A/B)*100...SO writing trigger to update but it is throwning me an error:

if(trigger.isbefore)
{
    if(Trigger.isUpdate || Trigger.isInsert)
    {
        for(SLA_Snapshot__c s: Trigger.new)
        {
            s.Formula__c  = s.Formula__c != null ? string.valueof(s.Formula__c) : '';
           string.valueof(s.Formula__c).replace('A',s.A__c); 
        } 
    }
}User-added imageUser-added image
<lightning:input type="toggle" label="Reimbursed?" name="reimbursed" class="slds-p-around--small" checked="{!v.expense.Reimbursed__c}" messageToggleActive="Yes" messageToggleInactive="No" onchange="{!c.clickReimbursed}"/>..can anyone explain me this
Hi ,
function validateFormula(){
                    console.log("start validateFormula");
                    var formula = "{!SLA_Snapshot__c.Formula__c}";
                    var A = document.getElementById("{!$Component.frm.A}") ? document.getElementById("{!$Component.frm.A}").value : "";
                    var B = document.getElementById("{!$Component.frm.B}") ? document.getElementById("{!$Component.frm.B}").value : "";
                    var C = document.getElementById("{!$Component.frm.C}") ? document.getElementById("{!$Component.frm.C}").value : "";
                    var D = document.getElementById("{!$Component.frm.D}") ? document.getElementById("{!$Component.frm.D}").value : "";
                    var E = document.getElementById("{!$Component.frm.E}") ? document.getElementById("{!$Component.frm.E}").value : "";
                    var snapFormulaWithValues = formula.replace('A',A).replace('B',B).replace('C',C).replace('D',D).replace('E',E);
                      try{
                        var result = eval(snapFormulaWithValues);
                        document.getElementById("{!$Component.frm.ResultValue}").innerText = result.toFixed(2);
                        document.getElementById("{!$Component.frm.ResultValueHidden}").value = result.toFixed(2);
                        
                        if(document.getElementById("{!$Component.frm.ResultValue}").innerText.includes("NaN"))
                            {
                                document.getElementById("{!$Component.frm.ResultValue}").innerText = "not available";                                
                            }
    Formula is (A/B)*100 .pLEASE TELL WHERE TO HANDLE THIS SO THAT SOMETHING WILL HAPPEN LIKE 
iF A =0 AND B=0 the result should be '0' but currently NAN ERROR IS COMING.
Hi ,
On list view i have to write the trigger to get the value in the field Result__c which is a field on SLA_SNAPSHOT__C object (child).Parent object has field A__c,B__c  AND FORMULA__c so here in list view if suppose previously A__c value is 23 and B__c value 45 then according to the formula which is dynamic so can be anything for eg.(A/B)*100 .Now i want if i have update these values of A and b in list view then according to the formula ,result value should also get changed.I am writng trigger for this but not able to getting issues in converting formula.  

Thanks in advance.
Vf page:
<apex:page controller="HSMPartnerTermsControllerISV" showHeader="false">
 <apex:includeScript value="{!$Resource.PDFObject}"/> 
  <apex:form >
   <html>
        <head>
            <title>Honeywell Scanning and Mobility</title>
            <meta name="description" content="Don't forget to add a 1-2 sentence description here."/>
            <meta name="keywords" content="Don't forget to add 20-30 important keywords here."/>
            <script src="{!URLFOR($Resource.HSM_Resource, '/js/jquery-1.11.1.min.js')}" type="text/javascript"></script>
            <script src="{!URLFOR($Resource.HSM_Resource, '/js/jquery-1.9.1.js')}" type="text/javascript"></script>
            <script src="{!URLFOR($Resource.HSM_Resource, '/js/custom.js')}" type="text/javascript"></script>
            <link href="{!URLFOR($Resource.HSM_Resource, '/css/style.css')}" rel="stylesheet" type="text/css"/>
         </head>  

   <body>
   <div id="wrapper">
      <header class="overflow">
      <div id="logo"><a href="#">
      <img border="0" src="{!$Resource.ISV_logo}" width="750px" height="60px" alt="Honeywell Scanning and Mobility" title="Honeywell Scanning and Mobility"/>
      
      </a></div>
      <nav>
        <ul class="Customul Pad24 FRgt">
        <li><a href="#" class="linkR">Contact Us</a></li>
        <li>l</li>
        <li><a href="#" class="linkR">Help</a></li>
        </ul>
      </nav>
  </header>

   <apex:pageBlock title=""> 
   <div >
    <!-- <object data="/servlet/servlet.FileDownload?file=015A0000004jP1f#toolbar=1&#38;navpanes=0&#38;scrollbar=1&#38;page=1&#38;view=FitH" 
     type="application/pdf" 
     width="900px" 
     height="500px"/> 
     <apex:iframe src="/servlet/servlet.FileDownload?file=015A0000005pZW0" scrolling="true" height="500" width="900"/> -->
     <p > Please download and review the Independent Software Vendor Program Agreement, then return to this page and sign.</p>
     <br/>
     <a href="https://honeywellsps.my.salesforce.com/sfc/p/00000000SK3U/a/A0000000HuOn/DWxp_TvODlu2E6.JK7eSV19qSHYtyBo_uzlpAs6qz.0" target="_blank">
     <p >Independent Software Vendor Program Agreement</p>
     </a>
     <br/>
     <a href="https://honeywellsps.my.salesforce.com/sfc/p/00000000SK3U/a/2K0000008lBu/IsMIOGxj0DTtpLq1RLrTzikUWZavR4bXvbNZSTKerTM" target="_blank">
     <p >APAC ISV Partner agreement (Terms and Conditions)</p>
     </a>
                   
    </div>

    <br/>
    <br/>

    <div id="firtTableDiv">
  
     <table id="firstTable" class="gridview" >

       <tr>
       <th></th>
       <th></th>
       </tr>
     
       <tr>
          <th style="background-color:#3B87DE" colspan="4"><font color="white">PARTNER INFORMATION</font></th>
       </tr>

      <tr>
         <td width="40%"><apex:outputText value="First Name"/></td>
        <td width="40%"><apex:inputField value="{!cont.FirstName}"/></td>
         <td width="50%"><apex:outputText value="Last Name"/></td>
        <td width="50%"><apex:inputField required="true"  value="{!cont.LastName}"/></td>
      </tr>
      
      <tr>
         <td width="40%"><apex:outputText value="Email"/></td>
        <td width="40%"><apex:inputField required="true"  value="{!cont.Email}"/></td>
         <td width="50%"><apex:outputText value="Title"/></td>
        <td width="50%"><apex:inputField required="true"  value="{!cont.title}"/></td>
      </tr>
     
      </table>
   </div>

    <br/>
    <br/>

    <div align="center"> 
     <apex:commandButton action="{!save}" value="I Accept" /> &nbsp;
     <apex:commandButton onClick="window.top.close();"  value="Decline" />
    </div>
   
  </apex:pageBlock>
  </div>

   </body>
   </html>
 </apex:form>
</apex:page>

Controller:
public without sharing class HSMPartnerTermsControllerISV{
  
  public Contact cont { get; set; }
    
  public Id accId;
    
  public HSMPartnerTermsControllerISV() {
      cont = new Contact();
      accId= apexpages.currentpage().getparameters().get('accid');
  }

  public PageReference save() 
  {
    try 
    {
           if(cont.Email==null){
            ApexPages.AddMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Please enter register email'));
            return null;
            }
            
            if(cont.FirstName==null){
            ApexPages.AddMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Please FirstName'));
            return null;
            }
            
         if(cont.LastName==null){
            ApexPages.AddMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Please LastName'));
            return null;
            }
            
         if(cont.Title==null){
            ApexPages.AddMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Please enter Title'));
            return null;
            }
            
        System.debug('Email '+cont.Email +'Account Id' +accId);
            
        List<Contact> checkCont = [SELECT Id, AccountId,Account.Name, Email FROM Contact where email=:cont.Email and AccountId=:accId limit 1];
        
        List<Account> acc        =[Select Id, Partner_Type__c,ISV_T_C_Accepted_Date__c,ISV_T_C_Accepted_By__c from account where Id=:accId limit 1];
    
       if(checkCont.isEmpty())
        {
          cont.AccountId=accId;
          insert cont;
          
          if(acc[0].Partner_Type__c =='ISV'){
              // ISV T&C Acceptance Section Fields
              acc[0].ISV_T_C_Accepted_By__c   = cont.Id;
              acc[0].ISV_T_C_Accepted_Date__c = System.Today();
              acc[0].ISV_T_C_Accepted__c=true;
              acc[0].ISV_T_C_Transition_Status__c='Accepted';
              update acc;
          }
          // T&C Acceptance Section Fields
          else{
              acc[0].T_C_Accepted_By__c   = cont.Id;
              acc[0].T_C_Accepted_Date__c = System.Today();
              acc[0].T_C_Accepted__c=true;
              acc[0].T_C_Transition_Status__c='Accepted';
              update acc;
          }
        } 
        
        else {
         if(acc[0].Partner_Type__c =='ISV'){  
           acc[0].ISV_T_C_Accepted_By__c   = checkCont[0].Id;
           acc[0].ISV_T_C_Accepted_Date__c = System.Today();
           acc[0].ISV_T_C_Transition_Status__c='Accepted';
           acc[0].ISV_T_C_Accepted__c=true;
           update acc;
          }
          else{ 
           // T&C Acceptance Section Fields
           acc[0].T_C_Accepted_By__c   = checkCont[0].Id;
           acc[0].T_C_Accepted_Date__c = System.Today();
           acc[0].T_C_Accepted__c=true;
           acc[0].T_C_Transition_Status__c='Accepted';
           update acc;
          } 
        }
        
        PageReference newocp = new PageReference('/HSMPartnerThank');
        newocp.setRedirect(true);
        return newocp;
    } catch (DMLException e) {
        ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR, 'Error.'));
        return null;
    }

    return null;
  }
  
  public PageReference cancel() {
    try {
        
        System.debug('Email '+cont.Email +'Account Id' +accId);
        
        List<Contact> checkCont = [SELECT Id, AccountId,Account.Name, Email FROM Contact where email=:cont.Email and AccountId=:accId limit 1];
        
        List<Account> acc        =[Select Id,Partner_Type__c,ISV_T_C_Accepted_Date__c,ISV_T_C_Accepted_By__c from account where Id=:accId limit 1];
    
       if(checkCont.isEmpty())
        {
          cont.AccountId=accId;
          insert cont;
          if(acc[0].Partner_Type__c =='ISV'){
          //ISV T&C Acceptance Section Fields
          acc[0].ISV_T_C_Accepted_By__c   = cont.Id;
          acc[0].ISV_T_C_Accepted_Date__c = System.Today();
          acc[0].ISV_T_C_Transition_Status__c='Declined';
          acc[0].ISV_T_C_Accepted__c=false;
          update acc;
          }
          else{
          // T&C Acceptance Section Fields
          acc[0].T_C_Accepted_By__c   = cont.Id;
          acc[0].T_C_Accepted_Date__c = System.Today();
          acc[0].T_C_Accepted__c=false;
          acc[0].T_C_Transition_Status__c='Declined';            
          update acc;
          }
        } else{
            if(acc[0].Partner_Type__c =='ISV'){
          //ISV T&C Acceptance Section Fields
           acc[0].ISV_T_C_Accepted_By__c   = checkCont[0].Id;
           acc[0].ISV_T_C_Accepted_Date__c = System.Today();
           acc[0].ISV_T_C_Transition_Status__c='Declined';
           acc[0].ISV_T_C_Accepted__c=false;
            update acc;
            }
           else{
           // T&C Acceptance Section Fields
           acc[0].T_C_Accepted_By__c   = checkCont[0].Id;
           acc[0].T_C_Accepted_Date__c = System.Today();
           acc[0].T_C_Accepted__c=false;
           acc[0].T_C_Transition_Status__c='Declined';
           update acc;
           }
        }
        
        PageReference newocp = new PageReference('/HSMPartnerThank');
        newocp.setRedirect(true);
        return newocp;
    } catch (DMLException e) {
        ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR, 'Error.'));
        return null;
    }

    return null;
  }
}
 
trigger FetchingDataFromOrder on ABI_SFA_Orders_with_Case__c (before insert,before update) {
      CaseRelatedlistFromOrder handler = new  CaseRelatedlistFromOrder();
      handler.Updateorderlinkdata(Trigger.new);
}    
  Trigger 

Trigger handler class:

public class CaseRelatedlistFromOrder{

    public void Updateorderlinkdata(list<id>listOrders){
           
        
        For(ABI_SFA_Orders_with_Case__c owc :listOrders){
        if(owc.ABI_SFA_Case__c != null && owc.ABI_SFA_Order_Link__c != null){
            listOrders.add(owc.ABI_SFA_Order_Link__c);

        }
        list<ABI_SFA_Order__c> listNewOrders = [select id,ABI_SFA_Accounting_resolution__c,ABI_SFA_Negotiations_Status__c from ABI_SFA_Order__c where id =: listOrders];
        
        
        For(ABI_SFA_Orders_with_Case__c owc2 : listOrders){
            
            for(ABI_SFA_Order__c ord :listNewOrders){
                if(owc2.ABI_SFA_Order_Link__c == ord.id){
                    owc2.ABI_SFA_Accounting_resolution__c= ord.ABI_SFA_Accounting_resolution__c;
                    owc2.ABI_SFA_Negotiations_status__c= ord.ABI_SFA_Negotiations_Status__c;
                    
                    
                }
                
            }
        }
        
    }
    }
}
What is the best way to write SOQL statement without for loop? Any sample code please?