• Nate Grieb
  • NEWBIE
  • 25 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
I'm trying to create a formula field that first checks to see if there IS a value for another field. If there is NOT a value there, do nothing. If there IS a value there subtract that value from an additional field. Here is the formula:

IF(
ISBLANK(Org_Member_Old_Value__c ),
NULL,
IF(NOT(ISBLANK(Org_Member_Old_Value__c)),
Org_Members__c -  Org_Member_Old_Value__c,
NULL
))

It is not working though, it is returning the value of (Org_Members__c - Org_Member_Old_Value__c) everytime regardless. 

Some additional information.
- Both of the other fields Org_Members__c  and Org_Member_Old_Value__c are number fields.
- The Org_Member_Old_Value__c is populated through a process that stores the previous value of the Org_Members__c field every time it is updated. 

Thanks!
I am trying to make a very simple code change to something completely unrelated to the Public Knowledge Base App (third party from app exchange) and I am getting the following error that is preventing me from deploying:

System.AssertException: Assertion Failed
class.pkb_mobile_Test.test_getArticleDetail: line 290, column 1

I checked out the code for this and the whole test looks like so:
 
//public static pkb_mobile_proxy.ResponseItem getArticleDetail(pkb_mobile_proxy.RequestItem req){
	@isTest(SeeAllData=true)
	static void test_getArticleDetail() {
		
		pkb_mobile_proxy.ResponseItem resp = null;

		//with setup
		populatePKB2Environment();
		PKB__c pkS = populateSetup();
		pkb_Controller.DEFAULT_SITE_NAME = siteName;
		pkb_Controller pc = pkb_mobile_controller.setUp();

		//build request object
		pkb_mobile_proxy.RequestItem req = new pkb_mobile_proxy.RequestItem();
		req.lang = KnowledgeArticleVersion.Language.getDescribe().getPickListValues().get(0).getValue();
		req.operationType = 'getArticleDetail';
		req.sessionId = 'TESTSESSION';
		req.searchCriteria = String.valueOf(kavObj.get('KnowledgeArticleId'));
		resp = pkb_mobile_controller.getArticleDetail(req);
 		
 		system.assert(resp.isSuccess);
 		
 		Map<String,String> fieldValues = (Map<String,String>)resp.articleData.fieldValues;
 		String kavTitle = String.valueOf(kavObj.get('title'));
 		String resultTitle = resp.articleData.title;
		system.assert( resultTitle.contains(kavtitle));
		
		//with null request 
		resp = pkb_mobile_controller.getArticleDetail(null);
		system.assert(!resp.isSuccess);

	}

I have not made any code changes to any of the PKB code, so I have to assume it is something in setup in the UI. Any help would be greatly appreciated. 

Thanks!
 
I am trying to create a trigger to create an opportunity on an account when their "billing state" is == trial. Right now, everytime the account is updated to trial it is creating 2 opportunites. Here is the trigger:

trigger Opportunity_inTrial on Account (before update, after update) {
    List<opportunity>Listopp = New List<opportunity>();
    for(account acc_old:trigger.old){
       if(acc_old.Billing_State__c != 'trial'){
           for(account acc:trigger.new){
            if(acc.Billing_State__c == 'trial'){    
                Opportunity opp = New opportunity();
                opp.accountid = acc.id;
                opp.name=acc.name;
                opp.CloseDate=date.Today()+14;
                opp.StageName='0 VO Score';
                Listopp.add(opp);
               }
           }
       }
    }
    if(Listopp.size()>0 && Listopp.size()<2)
    insert Listopp;
}
I'm trying to create a formula field that first checks to see if there IS a value for another field. If there is NOT a value there, do nothing. If there IS a value there subtract that value from an additional field. Here is the formula:

IF(
ISBLANK(Org_Member_Old_Value__c ),
NULL,
IF(NOT(ISBLANK(Org_Member_Old_Value__c)),
Org_Members__c -  Org_Member_Old_Value__c,
NULL
))

It is not working though, it is returning the value of (Org_Members__c - Org_Member_Old_Value__c) everytime regardless. 

Some additional information.
- Both of the other fields Org_Members__c  and Org_Member_Old_Value__c are number fields.
- The Org_Member_Old_Value__c is populated through a process that stores the previous value of the Org_Members__c field every time it is updated. 

Thanks!