+ Start a Discussion
Sourav PSourav P 

Issue in creating a new task in PB

Hi
I want to create a new task only when a new opp is getting created . But when the mobile ( created in Opp , taken from person account object) or Phone ( account) , anyone is present then only it will create the task for personal account. For business account, as i have only phone number, it should create the task only when the account has the phone number.
Now i am getting the issue in that. Below is my PB,its working fine but creating tasks even when the phone or mobile numbers are not present, how to rectify that ?
I have created it from Quote, as when from account i am creating a NEW opp, its creating  a quote first, once quote is completed , its automatically a new opp has been created.
Criteria :
User-added image
In the above,
1. Opportunity ID
2. Opportunity task follow up counter : a custom field to keep tract of the task created of the specific subject " Opp follow up"
3. Opp>Account >Phone
4. Opp>Acc> Is person Acc
5. Opp> Mobile ( mobile from opp>acc>person account>mobile)
6, Opp>Acc> Is person acc

Logic :
1 AND 2 AND ((3 OR (4 AND 5)) OR 6 OR 4)
I even tried replacing the above with formula, but then its not at all creating the task , Below is my formula
IF(
AND([Quote].OpportunityId !=Null , [Quote].Opportunity.Opp_Follow_Up_Task_Counter__c =Null , [Quote].Opportunity.Account.IsPersonAccount =true , OR([Quote].Opportunity.Mobile__c !=Null, [Quote].Opportunity.Account.Phone !=Null )),true,

IF(

AND([Quote].OpportunityId !=Null , [Quote].Opportunity.Opp_Follow_Up_Task_Counter__c =Null , [Quote].Opportunity.Account.IsPersonAccount =false , [Quote].Opportunity.Account.Phone !=Null ),true,false

)


)
If anyone plz suggest, how can i control the task creation as per the mobile and phone for both corporate & personal accounts.
I tried modified my PB, other ways, but while creating from the corporate acc, its showing me always the below error,

 Error element myDecision (FlowDecision).
The flow failed to access the value for myVariable_current.Opportunity.Mobile__c because it hasn't been set or assigned.





 
Best Answer chosen by Sourav P
Malni Chandrasekaran 2Malni Chandrasekaran 2
Sourav P,
I am trying to understand the problem first, pls correct me if I am wrong.

1. Opportunity ID
2. Opportunity task follow up counter : a custom field to keep tract of the task created of the specific subject " Opp follow up"
3. Opp>Account >Phone
4. Opp>Acc> Is person Acc
5. Opp> Mobile ( mobile from opp>acc>person account>mobile)
6, Opp>Acc> Is person acc

Assume, (correct me if my assumption is wrong)
1  - true
2 - true
3 - false - No Number
4 - true - personal account
5 - false - No number
6 - false - not a corporate account

then your formula yields,
1 AND 2 AND ((3 OR (4 AND 5)) OR 6 OR 4)
T AND T AND ((F OR (T AND F)) OR F OR T)   --> T and T and ((F OR F)  or F or T) --> T AND T AND (F OR F OR T) --> T and T and T
And now, the final result turns as T though the phone and mobile fields are null.

Please try,
1 AND 2 AND  (  (4 AND (3 OR 5)) OR (NOT(4) AND 3) )

(4 AND (3 OR 5)) - This part checks if it is personal account and if there is any number (phone or mobile) available
(NOT(4) AND 3) - This part checks if it is corporate account and if the phone number is not null.

According to our assumption, the formula yields,

T AND T AND  (  (T AND (F OR F)) OR (NOT(T) AND F) )  --> T AND T AND ( (T AND F) OR (F AND F) ) --> T AND T AND (F OR F) 
--> T AND T AND F --> Fails to create a task

Scenario 2 : Personal account with available phone number
1  - true
2 - true
3 - True- No Number
4 - true - personal account
5 - false - No number
6 - false - not a corporate account

T AND T AND  (  (T AND (T OR F)) OR (NOT(T) AND F) )  --> T AND T AND ( (T AND T) OR (F AND F) ) --> T AND T AND (T OR F) 
--> T AND T AND T --> creates a task

The suggested formula works fine in all scenarios, if my understanding is correct.

Please mark it as solved if it works, or else please dont hesitate to get back to me.

All Answers

Malni Chandrasekaran 2Malni Chandrasekaran 2
Sourav P,
I am trying to understand the problem first, pls correct me if I am wrong.

1. Opportunity ID
2. Opportunity task follow up counter : a custom field to keep tract of the task created of the specific subject " Opp follow up"
3. Opp>Account >Phone
4. Opp>Acc> Is person Acc
5. Opp> Mobile ( mobile from opp>acc>person account>mobile)
6, Opp>Acc> Is person acc

Assume, (correct me if my assumption is wrong)
1  - true
2 - true
3 - false - No Number
4 - true - personal account
5 - false - No number
6 - false - not a corporate account

then your formula yields,
1 AND 2 AND ((3 OR (4 AND 5)) OR 6 OR 4)
T AND T AND ((F OR (T AND F)) OR F OR T)   --> T and T and ((F OR F)  or F or T) --> T AND T AND (F OR F OR T) --> T and T and T
And now, the final result turns as T though the phone and mobile fields are null.

Please try,
1 AND 2 AND  (  (4 AND (3 OR 5)) OR (NOT(4) AND 3) )

(4 AND (3 OR 5)) - This part checks if it is personal account and if there is any number (phone or mobile) available
(NOT(4) AND 3) - This part checks if it is corporate account and if the phone number is not null.

According to our assumption, the formula yields,

T AND T AND  (  (T AND (F OR F)) OR (NOT(T) AND F) )  --> T AND T AND ( (T AND F) OR (F AND F) ) --> T AND T AND (F OR F) 
--> T AND T AND F --> Fails to create a task

Scenario 2 : Personal account with available phone number
1  - true
2 - true
3 - True- No Number
4 - true - personal account
5 - false - No number
6 - false - not a corporate account

T AND T AND  (  (T AND (T OR F)) OR (NOT(T) AND F) )  --> T AND T AND ( (T AND T) OR (F AND F) ) --> T AND T AND (T OR F) 
--> T AND T AND T --> creates a task

The suggested formula works fine in all scenarios, if my understanding is correct.

Please mark it as solved if it works, or else please dont hesitate to get back to me.
This was selected as the best answer
Alain CabonAlain Cabon
Hi,

1 AND 2 AND (( 3 OR (4 AND 5)) OR 6 OR 4)

3. Opp>Account >Phone is not null
4. Opp>Acc> Is person Acc is null
5. Opp> Mobile is not null
6, Opp>Acc> Is person Acc is not null

The value of phone (3) will have no effect for the final result because 6 OR 4 is always true here.

Are you sure of your descriptions of 4 and 6?  

1 AND 2 AND ( 3 [phone] AND 4 [business person] OR ( 3 [phone] OR 5 [mobile] ) AND 6 [person account] )

Regards.
Alain CabonAlain Cabon
1 AND 2 AND ( 3 [phone] AND 4 [business account] OR ( 3 [phone] OR 5 [mobile] ) AND 6 [person account] )
Alain CabonAlain Cabon
@Malni Chandrasekaran: we wrote our answer at the same time in parallel.  :-) You have probably the same solution.
Malni Chandrasekaran 2Malni Chandrasekaran 2
@Alain Cabon,
Yeah :) I did not use 6 thinking 6 is nothing but NOT(4). It must be either personal or corporate account was my assumption :-)
Sourav PSourav P
Dear Both, Thanks for the suggestions.
Dear Malni, Thanks a lot for your detailed explanations, It made me understand better where i went wrong :) . and your logic worked .
Sourav PSourav P
Dear Both,
Is this possible to further create certain configs from this PB or i have a to a new PB? ( posted another question as a new PB try)
Once i have a task open with sub as " opp follow up", and the user try to close it, it will automatically create another task with same subject if certain criteria met. I created the PB in Task but couldnt able to related task to the existing opportunity, can you plz help. Below is my try on  Task object, ( Or if we can create in this same PB?)

User-added image

Logic
1 AND 2 AND (3 OR 4) AND ( 5 OR 6 OR 7) AND 8