how to change user status
I want to change the user status from X - > Y - > Z - > X based on config... so in doing that my system status would be set to released.
I am doing the updation each time from X--> Y and calling crm_order_maintain, crm_order_save, commit work and save , wait up to 20 seconds, crm_order_initialize.
Without doing wait up to 20 seconds, i am getting an error "Order cannot be changed" when i am updating the user status from Y->Z next time for same guid object ( contract item ).
My questions are
1. How do we identify whether we can change contract, for next user status using any FM. It says contract cannot be changed as "Transferring not completed". I used FM "CRM_ORDER_CHECK_CHANGE_ALLOWED" , but it always gives message "in transferring in middleware". Is there any other way to avoid wait up to 20 seconds , instead determine whether the contract can be changeable.
2. Can we update X
>Y>Z--->X in single crm_order_maintain.. can system track this changes that contract item has gone through various user status. When i checked it only keeps Y status. I am passing all user status as active. Can we pass in any other manner?..
3. When i call order initialize after each update of status , the lock is getting released and for next status chnage when i call order maintain, if some other user opens same contract in that time... lock error comes.. when i pass Keep lock in order initialize it is not working.. does that work and why does its not working....
Nithish PP replied
Dont pass all the statuses at once to CRM_ORDER_MAINTAIN,
For eg :
To get to status Z from X->Y->Z , you can follow below procedure
take staus - X
fill it_status and it_inputfields with a record each corresponding to status X.
take staus - Y
fill it_status and it_inputfields with a record each corresponding to status Y.
take staus - Z
fill it_status and it_inputfields with a record each corresponding to status Z.
After reching Z , call ORDER_SAVE and COMMIT.
Please use a internal table for all your status and place the order_maintain in loop , so that each status gets maintained while you navigate to next status.
Edited by: nithish P on May 17, 2011 8:15 AM