function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sumpritsumprit 

Using SubString Function in a S-Control

Can someone take a look at this piece of code?

 

if(dynaBean.Product2.ProductCode == '25PS'){

updateAccount.PowerSystem__c = 1;                  

if(PowerSystem.substring(0,4))== 0 isChanged )= true;                      

}

 

 

What is the correct technique of using substring function in the Salesforce. I want to say, if the Product Code of the Product Name – POWERSYSTEM starts with 25PS then it should place a check mark.

 

Could you suggest please?

 

 



sumpritsumprit
I found the answer to this problem, that I would like to share with everyone.

if(dynaBean.Product2.ProductCode.substring(0,4) == '25PS'){
updateAccount.PowerSystem__c = 1;
if(power == 0) isChanged = true;
}


Hope this helps